RFR: 8342858: Make target mac-jdk-bundle fails on chmod command

Erik Joelsson erikj at openjdk.org
Tue Oct 22 21:37:37 UTC 2024


The target mac-jdk-bundle can fail randomly. MacBundles.gmk defines a large number of individual copy rules, which can execute in any order. The "install-file" (our copy) macro on macos includes a check for weird attributes using `xattr` so that we can remove them. We use the switch `-s` to make sure that xattr operates on symlinks instead of their targets. However, if we find something, we also run `chmod` to make sure we have the permissions to remove attributes in the first place, but the chmod command does not have the `-h` switch to operate on the symlink instead of the target. So if the symlink gets copied before its target, there is a chance that we try to run chmod before the target exists, which will result in a failure. My proposed fix is to add `-h` to the chmod command so that everything operates on the symlink instead of the target.

-------------

Commit messages:
 - JDK-8342858

Changes: https://git.openjdk.org/jdk/pull/21649/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21649&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8342858
  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/21649.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/21649/head:pull/21649

PR: https://git.openjdk.org/jdk/pull/21649


More information about the build-dev mailing list