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

Revert "Merge pull request #165 from sched-ext/reduce-rust-build-load" #167

Merged
merged 1 commit into from
Feb 29, 2024

Conversation

htejun
Copy link
Contributor

@htejun htejun commented Feb 29, 2024

This reverts commit a7b39f2, reversing changes made to cf7404f.

The PR doesn't do what the description says. It instead limits the number of rustc instances to 1 for each cargo build making rust builds extremely slow. Let's revert and try again.

This reverts commit a7b39f2, reversing
changes made to cf7404f.

The PR doesn't do what the description says. It instead limits the number of
rustc instances to 1 for each cargo build making rust builds extremely slow.
Let's revert and try again.
@htejun htejun merged commit 79dac2e into main Feb 29, 2024
1 check passed
@arighi
Copy link
Collaborator

arighi commented Feb 29, 2024

Hm... yeah that's definitely not what I wanted to do, will do more tests, sorry for the noise.

@htejun
Copy link
Contributor Author

htejun commented Feb 29, 2024

No worries. Hopefully, there's a way to do this with meson.

@arighi
Copy link
Collaborator

arighi commented Mar 1, 2024

No worries. Hopefully, there's a way to do this with meson.

Asked the meson guys and apparently there's not a way (yet), unless we pass --jobs=1 to the meson compile command line.

meson 1.4.0-rc1 will have builtin Rust support, basically it can run rustc directly without cargo and it'll be able to account the proper amount of jobs, handle dependencies, etc. but relying on that doesn't seem very portable (not all distro will immediately move to the new meson).

Probably for now the best way is to use --jobs=1 directly in our CI scripts (that seems to properly parallelize rustc across all the available CPUs, serializing the cargo build instances) and maybe also add --jobs=1 to the README, so people may just copy/paste that and build all the Rust stuff without overloading their system...

@htejun
Copy link
Contributor Author

htejun commented Mar 1, 2024

We're also having trouble integrating libbpf build. I'm half-way convinced that meson isn't a great option for this repo and might switch to something which is more expressive and less restrictive. If you have some ideas on which build system would be better, please share.

@htejun
Copy link
Contributor Author

htejun commented Mar 1, 2024

So, possibly a better way of serializing rust builds is introducing serial dependencies across all of them so that e.g. scx_layered depends on scx_rustland which depends on scx_rusty and so on, so that the build system is forced to serialize them.

@arighi
Copy link
Collaborator

arighi commented Mar 1, 2024

I wish there was a better way than adding direct dependencies like that, but if that works I guess it can be a reasonable workaround.

If there was a way to set --njobs=1 by default, unless specified otherwise, everything would work perfectly. I can't believe meson doesn't have something like that.

Anyway, I'll investigate a bit.

@htejun
Copy link
Contributor Author

htejun commented Mar 1, 2024

--njbos=1 is okay but not perfect in that it'd serialize compilation of all c scheds. They tend to be pretty small and we don't have many of them, so that's mostly okay, I guess.

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.

None yet

2 participants