-
Notifications
You must be signed in to change notification settings - Fork 30
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
Error: Library "dune.configurator" not found.
when using pkgsStatic
#731
Comments
I think you can simplify the setup a bit when using these nix-overlays. Here's an example for building comby-musl: anmonteiro/sourcegraph@245bb5b (The pkg-config hack should go away in the next version of dune, cf ocaml/dune#7469) |
Thanks for the fast reply! I tried out your fork but I dont seem to be able to get it to emit a static binary:
even with the following patch diff --git a/dev/nix/comby.nix b/dev/nix/comby.nix
index 6f92cee..95f52ed 100644
--- a/dev/nix/comby.nix
+++ b/dev/nix/comby.nix
@@ -31,7 +31,7 @@ nixpkgs.lib.genAttrs utils.lib.defaultSystems (system:
{
comby-musl =
let
- inherit (pkgs) stdenv writeScriptBin pkg-config;
+ inherit (pkgs.pkgsStatic) stdenv writeScriptBin pkg-config;
pkg-config-script =
let
pkg-config-pkg =
@@ -44,7 +44,7 @@ nixpkgs.lib.genAttrs utils.lib.defaultSystems (system:
${pkg-config-pkg} $@
'';
in
- pkgs.pkgsCross.musl64.comby.overrideAttrs (o: {
+ pkgs.pkgsStatic.pkgsCross.musl64.comby.overrideAttrs (o: {
nativeBuildInputs = o.nativeBuildInputs ++ [ pkg-config-script ];
}); I was able to get as far as the below output with the existing nix after
|
That seemed too easy 😅 I think I can make this work but it's gonna take a little bit longer. Standby. |
Alright, I pushed a new commit to that branch (https://github.com/sourcegraph/sourcegraph/commit/ab5d0f8ff3bfbdb2b08d9cdd1d29d6ddc4ca5581). It builds a statically linked executable now: $ nix run github:nix-ocaml/nix-overlays#file -- ./result/bin/comby
./result/bin/comby: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), statically linked, not stripped While we don't need the It needs #733 which should finish the CI run shortly. |
@Strum355 PR closed this automatically, but feel free to reopen if my fix didn't work. |
Note: I am by no means an ocaml person, I know 0 ocaml, just trying to statically package comby 😄
Im getting build failures of the above kind when trying to build the following derivation using nix-ocaml/nix-overlays?rev=9287d78084ac4c0b69bff81cd6afacc4ff98c4a9. Apply the following patch to the above revision of
sourcegraph/sourcegraph
for it to be using nix-ocaml/nix-overlays:git diff patch
full error output
Any pointers or solutions much appreciated!
The text was updated successfully, but these errors were encountered: