Skip to content

cmake: separate installing and building (again) #13036

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

Merged
merged 5 commits into from
Oct 19, 2022
Merged

cmake: separate installing and building (again) #13036

merged 5 commits into from
Oct 19, 2022

Conversation

BratishkaErik
Copy link
Contributor

Extracted from #12747
Closes #12722

@BratishkaErik BratishkaErik marked this pull request as ready for review October 1, 2022 16:59
@BratishkaErik
Copy link
Contributor Author

BratishkaErik commented Oct 16, 2022

Doesn't it just copies from cache to install prefix tho? Why would it builds twice?

@andrewrk
Copy link
Member

Hmm that's a fair point. I suppose instead of this I could enhance incremental cache mode to detect when there are no changes. Let me try that and get back to you...

@andrewrk
Copy link
Member

andrewrk commented Oct 16, 2022

Enhancing incremental compilation will be a sub-project in and of itself. For now I made self-hosted act closer to the behavior of stage1, which I think will be a satisfactory solution for the 0.10.0 release, and will allow us to merge this PR. See the commit that I force-pushed for more details.

In summary...

Doesn't it just copies from cache to install prefix tho? Why would it builds twice?

Now it has the desired behavior as you described here 👍

@andrewrk andrewrk self-assigned this Oct 17, 2022
@andrewrk
Copy link
Member

Alright I solved the bug that was causing the Windows CI to fail. Hopefully it will pass now.

BratishkaErik and others added 5 commits October 18, 2022 16:52
build.zig: add a 'compile' step to compile the self-hosted compiler
without installing it.
Compilation: set cache mode to whole when using the LLVM backend and
--enable-cache is passed.

This makes `zig build` act the same as it does with stage1. Upside is
that a second invocation of `zig build` on an unmodified source tree
will avoid redoing the compilation again. Downside is that it will
proliferate more garbage in the project-local cache (same as stage1).

This can eventually be fixed when Zig's incremental compilation is more
robust; we can go back to having LLVM use CacheMode.incremental and rely
on it detecting no changes and avoiding doing the flush() step.
Windows gives AccessDenied if you delete a directory which contains open
file handles. This could be triggered when using CacheMode.whole when
cross compiling macho test binaries.
@andrewrk andrewrk merged commit 8a344fa into ziglang:master Oct 19, 2022
@BratishkaErik BratishkaErik deleted the fix-installing branch October 19, 2022 14:16
BratishkaErik added a commit to BratishkaErik/gentoo that referenced this pull request Oct 19, 2022
gentoo-bot pushed a commit to gentoo/gentoo that referenced this pull request Oct 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Separate installing and building self-hosted compiler
2 participants