Comments (8)
I made a PR (#73) that should fix this. The issue was caused by nixpkgs
's defaultCrateOverrides
, https://github.com/NixOS/nixpkgs/blob/master/pkgs/build-support/rust/default-crate-overrides.nix#L172-L174. These lines add Security
regardless of the current platform, which triggers this issue. For now I've included a workaround in nix-cargo-integration
, but I am making a PR to nixpkgs
.
from nix-cargo-integration.
From what I understand, this is caused by reqwest
's default-tls
feature, which adds a dependency on native-tls
, which depends on security-framework
, but only when building for macOS. security-framework
provides bindings for the MacOS SDK's Security.framework
native-tls
's Cargo.toml
(irrelevant sections removed):
[target.'cfg(any(target_os = "macos", target_os = "ios"))'.dependencies]
security-framework = "2.0.0"
security-framework-sys = "2.0.0"
[target.'cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios")))'.dependencies]
openssl = "0.10.29"
openssl-sys = "0.9.55"
openssl-probe = "0.1"
[target.'cfg(not(any(target_os = "windows", target_os = "macos", target_os = "ios")))'.build_dependencies]
openssl-src = { version = "300.0.3", optional = true }
Adding just native-tls
to Cargo.toml
instead of reqwest
produces a similar error:
native-tls = "0.2"
error: Package ‘MacOS_SDK-10.12’ in /nix/store/hsff9pi1qinxljahr833z0xivr1apx27-source/pkgs/os-specific/darwin/apple-sdk/default.nix:50 is not supported on ‘x86_64-linux’, refusing to evaluate.
...
from nix-cargo-integration.
Could this be an issue with the Cargo.lock
translator not picking it up?
from nix-cargo-integration.
I've also experienced this issue. Thanks for filing this, haven't had time really.
I'm not sure why it's trying to use MacOS_SDK-10.12
. Normally a dependency like that wouldn't be used unless we were on darwin, but it seems to be used anyways, which makes me think it could be an issue related to overrides.
It would be helpful if you could try to build with NCI_DEBUG=1 nix build --impure
and post the output. I'll try to look into it more whenever I have time.
from nix-cargo-integration.
❯ NCI_DEBUG=1 nix build --impure
trace: root at: /nix/store/8f9kibyd69lb0kf5pph0hsna8nfa0idq-2h6x3j10r6jkb7i4mik3g8wqsffi2cbh-source
trace: workspace members:
trace: {
message = "temp-0.1.0: root is";
value = /nix/store/2h6x3j10r6jkb7i4mik3g8wqsffi2cbh-source;
}
trace:
The dream-lock.json for input 'temp' doesn't exist or is outdated.
...Falling back to on-the-fly evaluation (possibly slow).
To speed up future evalutations run once:
nix run .#resolve
trace: {
message = "temp-0.1.0: using builder";
value = "crane";
}
trace: {
message = "temp-0.1.0: rawTomlOverrides";
value = {
autocfg = <function>;
bitflags = <function>;
cc = <function>;
cfg-if = <function>;
core-foundation = <function>;
core-foundation-sys = <function>;
fastrand = <function>;
foreign-types = <function>;
foreign-types-shared = <function>;
instant = <function>;
lazy_static = <function>;
libc = <function>;
log = <function>;
native-tls = <function>;
once_cell = <function>;
openssl = <function>;
openssl-probe = <function>;
openssl-sys = <function>;
pkg-config = <function>;
redox_syscall = <function>;
remove_dir_all = <function>;
schannel = <function>;
security-framework = <function>;
security-framework-sys = <function>;
temp = <function>;
temp-deps = <function>;
tempfile = <function>;
vcpkg = <function>;
winapi = <function>;
winapi-i686-pc-windows-gnu = <function>;
winapi-x86_64-pc-windows-gnu = <function>;
};
}
trace: {
message = "temp-0.1.0: tomlOverrides";
value = {
autocfg = <function>;
bitflags = <function>;
cc = <function>;
cfg-if = <function>;
core-foundation = <function>;
core-foundation-sys = <function>;
fastrand = <function>;
foreign-types = <function>;
foreign-types-shared = <function>;
instant = <function>;
lazy_static = <function>;
libc = <function>;
log = <function>;
native-tls = <function>;
once_cell = <function>;
openssl = <function>;
openssl-probe = <function>;
openssl-sys = <function>;
pkg-config = <function>;
redox_syscall = <function>;
remove_dir_all = <function>;
schannel = <function>;
security-framework = <function>;
security-framework-sys = <function>;
temp = <function>;
temp-deps = <function>;
tempfile = <function>;
vcpkg = <function>;
winapi = <function>;
winapi-i686-pc-windows-gnu = <function>;
winapi-x86_64-pc-windows-gnu = <function>;
};
}
trace: {
message = "temp-0.1.0: buildPhase";
value = ''
runHook preBuild
echo running: 'cargo build --release --message-format json-render-diagnostics >"$cargoBuildLog"'
cargoBuildLog=$(mktemp cargoBuildLogXXXX.json)
cargo build --release --message-format json-render-diagnostics >"$cargoBuildLog"
runHook postBuild
'';
}
error: Package ‘MacOS_SDK-10.12’ in /nix/store/hsff9pi1qinxljahr833z0xivr1apx27-source/pkgs/os-specific/darwin/apple-sdk/default.nix:50 is not supported on ‘x86_64-linux’, refusing to evaluate.
a) To temporarily allow packages that are unsupported for this system, you can use an environment variable
for a single invocation of the nix tools.
$ export NIXPKGS_ALLOW_UNSUPPORTED_SYSTEM=1
Note: For `nix shell`, `nix build`, `nix develop` or any other Nix 2.4+
(Flake) command, `--impure` must be passed in order to read this
environment variable.
b) For `nixos-rebuild` you can set
{ nixpkgs.config.allowUnsupportedSystem = true; }
in configuration.nix to override this.
c) For `nix-env`, `nix-build`, `nix-shell` or any other Nix command you can add
{ allowUnsupportedSystem = true; }
to ~/.config/nixpkgs/config.nix.
(use '--show-trace' to show detailed location information)
from nix-cargo-integration.
I have the same problem but reported it in the wrong repo:
yusdacra/rust-nix-templater#22
Logs & Repo
And the full log
from nix-cargo-integration.
@khrj Did you find a workaround?
Would love to use this as it seems like the simplest nix rust base I've found
from nix-cargo-integration.
I can confirm this works! 🎉
from nix-cargo-integration.
Related Issues (20)
- Doesn't work with workspace package settings HOT 10
- Cross compiling losing std. I think HOT 3
- Use dream2nix v1 HOT 1
- After updating to the latest version, "attribute 'relPath' missing" when generating lockfile HOT 2
- Exposing tests to flake HOT 2
- `drvConfig.mkDerivation.meta` is not propagated to the derivation HOT 1
- Cilppy 'invalid metadata' errors HOT 4
- adding packages to runtimeLibs list causes "cannot coerce a set to a string" error HOT 2
- The overriding stdenv example doesn't seem to work HOT 2
- generate-lockfiles not working HOT 2
- Help running `cargo test` in checks. HOT 1
- `attribute checkProfile missing` HOT 2
- `outputs.apps.${system}` empty even tho `nix run .#<bin>` works HOT 1
- Using `depsDrvConfig` with `nix shell` HOT 2
- Multiple crate configurations from the same src HOT 1
- function 'anonymous lambda' called without required argument 'pkgsBuildHost' HOT 3
- error: function 'anonymous lambda' called without required argument 'buildPackages' HOT 2
- error: linking with `cc` failed: exit status: 1 HOT 5
- `[patch.crates-io]` with local crate fails HOT 3
- Downstream to nixpkgs HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nix-cargo-integration.