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
19 changes: 17 additions & 2 deletions dfx.nix
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,11 @@ let
''cargo $cargo_options test $cargo_test_options --workspace --exclude ic-agent''
''RUST_TEST_THREADS=1 cargo $cargo_options test $cargo_test_options -p ic-agent''
];
static = pkgs.stdenv.isLinux;
override = oldAttrs: {
# both needed for bindgen, used by rocksdb-sys, zstd-sys, lmdb-sys, etc
LIBCLANG_PATH = "${pkgs.llvmPackages.libclang}/lib";
CLANG_PATH = "${pkgs.llvmPackages.clang}/bin/clang";
};
};

# add extra executables used when linting
Expand Down Expand Up @@ -94,13 +98,24 @@ let
};
};

# Note that on Linux we need the static environment.
cc = if pkgs.stdenv.isLinux
then pkgs.pkgsStatic.stdenv.cc
else pkgs.stdenv.cc;

# fixup the shell for more convenient developer use
fixShell = ws:
ws // {
shell =
pkgs.mkCompositeShell {
name = "dfinity-sdk-rust-env";
nativeBuildInputs = [ pkgs.rls ];
nativeBuildInputs = [
pkgs.rls
# wabt-sys needs file in path, as well as cc (for cmake).
pkgs.file
cc
pkgs.coreutils
] ++ lib.optional pkgs.stdenv.isDarwin pkgs.stdenv.cc.bintools;
inputsFrom = [ ws.shell ];
shellHook = ''
# Set CARGO_HOME to minimize interaction with any environment outside nix
Expand Down
2 changes: 1 addition & 1 deletion nix/sources.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
"common": {
"ref": "master",
"repo": "ssh://git@github.com/dfinity-lab/common",
"rev": "fa5190ac6a299744e1174a576fa540b7fd856bff",
"rev": "027bda4a40176ef3eb676610d8673affe6cde81c",
"type": "git"
},
"dfinity": {
Expand Down