-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
Compiling from macOS to Linux failing with openssl #106
Comments
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/cross-compile-rust-from-m1/27879/7 |
Maybe try adding |
Hi, Here's the Nix: I added the parameters based on this documentation: https://github.com/nix-community/naersk#buildpackages-parameters {
inputs = {
fenix = {
url = "github:nix-community/fenix";
inputs.nixpkgs.follows = "nixpkgs";
};
flake-utils.url = "github:numtide/flake-utils";
naersk = {
url = "github:nix-community/naersk";
inputs.nixpkgs.follows = "nixpkgs";
};
nixpkgs.url = "nixpkgs/nixos-unstable";
};
outputs = { self, fenix, flake-utils, naersk, nixpkgs }:
flake-utils.lib.eachDefaultSystem (system: {
packages.default =
let
pkgs = nixpkgs.legacyPackages.${system};
target = "aarch64-unknown-linux-gnu";
toolchain = with fenix.packages.${system}; combine [
minimal.cargo
minimal.rustc
targets.${target}.latest.rust-std
];
in
(naersk.lib.${system}.override {
cargo = toolchain;
rustc = toolchain;
}).buildPackage {
src = ./.;
nativeBuildInputs = [ pkgs.pkg-config ];
buildInputs = [ pkgs.openssl ];
CARGO_BUILD_TARGET = target;
CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER =
let
inherit (pkgs.pkgsCross.aarch64-multiplatform.stdenv) cc;
in
"${cc}/bin/${cc.targetPrefix}cc";
};
});
} The Rust isn't public but here's the Cargo.toml: [package]
name = "cuppings"
version = "0.1.0"
edition = "2021"
[profile.dev]
split-debuginfo = "unpacked"
[dependencies]
dotenv = "0.15.0"
serde_json = "1.0.96"
reqwest = { version = "0.11.16", features = ["blocking", "json"] }
axum = "0.6.16"
hyper = { version = "0.14.26", features = ["full"] }
tokio = { version = "1.21.2", features = ["full"] }
tower = "0.4.13"
lazy_static = "1.4.0"
sea-orm = { version = "0.11.2", features = ["sqlx-sqlite", "runtime-tokio-native-tls", "macros", "debug-print"] }
anyhow = "1.0.70"
serde = "1.0.160"
tower-http = { version = "0.3.4", features = ["cors", "fs", "trace"] }
form_urlencoded = "1.1.0"
tracing-subscriber = "0.3.17"
askama = { version = "0.12.0", features = ["serde-json"] }
tracing = "0.1.36" |
It errors on sqlite:
|
You can use |
@alper make sure to set |
I'm using the exact example and it takes a long time before it gives me:
Is it possible to fix this or should I not be trying this at all?
The text was updated successfully, but these errors were encountered: