Skip to content
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

Attempt to fix OpenSSL build under nix #5319

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

link2xt
Copy link
Collaborator

@link2xt link2xt commented Mar 4, 2024

Trying to use alexcrichton/openssl-src-rs#236

This fails with a new error:

$ nix build .#deltachat-rpc-server-x86_64-linux
error: builder for '/nix/store/cbk8amj58m8znxlcx0p4d0fxhq7grkc4-deltachat-deps-1.136.0.drv' failed with exit code 101;
       last 25 log lines:
       >   cargo:rerun-if-env-changed=RANLIBFLAGS_x86_64-unknown-linux-musl
       >   RANLIBFLAGS_x86_64-unknown-linux-musl = None
       >   cargo:rerun-if-env-changed=RANLIBFLAGS_x86_64_unknown_linux_musl
       >   RANLIBFLAGS_x86_64_unknown_linux_musl = None
       >   cargo:rerun-if-env-changed=TARGET_RANLIBFLAGS
       >   TARGET_RANLIBFLAGS = None
       >   cargo:rerun-if-env-changed=RANLIBFLAGS
       >   RANLIBFLAGS = None
       >   running cd "/build/dummy-src/target/x86_64-unknown-linux-musl/release/build/openssl-sys-462ecfdd0a9cb8e3/out/openssl-build/build/src" && env -u CROSS_COMPILE AR="ar" CC="/nix/store/j9zmg94bapyyv5pni864cl4rqwsp03h3-x86_64-unknown-linux-musl-gcc-wrapper-13.2.0/bin/x86_64-unknown-linux-musl-cc" RANLIB="ranlib" "perl" "./Configure" "--prefix=/build/dummy-src/target/x86_64-unknown-linux-musl/release/build/openssl-sys-462ecfdd0a9cb8e3/out/openssl-build/install" "--openssldir=/usr/local/ssl" "no-dso" "no-shared" "no-ssl3" "no-tests" "no-comp" "no-zlib" "no-zlib-dynamic" "--libdir=lib" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-engine" "no-async" "linux-x86_64" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-DOPENSSL_NO_SECURE_MEMORY"
       >
       >   --- stderr
       >   Can't open perl script "./Configure": No such file or directory
       >   thread 'main' panicked at /nix/store/fqvrp4b4k0fx6gyigxj622ibhrg6gifa-git-dependencies/openssl-src-300.2.3+3.2.1-link2xt_copy-symlink/src/lib.rs:616:9:
       >
       >
       >
       >   Error configuring OpenSSL build:
       >       Command: cd "/build/dummy-src/target/x86_64-unknown-linux-musl/release/build/openssl-sys-462ecfdd0a9cb8e3/out/openssl-build/build/src" && env -u CROSS_COMPILE AR="ar" CC="/nix/store/j9zmg94bapyyv5pni864cl4rqwsp03h3-x86_64-unknown-linux-musl-gcc-wrapper-13.2.0/bin/x86_64-unknown-linux-musl-cc" RANLIB="ranlib" "perl" "./Configure" "--prefix=/build/dummy-src/target/x86_64-unknown-linux-musl/release/build/openssl-sys-462ecfdd0a9cb8e3/out/openssl-build/install" "--openssldir=/usr/local/ssl" "no-dso" "no-shared" "no-ssl3" "no-tests" "no-comp" "no-zlib" "no-zlib-dynamic" "--libdir=lib" "no-md2" "no-rc5" "no-weak-ssl-ciphers" "no-camellia" "no-idea" "no-seed" "no-engine" "no-async" "linux-x86_64" "-O2" "-ffunction-sections" "-fdata-sections" "-fPIC" "-m64" "-DOPENSSL_NO_SECURE_MEMORY"
       >       Exit status: exit status: 2
       >
       >
       >
       >   note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
       > warning: build failed, waiting for other jobs to finish...
       > [naersk] cargo returned with exit code 101, exiting
       For full logs, run 'nix log /nix/store/cbk8amj58m8znxlcx0p4d0fxhq7grkc4-deltachat-deps-1.136.0.drv'.
error: 1 dependencies of derivation '/nix/store/i31jwq5zp7smcf26fl1pvk2qy7l6b88x-deltachat-1.136.0.drv' failed to build

This is likely due to nix-community/naersk#287

$ ls /nix/store/fqvrp4b4k0fx6gyigxj622ibhrg6gifa-git-dependencies/openssl-src-300.2.3+3.2.1-link2xt_copy-symlink/src
lib.rs
$ ls /nix/store/fqvrp4b4k0fx6gyigxj622ibhrg6gifa-git-dependencies/openssl-src-300.2.3+3.2.1-link2xt_copy-symlink/openssl

Seems openssl submodule is not cloned in case of git dependency.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant