-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8342858: Make target mac-jdk-bundle fails on chmod command #21649
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
👋 Welcome back erikj! A progress list of the required criteria for merging this PR into |
|
@erikj79 This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 9 new commits pushed to the
Please see this link for an up-to-date comparison between the source branch of this pull request and the ➡️ To integrate this PR with the above commit message to the |
| $(CHMOD) u+w '$(call DecodeSpace, $@)'; \ | ||
| $(CHMOD) -h u+w '$(call DecodeSpace, $@)'; \ | ||
| $(XATTR) -cs '$(call DecodeSpace, $@)'; \ | ||
| fi |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about running chmod only against real files?
else \
$(CP) -fRP '$(call DecodeSpace, $<)' '$(call DecodeSpace, $@)'; \
if [ -n "`$(XATTR) -ls '$(call DecodeSpace, $@)'`" ]; then \
$(CHMOD) -h u+w '$(call DecodeSpace, $@)'; \
$(XATTR) -cs '$(call DecodeSpace, $@)'; \
fi \
fi
And maybe add an explaining comment after line 122:
# The above fixup actions are only necessary if the file is actually copied.
# When creating just a softlink, we rely on the softlink target being fixed when copied.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user reporting this issue actually had an attribute on the softlink itself, which I think we want to remove, so I would rather operate on the softlink. I haven't investigated how the attribute appeared on the softlink, but the purpose of this code is to clear away any unexpected attributes from files in the image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This phenomenon is exploiting all possible facets...
In that case, massaging the softlink is necessary, I agree.
RealLucy
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
|
This finally explains the odd problem you reported in #20837 (comment). 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. |
|
/integrate |
|
Going to push as commit a522d21.
Your commit was automatically rebased without conflicts. |
I can't see what else did. I think the strange attributes are injected a bit arbitrarily by Apple. Check all your JDK files, if you dare. ;-) |
Oh well, I just did and you were right, I have the provenance attribute on my whole build dir atm. |
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
xattrso that we can remove them. We use the switch-sto make sure that xattr operates on symlinks instead of their targets. However, if we find something, we also runchmodto make sure we have the permissions to remove attributes in the first place, but the chmod command does not have the-hswitch 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-hto the chmod command so that everything operates on the symlink instead of the target.Progress
Issue
Reviewers
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/21649/head:pull/21649$ git checkout pull/21649Update a local copy of the PR:
$ git checkout pull/21649$ git pull https://git.openjdk.org/jdk.git pull/21649/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 21649View PR using the GUI difftool:
$ git pr show -t 21649Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/21649.diff
Webrev
Link to Webrev Comment