-
Notifications
You must be signed in to change notification settings - Fork 103
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
build process rebuilds all crates #351
Comments
Try at least basic filtering:
|
Oh dear. There's more wrong with that setup. What's important to understand is that most of crane's derivation produce a copy of the cargo's So generally you want to structure derivations as:
BTW. @ipetkov It seems to me that oftentimes running clippy, tests, coverage in separate steps is jus produces tons of artifacts for no good reason. I was thinking if it wouldn't be better to have:
|
I copied this from an example somewhere. But I cannot find it anymore. Guess I will have to redo it. What is a good example I should use? |
@brianmay I think I see the issue! Your root Cargo.toml specifies a package entry meaning that running When you run There's a couple of different ways to fix this, all of which depend on how you'd like to build the workspace:
I hope this clarifies things somewhat but I'm happy to elaborate if they don't. I'll also update the docs to highlight this kind of pitfall! @dpc it's entirely possible to set a compound build command (e.g. |
Hmmm. This makes sense. robotica-rust is the top level package. Unless I have misunderstood something, I think the top level package is required to enable the sub packages. For now, I guess the 3rd option probably should work. (except nothing is that simple, https://github.com/brianmay/robotica-rust/blob/fix_flake/flake.nix gives me other, possibly unrelated errors https://gist.github.com/brianmay/74681e5506d51153113fb4d4be53409c - should I open another bug report for this?) But eventually I will want to build the binaries associated with the brian-backend package also. Which in turn requires building brian-frontend using wasm-pack (see Dockerfile for current build steps). Trying to work this out is going to be fun. Which is why I started off with just robotica-slint. Wondering if I should be splitting some of this stuff into its own repo and/or workspace. Maybe at least for the wasm stuff. That way I don't have to worry wasm dependencies getting built for non-wasm builds. |
I reproduced - what appears to be the other error - with a simpler project, and opened another bug report: #353 |
Note to self: looks like the buildInputs and nativeBuildInputs need to be in sync too, otherwise rustc will try to rebuild crates and fail because it is readonly. I have robotica-slint working, will try to clean it up a bit tomorrow. And then try to work out how to deal with brian-robotica. |
The top level
Note that the
I would definitely recommend splitting out wasm builds into their own separate set of derivations (you don't have to make it a separate repo to make it work with
This is correct, or rather if any dependencies need other build inputs (e.g. openssl, or pkg-config) those will need to be present in the |
As discussed here: https://hachyderm.io/@penguin_brian/110658388881357896
Log showing problem: https://gist.github.com/brianmay/350d6a1832f7d2816718d59e1a35d80c
Source code: https://github.com/brianmay/robotica-rust/blob/main/flake.nix
The recommended change did not help: brianmay/robotica-rust@31fc41b
(I also tried changing the value to cargoArtifacts but that didn't help either)
The text was updated successfully, but these errors were encountered: