Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions pkgs/build-support/rust/build-rust-package/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
, rust
, stdenv
, callPackage
, cacert
, cargoBuildHook
, cargoCheckHook
, cargoInstallHook
Expand Down Expand Up @@ -124,7 +123,6 @@ stdenv.mkDerivation ((removeAttrs args [ "depsExtraArgs" "cargoUpdateHook" "carg
inherit cargo cargo-auditable;
})
] ++ [
cacert
cargoBuildHook
(if useNextest then cargoNextestHook else cargoCheckHook)
cargoInstallHook
Expand Down
3 changes: 3 additions & 0 deletions pkgs/build-support/rust/fetch-cargo-tarball/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,9 @@ in stdenv.mkDerivation ({

${cargoUpdateHook}

# Override the `http.cainfo` option usually specified in `.cargo/config`.
export CARGO_HTTP_CAINFO=${cacert}/etc/ssl/certs/ca-bundle.crt

cargo vendor $name --respect-source-config | cargo-vendor-normalise > $CARGO_CONFIG

# Create an empty vendor directory when there is no dependency to vendor
Expand Down
13 changes: 3 additions & 10 deletions pkgs/development/compilers/rust/cargo.nix
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{ lib, stdenv, pkgsHostHost
, file, curl, pkg-config, python3, openssl, cmake, zlib
, installShellFiles, makeWrapper, cacert, rustPlatform, rustc
, installShellFiles, makeWrapper, rustPlatform, rustc
, CoreFoundation, Security
, auditable ? false # TODO: change to true when this is the default
}:
Expand Down Expand Up @@ -28,7 +28,7 @@ rustPlatform.buildRustPackage {
(lib.getDev pkgsHostHost.curl)
zlib
];
buildInputs = [ cacert file curl python3 openssl zlib ]
buildInputs = [ file curl python3 openssl zlib ]
++ lib.optionals stdenv.isDarwin [ CoreFoundation Security ];

# cargo uses git-rs which is made for a version of libgit2 from recent master that
Expand All @@ -39,14 +39,7 @@ rustPlatform.buildRustPackage {
RUSTC_BOOTSTRAP = 1;

postInstall = ''
# NOTE: We override the `http.cainfo` option usually specified in
# `.cargo/config`. This is an issue when users want to specify
# their own certificate chain as environment variables take
# precedence
wrapProgram "$out/bin/cargo" \
--suffix PATH : "${rustc}/bin" \
--set CARGO_HTTP_CAINFO "${cacert}/etc/ssl/certs/ca-bundle.crt" \
--set SSL_CERT_FILE "${cacert}/etc/ssl/certs/ca-bundle.crt"
wrapProgram "$out/bin/cargo" --suffix PATH : "${rustc}/bin"

installManPage src/tools/cargo/src/etc/man/*

Expand Down