Skip to content

Commit

Permalink
default.nix fix, clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
Anton-4 committed Jun 27, 2023
1 parent 152ca01 commit cc88d04
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
2 changes: 1 addition & 1 deletion crates/compiler/gen_llvm/src/llvm/lowlevel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1826,7 +1826,7 @@ fn throw_on_overflow<'ctx>(
.unwrap()
}

fn throw_because_overflow<'ctx>(env: &Env<'_, 'ctx, '_>, message: &str) {
fn throw_because_overflow(env: &Env<'_, '_, '_>, message: &str) {
let block = env.builder.get_insert_block().expect("to be in a function");
let di_location = env.builder.get_current_debug_location().unwrap();

Expand Down
4 changes: 2 additions & 2 deletions crates/compiler/mono/src/tail_recursion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -501,9 +501,9 @@ where
candidate_set
}

fn trmc_candidates_help<'a>(
fn trmc_candidates_help(
function_name: LambdaName,
stmt: &'_ Stmt<'a>,
stmt: &'_ Stmt,
candidates: &mut TrmcCandidateSet,
) {
// if this stmt is the literal tail tag application and return, then this is a TRMC opportunity
Expand Down
10 changes: 8 additions & 2 deletions default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,22 @@
sha256 = (builtins.fromJSON (builtins.readFile ./flake.lock)).nodes.nixpkgs.locked.narHash;
}
, pkgs ? import nixpkgsSource { }
,
}:
# we only use this file to release a nix package, use flake.nix for development
let
rustPlatform = pkgs.rustPlatform;
lib = pkgs.lib;

desiredRustVersion = (builtins.fromTOML (builtins.readFile (./rust-toolchain.toml))).toolchain.channel;
actualRustVersionStr = lib.lists.last (lib.splitString "-" rustPlatform.rust.rustc);

llvmPkgs = pkgs.llvmPackages_13;
# nix does not store libs in /usr/lib or /lib
nixGlibcPath = if pkgs.stdenv.isLinux then "${pkgs.glibc.out}/lib" else "";
in

assert lib.assertMsg (actualRustVersionStr == desiredRustVersion) "The rust version changed, nixpkgs.url in flake.nix should be altered so that it uses a commit(=rev) of nix with a matching rust version.";

rustPlatform.buildRustPackage {
pname = "roc";
version = "0.0.1";
Expand Down Expand Up @@ -51,7 +57,7 @@ rustPlatform.buildRustPackage {
python3
llvmPkgs.clang
llvmPkgs.llvm.dev
zig
zig_0_9
]);

buildInputs = (with pkgs;
Expand Down
8 changes: 4 additions & 4 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
description = "Roc flake";

inputs = {
nixpkgs.url = "github:nixos/nixpkgs?rev=9f4346eac544cc0db5eb7d889e71eac0f9c8b9eb";
nixpkgs.url = "github:nixos/nixpkgs?rev=d7887373fe0731719365831cd254c1e5948307d3";


# rust from nixpkgs has some libc problems, this is patched in the rust-overlay
rust-overlay = {
Expand Down Expand Up @@ -90,7 +91,7 @@
llvmPkgs.clang
libxkbcommon
pkg-config
zig # roc builtins are implemented in zig, see compiler/builtins/bitcode/
zig_0_9 # roc builtins are implemented in zig, see compiler/builtins/bitcode/

# lib deps
libffi
Expand Down

0 comments on commit cc88d04

Please sign in to comment.