Skip to content
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

Makefile: use XZ_OPT=-0 for make vm #495

Merged
merged 1 commit into from
Jun 4, 2024

Conversation

allisonkarlitskaya
Copy link
Member

...and make make check go via make vm so that it benefits as well.

This shaves quite some seconds off of image building (42s instead of 1m36s). Most of that comes from compressing node_modules/ which seems like the obvious candidate to get rid of, but it's required by the build. We could work around that, but it would involve some deeper hacks, so let's make the easy change, instead.

@allisonkarlitskaya allisonkarlitskaya requested a review from jelly June 4, 2024 11:58
@allisonkarlitskaya
Copy link
Member Author

fedora-rawhide failures are due to some hopefully extremely transient failure to install dnf5...

Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! The dnf5 rawhide FUBAR is also affecting cockpit, we need to ignore this for the time being.

Makefile Outdated
Comment on lines 210 to 211
prepare-check: $(NODE_MODULES_TEST) $(VM_IMAGE) test/common
prepare-check: $(NODE_MODULES_TEST) vm test/common
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please don't depend on a phony target. This was deliberately done with VM_IMAGE so that repeated make checks don't always rebuild the VM (which is annoying). I.e. revert this and the hunk above.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will depend on the .PHONY target, which will always call make on the $(VM_IMAGE) target. but that will be a no-op if nothing changed. I tested this. :)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a note about this to the commit message.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So what's the advantage of doing it like this? It feels weird that you introduce an extra (useless) make call in a PR which is supposed to make things faster.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's about giving me a way to set the environment variable.

Makefile Outdated
vm: $(VM_IMAGE)
.PHONY: vm
vm:
XZ_OPT=-0 make "$(VM_IMAGE)"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks fine. Can you please send this to starter-kit as well?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was planning to after we sort this out here 👍

martinpitt
martinpitt previously approved these changes Jun 4, 2024
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd rather like these two changes to be split, as they are unrelated. And the dep change justified better. But if you are in a rush, ok.

@allisonkarlitskaya
Copy link
Member Author

I'd rather like these two changes to be split, as they are unrelated. And the dep change justified better. But if you are in a rush, ok.

They're definitely related, and I'm not in a rush, so let's talk it out.

...targets which depend on it, like `make check`.

This shaves quite some seconds off of image building (42s instead of
1m36s).  Most of that comes from compressing node_modules/ which seems
like the obvious candidate to get rid of, but it's required by the
build.  We could work around that, but it would involve some deeper
hacks, so let's make the easy change, instead.
@allisonkarlitskaya
Copy link
Member Author

Here's another approach that you might like better. It's less explicit, and I've seen weird behaviour with these sorts of export stanzas in the past, but it seems to be working (I checked make vm, make check, and also manually rolling a tarball via make dist node-cache).

@allisonkarlitskaya allisonkarlitskaya changed the title Makefile: use XZ_OPT=-0 for make vm Makefile: use XZ_OPT=-0 for make vm Jun 4, 2024
Copy link
Member

@martinpitt martinpitt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! As per chat, I was missing the bit that you wanted another make process to shove in the env var. Sorry about that.

Either implementation is fine for me, but this one is easier to understand.

@allisonkarlitskaya allisonkarlitskaya merged commit e694d43 into cockpit-project:main Jun 4, 2024
8 checks passed
@allisonkarlitskaya allisonkarlitskaya deleted the xz-0 branch June 19, 2024 21:42
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.

2 participants