-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
flake: migrate to crane, unpin Nixpkgs, use static builds on Darwin (#…
…1380) * flake: remove `default` from the overlay This belongs in `packages` instead (where a duplicate is already present anyway). * flake: migrate to crane Crane handles cross‐compilation a bit better and seems to be generally more actively maintained than Naersk. We use Nixpkgs’ stock Rust toolchains instead of bringing in fenix, as Nixpkgs provides everything we need and tracks upstream stable Rust well. This also simplifies the cross‐compilation story. This doesn’t build the documentation like the Naersk build did, which I guess might be useful to ensure that the documentation always builds? That could be added on as a check if desired, using `craneLib.cargoDoc`. * flake: remove redundant `pname` and `version` Crane handles setting these for us. * flake: remove inert `preBuild` This would be done differently with crane using `craneLib.cargoClippy`. That could be added as a check if desired. * flake: move flags to `installerAttrs` I assume it was not the intent to override the configuration flags and test behaviour of all dependencies. * flake: use `pkgsStatic` for static builds This is cleaner, handles any future native dependencies correctly, and will work more consistently across platforms (such as Darwin). * flake: unpin Nixpkgs * flake: use static builds on Darwin Fix a bug where the installer would link against a `libiconv` in the Nix store. This would silently fail to load (falling back to the system `libiconv`, I suppose? I’m not sure) when the Nix store was not present – as is usually the case when running the installer – but after installation, the store path could be populated by normal use of Nix. If that happened, then upon uninstallation, the Nix store `libiconv` would be loaded, the installer would delete the `/nix` partition, and then the next time a system library indirectly caused `dyld` to check up on what’s going on with the loaded dynamic libraries, it would try to read from an address mapped to the library in the now‐deleted Nix store and crash. Now that `pkgsStatic` works after Randy’s Darwin rework to provide mostly‐static builds (system libraries and frameworks are dynamically linked, but libraries from Nixpkgs are linked statically), we can build a truly standalone installer that has no dependency on `/nix/store`, fixing the crash for good. * flake: remove old Darwin SDK pattern detritus None of this is required or does anything as of 24.11.
- Loading branch information
Showing
5 changed files
with
75 additions
and
166 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters