Change:
Deno no longer working on darwin due to tinycc being broken. error: Package ‘tcc-0.9.27+date=2022-01-11’ in /nix/store/4la4fc5wfn4p0784i12h0a046yqzln16- is marked as broken, refusing to evaluate. It works. Looks like this happened with the move to Deno 1.23.4: Issue related to tinycc being broken: deno: tinycc:
Thanks for raising this. I shouldn't have missed this. I'll try fix tinycc and if we can't Mac might be able to fall back to the same non-tinycc method (even if it has some performance penalties) until they migrate to asm
Thanks for being on this
if you could try out that'd be helpful
i'm on it!
succeeded for me on x86_64-darwin
Nice, it worked for me in my x8664-darwin vm but it's always good to get it checked on real hardware. Would be nice to have someone try it on aarch64-darwin As a note if you want to do a "full" test of the FFI features (the one that requires tcc now) git clone /tmp/deno cd /tmp/deno mkdir -p ./target/result cp /location/of/the/nixpkgs/result/bin/deno ./target/result/ target/release/deno bench --allow-ffi --allow-read --unstable
Ran it on my aarch64-darwin machine:
fantastic thanks
also worked for me on aarch64 (i used an EC2 m1 macos instance). Unfortunately running the FFI tests requires a to be in the directory, which I noticed is output when running outside of nix. However, on aarch64, I can't get a direct to succeed...
sorry I missed a step there try if you still have the instance
cool, that worked. the benchmarks ran without error...
Reopening as does not resolve this issue
That PR does resolve the issue, see the comments towards the bottom to pull in the fix early The unstable channel hasn't progressed for and not in scope for this issue ~I will open a backport ticket for 22.05 though~ actually is on which is unaffected by this issue
Yes, this is confirmed by ofborg.
OMG Sorry that I didn't follow the PR correctly. Not only I missed the part you fixed on the derivation of deno, but I saw the tinycc's derivation flagged as and mistook that it is the same on deno's. The old message of the beginning of the PR ("tinycc darwin issues were a pain, there's no point holding up this update since it's already broken") also made me confused and gave an idea that this issue was closed by mistake. Sorry for confusing everyone here, and thank you very much for fixing the problem!
I'd pretty much given up on trying to make tinycc build properly on darwin but as a last-ditch effort I tried just building the static lib on it's own and to my surprise it worked just fine

Discussion:
, which }: <ins> let # avoid "malformed 32-bit x.y.z" error on mac when using clang isCleanVer = version: builtins.match "^[0-9].+[0-9]+.[0-9]+" version != null; in </ins> stdenv.mkDerivation rec { pname = "tcc"; version = "unstable-2022-07-15";

]; preConfigure = '' <del> echo ${version} > VERSION </del> <ins> ${ if stdenv.isDarwin && ! isCleanVer version then "echo 'not overwriting VERSION since it would upset ld'" else "echo ${version} > VERSION" } </ins> configureFlagsArray+=("--elfinterp=$(< $NIX_CC/nix-support/dynamic-linker)") '';

, fetchFromGitHub , rustPlatform , installShellFiles <del> , fetchpatch </del> , tinycc , libiconv , libobjc

, librusty_v8 ? callPackage ./librusty_v8.nix { } }: <del> let libtcc = tinycc.overrideAttrs (oa: { makeFlags = [ "libtcc.a" ]; # tests want tcc binary doCheck = false; outputs = [ "out" ]; installPhase = '' mkdir -p $out/lib/ mv libtcc.a $out/lib/ ''; }); in </del> rustPlatform.buildRustPackage rec { pname = "deno"; <del> version = "1.23.4"; </del> <ins> version = "1.25.1"; </ins> src = fetchFromGitHub { owner = "denoland"; repo = pname; rev = "v${version}"; <del> sha256 = "sha256-nLQqfLRuh9mhZfjeiPaGpQbi5bXEg7HiGwrwDmaIRWM="; </del> <ins> sha256 = "sha256-nKMQDfCU1HsOfdzVwmgCIWa/rUmvufHlsS9jcDwcZzw="; </ins> }; <del> cargoSha256 = "sha256-l5Ce/ypYXZKEi859OFskwC/Unpo842ZPxIHvp6lCjQc="; patches = [ # remove after https://github.com/denoland/deno/pull/15193 is in a release (fetchpatch { name = "byo-tcc.patch"; url = "https://github.com/denoland/deno/pull/15193/commits/c43698b2b58af1ef69b1558d55c8ebea0268dfea.patch"; sha256 = "sha256-YE5mGHyEm20FjFhr8yveBRlrOVL3+qQYxz2xp/IfmJs="; }) ]; </del> <ins> cargoSha256 = "sha256-jFoVQK74gnhC6Ume/PHe8NG7rNeTkwPMBBWn/hT7nCs="; </ins> postPatch = '' # upstream uses lld on aarch64-darwin for faster builds

# The deno_ffi package currently needs libtcc.a on linux and macos and will try to compile it at build time # To avoid this we point it to our copy (dir) # In the future tinycc will be replaced with asm <del> DENO_FFI_LIBTCC = "${libtcc}/lib"; </del> <ins> libtcc = tinycc.overrideAttrs (oa: { makeFlags = [ "libtcc.a" ]; # tests want tcc binary doCheck = false; outputs = [ "out" ]; installPhase = '' mkdir -p $out/lib/ mv libtcc.a $out/lib/ ''; # building the whole of tcc on darwin is broken in nixpkgs # but just building libtcc.a works fine so mark this as unbroken meta.broken = false; }); TCC_PATH = "${libtcc}/lib"; </ins> # Tests have some inconsistencies between runs with output integration tests # Skipping until resolved

}; in fetch_librusty_v8 { <del> version = "0.45.0"; </del> <ins> version = "0.49.0"; </ins> shas = { <del> x86_64-linux = "sha256-yZw6zwEhJyRntqOmyk03N+sHxzIrbY/e67AQ21ePlAU="; aarch64-linux = "sha256-2p21Smm5wZycv9u+yDbyerKTjSTB7yau5WC2aJ+Vr8w="; x86_64-darwin = "sha256-HO287V+iBwdqKZUWhZJnuGJO9RE4wGG4cQMN8CkB7WQ="; aarch64-darwin = "sha256-ekoMhWMQpBUdM7R7i82NWrNtQMNqCujNYy1ijOxT64U="; </del> <ins> x86_64-linux = "sha256-l6+NdMzYI9r2aHU7/OUhbgmc/LmAZjEFL8y8GrJ+EX8="; aarch64-linux = "sha256-uo+/Wsrlkm+xotoIr8xlQWoiWzMz02TKFW+olfXtpz8="; x86_64-darwin = "sha256-gWxljTgt6aXUzwex2zu46B9YzTvhN0Pi9C1Ll1eiohg="; aarch64-darwin = "sha256-/UnBIQ/wA/0biIG9vIDKylhqFJ8QCoqjKH7xiePZ/eg="; </ins> }; }

) => fetch(`https://github.com/${owner}/${repo}/raw/${version}/core/Cargo.toml`) .then((res) => res.text()) <del> .then((txt) => mod.parse(txt).dependencies.v8.version); </del> <ins> .then((txt) => toml.parse(txt).dependencies.v8.version); </ins> const fetchArchShaTasks = (version: string, arches: Architecture[]) => arches.map(