-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
8313374: --enable-ccache's CCACHE_BASEDIR breaks builds #15080
8313374: --enable-ccache's CCACHE_BASEDIR breaks builds #15080
Conversation
👋 Welcome back jkratochvil! A progress list of the required criteria for merging this PR into |
@jankratochvil The following label will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
@jankratochvil can please update the JBS issue to explain how you went from the problem description there to the proposed fix. Thanks |
@jankratochvil The change here will force ccache to write absolute paths for all compilations, which may cause cached object file comparisons to fail sometimes, and I'm not sure we'd want that? Have you tried running make clean before recompilations? (Note that there are 2 different targets for this, make clean for cleaning build artifacts and make dist-clean which removes almost everything in the build directory). Weird bugs can happen sometimes if clean is not run, as stated in the warning message each time configure is run. I also read the issue in the tracker, and I don't think removing --enable-ccache entirely is correct, as we need that option to check for certain things (like if ccache can handle precompiled headers) and also disable aliasing ccache as the compiler during the build for that exact reason. I'm also not too sure how removing CCACHE_BASEDIR helps fix the issue, since all it does it change the command passed to the real compiler, could you elaborate on that slightly more? |
Woah! Slow down a little, I wasn't asking you to remove the change entirely, just to elaborate on what the change does to achieve the fix, since it's a little unclear to me |
OK so the real problem is:
When trying to fix it I have found |
Personally I am scared of |
I see, I don't think we have to keep CCACHE_BASEDIR if it is not required, but we should test it to see how the build reacts to such a change, since it does change the behaviour of ccache which is a little bit nerve wracking. I unfortunately cannot see the bug either, perhaps either David or @erikj79 could help with why both options were implemented this way |
BTW |
@jankratochvil See the comments here: jdk/make/autoconf/flags-cflags.m4 Line 821 in eaa42e8
and before the change you made in NativeCompilation.gmk to understand why this is done. |
Ah, these changes were done for better reproducible builds, I had completely missed that. The relative paths mean that the compiled files aren't all using different absolute paths in their macros and so on, making the build more reproducible. Changing these would be rather problematic for a lot of things unfortunately Edit: Nevermind, David beat me to it |
Actually this pre-dates that but yes relative paths do support reproducible builds. :) |
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.
That certainly looks much clearer in terms of what is being done and why - thanks. Now just need someone with ccache experience to validate the actual fix.
I doubt there is anyone as it did not work. :-) |
@TheShermanTanker made a suggestion:
I got it by mail but I do not see it here - has it been deleted? I admit I prefer how it is now, this oneliner looks a bit cryptic to me. |
Yes, it's been deleted since I deemed it too verbose for this use case |
I understand why you need I'm not surprised that ccache support has bit rotted over the years as we aren't seeing much benefit from it in practice, so it's probably not used much. In the ideal case, it certainly speeds up the build a lot, but that case is very rare, at least in our build scenarios. I wouldn't mind removing it at this point, but if we can fix it with a simple patch like this, then that works too. Note that trying to setup ccache correctly without support in the build is quite tricky to get right. That's why I thought it necessary to handle it explicitly in the makefiles. |
I did try it without
I do see a big benefit from it. When changing branches by
It is not tricky, I am happily using |
Um, I've been using it for years without noticing any problems, and measured a frequent speedup for my normal use. |
- suggested by Erik Joelsson.
- suggested by Erik Joelsson
@jankratochvil 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 110 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. As you do not have Committer status in this project an existing Committer must agree to sponsor your change. Possible candidates are the reviewers of this PR (@dholmes-ora, @TheShermanTanker, @erikj79) but any other Committer may sponsor as well. ➡️ To flag this PR as ready for integration with the above commit message, type |
/integrate |
@jankratochvil |
I don't understand what problem this PR is fixing. I see assertions from the |
Does the reproducer work for you? https://bugs.openjdk.org/browse/JDK-8313374 |
Yes, it works for me. Or at least, with the commands and setup I normally use, |
Maybe your setup does not reproduce this problem. Still the most simple ccache setup does reproduce the problem. And the problem is known and described above. So why it should not be fixed?
|
I tried this myself today and here are my findings. If the output dir is a subdir of the Kim is likely not seeing this because in Oracle builds, because we add a custom repository outside of the OpenJDK repository, we typically put the build dir outside of the OpenJDK repo, and so outside of So in summary, this fix is needed, and we have a different bug with ccache handling for Oracle builds that hid it from us. |
Mailing list message from Kim Barrett on build-dev:
Thanks for chasing that down Erik. On that basis, I?ve no issues with the proposed change. -------------- next part -------------- |
/sponsor |
Going to push as commit 571c435.
Your commit was automatically rebased without conflicts. |
@yan-too @jankratochvil Pushed as commit 571c435. 💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored. |
https://bugs.openjdk.org/browse/JDK-8313374
--enable-ccache's CCACHE_BASEDIR breaks builds
Progress
Issue
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/15080/head:pull/15080
$ git checkout pull/15080
Update a local copy of the PR:
$ git checkout pull/15080
$ git pull https://git.openjdk.org/jdk.git pull/15080/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 15080
View PR using the GUI difftool:
$ git pr show -t 15080
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/15080.diff
Webrev
Link to Webrev Comment