On Tue, 22 Oct 2024 21:30:40 GMT, Erik Joelsson <er...@openjdk.org> wrote:
> 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. > This finally explains the odd problem you reported in [#20837 > (comment)](https://github.com/openjdk/jdk/pull/20837#issuecomment-2327132241). > That has been worrying me a bit, if there were some issue with that PR after > all, but it turrned out to just be an unlikely race. _phew_ I'm not sure that error was caused by this issue. That would imply that I had strange file attributes on files in my build directory, and I don't think I do. ------------- PR Comment: https://git.openjdk.org/jdk/pull/21649#issuecomment-2432943275