Closed GetPsyched closed 1 week ago
@GetPsyched pickBinary
is what we use in Fedimint, and that's the only way I'm aware to take stuff from a single build into particular binaries.
Running any of the build variations like nix build .#ci.foo only work for the default package output and not my non-default package output.
In Fedimint we export whole result of craneMultiBuild
as legacyPackages
https://github.com/fedimint/fedimint/blob/af3f82711df6535968e7a646f3598a9cba66fafd/flake.nix#L379
https://github.com/fedimint/fedimint/blob/af3f82711df6535968e7a646f3598a9cba66fafd/flake.nix#L201
craneMultiBuild
is what creates this nested attrset of various combinations of toolchains and build profiles.
As long as you export something as a result of what craneMultiBuild
is wrapping, it will appear in this nested attrset.
Thanks for the quick reply. I've looked into this and it might take a bit for me to understand enough to test. Will get back here once I've fiddled around with the suggestions.
@GetPsyched I have another project that is much simpler that exposes two nix packages: https://github.com/rustshop/perfit/blob/56b33333bd7e38b503841a528e6207dab8748fff/flake.nix#L61
Perfect! Tried that solution and it works nicely!
Probably a final question, will I have to edit the workflow file to also build the new package output (nix build .#ci.foo
) manually or can I regenerate it using Flakebox somehow?
@GetPsyched If you don't set manually this https://github.com/rustshop/perfit/blob/56b33333bd7e38b503841a528e6207dab8748fff/flake.nix#L26 the default generated github workflow will do this: https://github.com/rustshop/flakebox/blob/12d5ee4f6c47bc01f07ec6f5848a83db265902d3/lib/modules/github.nix#L280
I must warn you that the workflows generated by flakebox only go so far, and if you need something more customized, you should just disable and create them manually.
That's fair. I've manually edited the existing workflow to compile each binary against every architecture.
Thanks for all the help!
Hey, firstly, thanks for this tool; it's been of great help!
My issue is simple: I'm outputting 2 binaries from my Rust app and I want to not only expose both as packages but also have CI run on it (unsure if it doesn't though, I don't have many leads to debug this)
To avoid the XY problem, here's what I tried:
nix run
to be able to run the binaries of the app. But theflake.nix
I got from runningnix flake init -t github:rustshop/flakebox
only output one package (at the time of running, my app did only have one binary so maybe that was the issue?). I want to be able to do something likenix run .#foo
to run a specific binary. I've done this currently by manually adding a package output using pickBinary. This likely isn't ideal.nix build .#ci.foo
only work for the default package output and not my non-default package output. This makes me think that there's a much bigger integration issue at play here.Still unsure if this is an issue with my setup/configuration or flakebox not supporting this OOTB.