[Improvement-18035][dist] Exclude macOS junk from bin tar.gz for clean Linux extraction#18036
[Improvement-18035][dist] Exclude macOS junk from bin tar.gz for clean Linux extraction#18036macdoor wants to merge 7 commits intoapache:devfrom
Conversation
Made-with: Cursor
- Add excludes for **/._* and **/.DS_Store in dolphinscheduler-bin.xml fileSets - Add ._* to .gitignore (AppleDouble files) Made-with: Cursor
Replace find delete + xattr + conditional tar with single tar --exclude='._*' --exclude='.DS_Store' to avoid extra logic in packaging. Made-with: Cursor
|
|
Hi @SbloodyS, I built the package on macOS with the current change (tar So How would you like to proceed? |
|
I used the current PR compiler in my environment and didn't find the file and warning you mentioned. And I didn't find the corresponding file in the published binary package. Please recheck your environment. @macdoor |
|
Hi @SbloodyS, I ran the test again with the same result (junk and xattr warnings on Linux). Here is my environment for comparison: Packaging (build) environment (macOS): Extraction environment (Linux): So the package is created with bsdtar on macOS (ARM64), then extracted with GNU tar on Ubuntu. The |
|
I packed it with m1 pro chip. And Unzipped in ubuntu24.04. I still can't reproduce your problem. This problem can be ignored for the time being. |
|
Hi @SbloodyS, I'm fine with leaving this as-is for now. We can revisit the macOS build case later if required. |
dolphinscheduler-dist/src/main/assembly/dolphinscheduler-bin.xml
Outdated
Show resolved
Hide resolved
- Add maven-antrun-plugin in root pom: package phase deletes ._* and .DS_Store from each module's target/ - Remove <excludes> from dolphinscheduler-bin.xml fileSets (handled at module level now) Made-with: Cursor
| <!-- Remove macOS junk from each module's target so assembly picks up clean output --> | ||
| <plugin> | ||
| <groupId>org.apache.maven.plugins</groupId> | ||
| <artifactId>maven-antrun-plugin</artifactId> | ||
| <version>3.1.0</version> | ||
| <executions> | ||
| <execution> | ||
| <id>clean-macos-junk</id> | ||
| <phase>package</phase> | ||
| <goals> | ||
| <goal>run</goal> | ||
| </goals> | ||
| <configuration> | ||
| <target> | ||
| <delete failonerror="false"> | ||
| <fileset dir="${project.build.directory}" includes="**/._*, **/.DS_Store, ._*, .DS_Store" /> | ||
| </delete> | ||
| </target> | ||
| </configuration> | ||
| </execution> | ||
| </executions> | ||
| </plugin> |
There was a problem hiding this comment.
We don't need to add this, we use fileSets to collect the file, we already exclude this
<exclude>**/.DS_Store</exclude>
<exclude>**/Thumbs.db</exclude>
| # repack bin tar (exclude macOS junk so extraction on Linux is clean) | ||
| BIN_TAR_FILE_NAME=$(basename $BIN_TAR_FILE) | ||
| cd $DIST_DIR && tar -zcf $BIN_TAR_FILE_NAME apache-dolphinscheduler-*-bin | ||
| cd $DIST_DIR && tar -zcf $BIN_TAR_FILE_NAME --exclude='._*' --exclude='.DS_Store' apache-dolphinscheduler-*-bin |
There was a problem hiding this comment.
This is caused by you open the directory by finder?
There was a problem hiding this comment.
This is caused by you open the directory by finder?
Hi @ruanwenjun,
The root cause of this issue is macOS tar (bsdtar) behavior — it automatically embeds ._* (AppleDouble) entries and extended attribute headers into the archive when creating a tarball, even if no ._* files exist on disk. This is a well-known cross-platform issue:
https://superuser.com/questions/61185/why-do-i-get-files-like-foo-in-my-tarball-on-os-x
OS X's tar uses the AppleDouble format to store extended attributes and ACLs. [...] You can tell tar to not include the metadata by setting
COPYFILE_DISABLEto some value.
So it's not caused by opening the directory in Finder — it happens whenever macOS bsdtar packs any file that has extended attributes (which macOS adds silently, e.g. com.apple.provenance).



Purpose
When the release
tar.gzis built on macOS, the archive can contain._*files,.DS_Store, and extended attributes, causing warnings and junk files when extracted on Linux. This change updatesassembly-plugins.shso the repack step strips macOS-specific data and produces a Linux-friendly archive.fixes #18035
Brief change log
._*and.DS_Storeunder the bin directory.xattr -cron the bin directory; repack withCOPYFILE_DISABLE=1andtar --no-xattrsso the finaltar.gzhas no extended attributes.No changes to
dolphinscheduler-bin.xmlor other assembly descriptors.Made with Cursor