From 1555738be40d8fceb1d5888ba47c3bac84f5d2c1 Mon Sep 17 00:00:00 2001 From: Cody Date: Fri, 28 Jul 2023 01:37:31 -0500 Subject: Fixed issues with building Sloth - Made Sloth build with Rust stable again - Made a rust-toolchain file so everyone uses the same version of Rust - Fixed the GitHub Actions to have LLVM so it can actually build - Fixed the Nix package to have LLVM so it can actually build --- flake.nix | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-) (limited to 'flake.nix') diff --git a/flake.nix b/flake.nix index 5c82957..5143ddf 100644 --- a/flake.nix +++ b/flake.nix @@ -27,9 +27,17 @@ rustc = rustStable; }; in + let + baseNativeBuildInputs = with pkgs; [ pkg-config ]; + baseBuildInputs = with pkgs; [ + llvmPackages_15.libllvm + libffi + libxml2 + ]; + in with pkgs; { - packages.default = rustPlatform.buildRustPackage rec { + packages.default = rustPlatform.buildRustPackage { pname = "sloth"; version = "0.1.0"; src = ./.; @@ -40,14 +48,20 @@ lockFile = ./Cargo.lock; }; + nativeBuildInputs = baseNativeBuildInputs; + buildInputs = baseBuildInputs; + meta = with lib; { description = "The Sloth programming language"; homepage = "https://slothlang.tech"; license = with licenses; [ mit asl20 ]; }; + + LLVM_SYS_150_PREFIX = "${llvmPackages_15.libllvm.dev}"; }; devShells.default = mkShell { - buildInputs = [ + nativeBuildInputs = baseNativeBuildInputs; + buildInputs = baseBuildInputs ++ [ (rustNightly.override { extensions = [ "rust-src" "rust-analyzer" ]; targets = [ "wasm32-unknown-unknown" ]; @@ -57,16 +71,11 @@ cargo-deny cargo-release - pkg-config - - # Packages required for LLVM - llvmPackages_15.libllvm - libffi - libxml2 - # C compiler for debugging clang ]; + + RUST_BACKTRACE = 1; }; } ); -- cgit v1.2.3