-
Notifications
You must be signed in to change notification settings - Fork 331
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
Add option to save the BuildSourcesEphemeral overlay. #3336
Conversation
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.
So I'm not too sure about adding official support for my hack, how about we document it somewhere instead?
d997c3d
to
1609226
Compare
It's a hack, but it's quite a useful hack and when one has more than single build script, having the setup code in each is a lot of boilerplate and if one wants to reduce it, it means adding a bit of shell wrapper into the tools tree and/or image and still a bit of boilerplate. I've instead added another line to the docs and some explosion emojis around it. I've added the don't merge label for now, though, since I need to test this once more. The thing I build segfaulted and I need to see whether it's somehow from this are the thing just being broken. |
I'm also happy to call the option |
1609226
to
28fe4c8
Compare
92a0ba0
to
73e6844
Compare
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.
Shouldn't we limit this to only when running build scripts and do regular ephemeral for the other scripts?
40fb5f2
to
f5b4fce
Compare
Good catch, I thought it was there, that's why it's mentioned in the man page. I must have lost this in a rebase. |
mkosi/mounts.py
Outdated
with contextlib.ExitStack() as stack: | ||
options: list[PathString] = [] | ||
|
||
for t in config.build_sources: | ||
src, dst = t.with_prefix("/work/src") | ||
|
||
if ephemeral: | ||
upperdir = Path(stack.enter_context(tempfile.TemporaryDirectory(prefix="volatile-overlay"))) | ||
os.chmod(upperdir, src.stat().st_mode) | ||
if ephemeral == BuildSourcesEphemeral.buildcache and config.build_dir is not None: |
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.
I would fail if this is specified but there's no build directory configured
f5b4fce
to
5eff7d4
Compare
This systematises a trick Daan showed me a while back and that I've been using most everywhere since. Having it in mkosi itself makes it easier to use for everybody.