Our project uses some packaging features of deno 1.37.0, but I can only find 1.36.0 in the nix repos. My coworkers now use a hybrid approach of using nix for most of the dependencies and dvm
to use the correct deno version. I now try to add a deno overlay to my flake and build deno from source. The final build step fails with
Error: builder for '/nix/store/wf4mvip64d7n3r6v7nfg20jw2nw4s1wh-deno-1.37.0.drv' failed with exit code 101;
last 10 log lines:
> = note: /nix/store/rhhll3vwpj38ri72ahrrrvcbkhz4fhh6-binutils-2.40/bin/ld: /build/source/target/release/deps/libdeno_core-ca73356b2f3bcb2a.rlib(deno_core-ca73356b2f3bcb2a.deno_core.db36b2adc81af5b8-cgu.01.rcgu.o): in function `deno_core::runtime::jsruntime::v8_init':
> deno_core.db36b2adc81af5b8-cgu.01:(.text._ZN9deno_core7runtime9jsruntime7v8_init17he74983bb0807d4ebE+0x2b): undefined reference to `udata_setCommonData_73'
> collect2: error: ld returned 1 exit status
>
> = note: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
> = note: use the `-l` flag to specify native libraries to link
> = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)
>
> error: could not compile `deno_runtime` (build script) due to previous error
> warning: build failed, waiting for other jobs to finish...
The relevant snippet of my flake is
{
inputs = {
utils.url = "github:numtide/flake-utils";
nixpkgs.url = "github:NixOS/nixpkgs/nixpkgs-unstable";
};
outputs = { self, nixpkgs, utils }:
utils.lib.eachDefaultSystem (system:
let
deno-version = "1.37.0";
pin-deno = final: prev: {
deno = prev.deno.overrideAttrs (old: rec {
pname = "deno";
version = deno-version;
nativeBuildInputs = old.nativeBuildInputs
++ [ pkgs.cmake pkgs.protobuf ]; # Changes in the build process?
src = prev.fetchFromGitHub {
owner = "denoland";
repo = pname;
rev = "v${deno-version}";
hash = "sha256-1c10CvKL1e+e6PcgcUOlUyxuYNH20mc4rNvS0f3smMM=";
};
# Updating cargo hash is tricky
cargoDeps = old.cargoDeps.overrideAttrs (prev.lib.const {
name = "${pname}-vendor.tar.gz";
inherit src;
outputHash =
"sha256-aP2T22sKmr/ezTW2XpoT2zjN/R3R48ecHr2ApJCGz0A=";
});
});
};
pkgs = (import nixpkgs { inherit system; }).extend pin-deno;
in {
devShell = with pkgs;
mkShell {
buildInputs = [ deno ];
};
});
}
Any ideas what I got wrong?