project: move to nixpkgs Rust infrastructure #147
Labels
No labels
bug
dependency
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
review-next
security
stub
tool
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: raito/lanzaboote#147
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "nixpkgs-infrastructure"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
This builds the stub and tool using
rustPlatform.buildRustPackage
which features a stable Rust compiler, recent enough to support UEFI targets.In the future, it will rely on properly defined targets for UEFI in nixpkgs.: we won't need it.For now, this PR is broken and depends on various changes in nixpkgs upstream for proper "cross compilation" support for UEFI targets, see https://github.com/NixOS/nixpkgs/pull/226145 for example.Closes #98.
TODO: once the mentioned PR land, replace this by just using the proper example system.
TODO: figure out what we want here.
This is ready for the initial review phase, final todolist:
rustfmt
validation: @nikstur can you help me here?Once we merge this, we can probably start upstreaming stable versions of Lanzaboote into nixpkgs.
Looks good, would really love to keep
cargp fmt
as a buildable derivation fornix flake check
though.The most cursed of all arguments....
This fells really janky, but I guess there is not really a better way. Can you also add something like this for
cargo fmt
?actually I find it really neat, we don't need to build the project to run clippy or cargo fmt.
Of course, we can be more fancy and extract the drvs, etc and put a proper checkPhase for that, but that seems wasteful?
I find it beautiful
Nono, please let's not make this more complicated than it needs to be. I kind of just wished that there was a flag you can just enable in
buildRustPackage
.True, but running clippy is almost like building the project.
In any case, I think your solution is good for what we can do right here downstream, but I just wished there was better support for these things upstream (or I guess for development
crane
really kind of is just better).Feel free to go upstream and propose stuff :P
pls no piling more stuff into buildRustPackage — it doesn't compose and makes Cargo special compared to other build systems for no reason. I'd be okay with a clippy setup hook though.
Is it intentional that these extra attributes bypass
buildRustPackage
? (You need to wrap the attrset merge in parens if you don't want it to —({ … } // { … })
.Why not have it in passthru.lint and build $NAME.lint?
I cannot do this if I don't have any recursive reference to myself, which is not possible because I don't have finalAttrs, neither a proper callPackage reinjector AFAIK.
@nikstur Added something for cargo fmt, let me know if this is not enough.
This is on purpose because I don't need the buildRustPackage stuff
@alyssais could you check again this? I find it ugly but I'm not sure I can avoid it.
I'd use
overrideAttrs
for clippy and rustfmt rather than flags and merging in the main derivation expression. That way they could even live in separate files if you wanted.wouldn't
lib.cleanSource
make more sense?Did we actually get building for aarch64 to work?
Shouldn't this be targetSpec?
error: Package ‘compiler-rt-14.0.6’ in /nix/store/wr7rzhqpb71986npaa2fvbjg302yb3r7-source/pkgs/development/compilers/llvm/14/compiler-rt/default.nix:128 is not available on the requested hostPlatform:
but passing the classical "unsupported systems ok" flag yields you
on a native aarch64 machine
Right
Hmm, I was not sure what target could take as an arg, but I guess so
Yes, it wasn't a question whether it would build, but whether it would boot.
Remember the discussion about how aarch64 UEFI is not the same as aarch64 Windows that caused the argument over triples in the first place.
Unfortunately, testing until the end requires some support in systemd which is only on the main branch at the moment.
@nikstur can you make it so that the project compiles with all the features? right now we have mutually exclusive features which prevent me from doing
cargo clippy --all-features
:-[This is not possible in the current setup because the features are semantically exclusive. If we want to compile with all feature we would need to creare two separate binaries.
I see, then, no problem, I will find a way :-)
Le sam. 10 juin 2023 à 14:31, nikstur @.***> a écrit :
There are a few opportunities to minimize the diff but this is good to go. Thanks for the effort!
Going to test this and create a PR.
see https://github.com/nix-community/lanzaboote/pull/198