Skip to content

deno: enable tests#384838

Merged
wolfgangwalther merged 1 commit intoNixOS:masterfrom
ofalvai:deno-enable-tests
Jun 11, 2025
Merged

deno: enable tests#384838
wolfgangwalther merged 1 commit intoNixOS:masterfrom
ofalvai:deno-enable-tests

Conversation

@ofalvai
Copy link
Contributor

@ofalvai ofalvai commented Feb 24, 2025

The project has an extensive tests suite in both Rust and Typescript, and while I couldn't enable all of them, this is one attempt to run at least a subset in the Nix build.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 25.05 Release Notes (or backporting 24.11 and 25.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Feb 24, 2025
Copy link
Member

@06kellyjac 06kellyjac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be nice to have tests back, good stuff.
They used to be a bit flakey so something to keep an eye on.

Added a few comments/questions

Also, by how much do you think this affects build times? Since the deno build is already very long due to the time spent linking.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is it worth skipping these tests completely?
I cant remember the status of darwin sandboxing but it might just be worth keeping the platforms standard and skipping these

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm also not fully familiar with the Darwin sandbox, but these tests do pass on Darwin for some reason. We could also completely drop them, I don't have a strong opinion.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are they are passing with the sandbox on on darwin? nix recently got improved support for larger (in terms of amount of store paths involved) sandboxed builds on darwin.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, these tests did pass on Darwin with sandbox = relaxed.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this patch unused or did I just miss something?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's used, but you made me realize this is not strictly related to tests, I just think it would be a good idea. Just like how we unvendored libffi after it caused a build failure a few months ago: #368102

Should I drop this change?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could easily replace this patch with substituteInPlace

@MisileLab
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 384838

Logs: https://github.com/MisileLab/nixpkgs-review-gha/actions/runs/13516415642


x86_64-linux

❌ 1 package failed to build:
  • windmill
✅ 9 packages built:
  • deno
  • era
  • quarto
  • quartoMinimal
  • rstudio
  • rstudio-server
  • rstudioServerWrapper
  • rstudioWrapper
  • silverbullet

aarch64-linux

⏩ 4 packages marked as broken and skipped:
  • rstudio
  • rstudio-server
  • rstudioServerWrapper
  • rstudioWrapper
❌ 6 packages failed to build:
  • deno
  • era
  • quarto
  • quartoMinimal
  • silverbullet
  • windmill

x86_64-darwin

✅ 5 packages built:
  • deno
  • era
  • quarto
  • quartoMinimal
  • silverbullet

aarch64-darwin

✅ 5 packages built:
  • deno
  • era
  • quarto
  • quartoMinimal
  • silverbullet

@ofalvai
Copy link
Contributor Author

ofalvai commented Feb 25, 2025

Also, by how much do you think this affects build times? Since the deno build is already very long due to the time spent linking.

Build times on my MacBook M3 Pro:

  • without tests: 11m
  • with tests: 16m

We could also add requiredSystemFeatures = [ "big-parallel" ]; to this derivation, I think it's justified.

Comment on lines 42 to 45
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
./patches/unvendor-sqlite.patch
./patches/tests-no-chown.patch
./patches/tests-replace-hardcoded-paths.patch
./patches/tests-darwin-differences.patch
./unvendor-sqlite.patch
./tests-no-chown.patch
./tests-replace-hardcoded-paths.patch
./tests-darwin-differences.patch

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure I follow, do you suggest moving the patch files out of the subdirectory?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep

Comment on lines 148 to 150
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can probably combine those into one to not traverse everything 3 times.

Comment on lines 34 to 37
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
hash = "sha256-Ir/jBmXsiM9T3dY6kd8wsC+qB1alHm5JNAx+aq9hXHo=";
fetchSubmodules = true; # required for tests
fetchSubmodules = true; # required for tests
hash = "sha256-Ir/jBmXsiM9T3dY6kd8wsC+qB1alHm5JNAx+aq9hXHo=";

@ofborg ofborg bot added the 2.status: merge conflict This PR has merge conflicts with the target branch label Feb 28, 2025
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Feb 28, 2025
@ofalvai
Copy link
Contributor Author

ofalvai commented Feb 28, 2025

I fixed the review comments and rebased my commits to the latest Deno version, I think this PR is ready

@wegank wegank added the 12.approvals: 1 This PR was reviewed and approved by one person. label Mar 1, 2025
@MisileLab
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 384838

Logs: https://github.com/MisileLab/nixpkgs-review-gha/actions/runs/13602439731


x86_64-linux

❌ 1 package failed to build:
  • windmill
✅ 9 packages built:
  • deno
  • era
  • quarto
  • quartoMinimal
  • rstudio
  • rstudio-server
  • rstudioServerWrapper
  • rstudioWrapper
  • silverbullet

aarch64-linux

❌ 10 packages failed to build:
  • deno
  • era
  • quarto
  • quartoMinimal
  • rstudio
  • rstudio-server
  • rstudioServerWrapper
  • rstudioWrapper
  • silverbullet
  • windmill

x86_64-darwin

✅ 9 packages built:
  • deno
  • era
  • quarto
  • quartoMinimal
  • rstudio
  • rstudio-server
  • rstudioServerWrapper
  • rstudioWrapper
  • silverbullet

aarch64-darwin

✅ 9 packages built:
  • deno
  • era
  • quarto
  • quartoMinimal
  • rstudio
  • rstudio-server
  • rstudioServerWrapper
  • rstudioWrapper
  • silverbullet

@MisileLab
Copy link
Contributor

I have no idea why aarch64-linux failing

@ofalvai
Copy link
Contributor Author

ofalvai commented Mar 1, 2025

I have no idea either, the log is not helpful. But it builds for me on aarch64-linux, at this point I think it's a GHA-specific issue

@ofalvai ofalvai force-pushed the deno-enable-tests branch from 2fd7874 to e5a28c4 Compare March 12, 2025 18:50
@ofalvai
Copy link
Contributor Author

ofalvai commented Mar 12, 2025

Rebased commits on top of #387198

@github-actions github-actions bot added 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. and removed 10.rebuild-linux: 1-10 This PR causes between 1 and 10 packages to rebuild on Linux. labels Mar 12, 2025
Copy link
Member

@06kellyjac 06kellyjac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for rebasing. 1 holdup, 2 comments.

Comment on lines 159 to 160
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This needs to live outside of canExecute please or cross-platform builds will end up with additional binaries.


Also this method is opt-out of extra bits, but do we want to be opt-in instead? It'd just mean we wouldn't accidentally package more testing utils etc without noticing. This part isn't a big blocker.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea, thank you. Addressed these in my latest change

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might want to cleanup $HOME and unset the var in postCheck. Not a major blocker

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On the same note it maybe preferable to add writableTmpDirAsHomeHook as a nativeBuildInput instead

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice, I didn't know about writableTmpDirAsHomeHook. I just replaced the custom script with that, thank you

@wegank wegank removed the 12.approvals: 1 This PR was reviewed and approved by one person. label Mar 12, 2025
@ofalvai
Copy link
Contributor Author

ofalvai commented Apr 30, 2025

@06kellyjac @SuperSandro2000 I re-purposed this PR and added the latest version bump on top. Tests still pass on aarch64-darwin and I'm testing soon on aarch64-linux too. Let's merge this if there are no more objections please.

@ofalvai ofalvai changed the title deno: 2.2.12 -> 2.3.0, enable tests deno: 2.2.12 -> 2.3.1, enable tests Apr 30, 2025
@ofalvai ofalvai force-pushed the deno-enable-tests branch from 28db71c to 52dbcf8 Compare April 30, 2025 15:03
@ofalvai
Copy link
Contributor Author

ofalvai commented Apr 30, 2025

I had to disable two more tests (I'm not sure why they passed on Darwin, they both access the network), but aarch64-linux also builds now

@phaer
Copy link
Member

phaer commented May 4, 2025

I'm not sure why they passed on Darwin, they both access the network)

You might have the sandbox off on darwin? I think that's still the default and would allow full networking during builds.

@phaer
Copy link
Member

phaer commented May 4, 2025

@ofalvai Do we know what's up with the x86_64-darwin failure? Is that due to a test? Did you check? Your aarch64-darwin machine should be able to build that, right? Does it do with the sandbox?

I'll try to test tomorrow and would be happy to merge once we have an explanation for that failing check.

@ofalvai
Copy link
Contributor Author

ofalvai commented May 4, 2025

Ofborg says it's a simple timeout, which is understandable, this project already takes a long time to build, and now I enabled tests as well.
I tested both Darwin platforms (via Rosetta) with sandbox = relaxed (that's why I added __darwinAllowLocalNetworking = true; to the derivation in this PR)

@wolfgangwalther
Copy link
Contributor

merge conflict!

@wolfgangwalther wolfgangwalther added the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 1, 2025
@ofalvai ofalvai force-pushed the deno-enable-tests branch from 52dbcf8 to 34bcc6f Compare June 2, 2025 09:31
@ofborg ofborg bot removed the 2.status: merge conflict This PR has merge conflicts with the target branch label Jun 2, 2025
@github-actions github-actions bot added the 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. label Jun 2, 2025
@ofalvai ofalvai changed the title deno: 2.2.12 -> 2.3.1, enable tests deno: enable tests Jun 2, 2025
@ofalvai
Copy link
Contributor Author

ofalvai commented Jun 2, 2025

@wolfgangwalther it's fixed now. Tested on aarch64-darwin and aarch64-linux again, tests are still green.

@wolfgangwalther
Copy link
Contributor

wolfgangwalther commented Jun 2, 2025

So I can build both linux fine, but darwin fails with this:

test repl::pty_complete_imports_no_panic_empty_specifier ... FAILED

failures:

---- repl::pty_complete_imports_no_panic_empty_specifier stdout ----
command /private/tmp/nix-build-deno-2.3.5.drv-0/source/target/aarch64-apple-darwin/release/deno repl -A
command cwd /private/tmp/nix-build-deno-2.3.5.drv-0/deno-cli-test8Iz5Gq
------ Start Full Text ------
"Deno 2.3.5\r\nexit using ctrl+d, ctrl+c, or close()\r\n\u{1b}[?2004h\r\u{1b}[K> \r\u{1b}[2C\r\u{1b}[K> i\r\u{1b}[3C\r\u{1b}[K> im\r\u{1b}[4C\r\u{1b}[K> imp\r\>
------- End Full Text -------
Next text: "Deno 2.3.5\r\nexit using ctrl+d, ctrl+c, or close()\r\n\r> \r\r> i\r\r> im\r\r> imp\r\r> impo\r\r> impor\r\r> import\r\r> import \r\r> import '\r"

thread 'repl::pty_complete_imports_no_panic_empty_specifier' panicked at tests/integration/repl_tests.rs:189:15:
Timed out.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace


failures:
    repl::pty_complete_imports_no_panic_empty_specifier

test result: FAILED. 780 passed; 1 failed; 10 ignored; 0 measured; 45 filtered out; finished in 183.84s

error: test failed, to rerun pass `-p cli_tests --test integration_tests`

(repeatedly)

Edit: That's with sandbox, though, on the community-builder. Is this expected?

@ofalvai
Copy link
Contributor Author

ofalvai commented Jun 2, 2025

Interesting, this is the test case that timed out for me on Linux, and so I added to the skip list. But it has never hanged for me on macOS. And I'm also building with sandbox = relaxed.

The project has an extensive tests suite in both Rust and Typescript, and while I couldn't enable all of them, this is one attempt to run at least a subset in the Nix build.
@ofalvai ofalvai force-pushed the deno-enable-tests branch from 34bcc6f to 1161ba5 Compare June 3, 2025 16:29
@ofalvai
Copy link
Contributor Author

ofalvai commented Jun 3, 2025

@wolfgangwalther that test is now excluded for all platforms. I looked at the test source and have no idea why it hangs while other REPL tests do not.

@ofalvai ofalvai closed this Jun 3, 2025
@ofalvai ofalvai reopened this Jun 3, 2025
@wolfgangwalther
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 384838 --package deno.tests --package deno
Commit: 1161ba59a7be43418e09dd101a05489df3e461c7


x86_64-linux

✅ 7 packages built:
  • deno
  • deno.tests.basic
  • deno.tests.fail-read-file
  • deno.tests.import-json
  • deno.tests.import-ts
  • deno.tests.read-file
  • deno.tests.version

aarch64-linux

✅ 7 packages built:
  • deno
  • deno.tests.basic
  • deno.tests.fail-read-file
  • deno.tests.import-json
  • deno.tests.import-ts
  • deno.tests.read-file
  • deno.tests.version

x86_64-darwin

✅ 7 packages built:
  • deno
  • deno.tests.basic
  • deno.tests.fail-read-file
  • deno.tests.import-json
  • deno.tests.import-ts
  • deno.tests.read-file
  • deno.tests.version

aarch64-darwin

✅ 7 packages built:
  • deno
  • deno.tests.basic
  • deno.tests.fail-read-file
  • deno.tests.import-json
  • deno.tests.import-ts
  • deno.tests.read-file
  • deno.tests.version

@wolfgangwalther wolfgangwalther merged commit 5831013 into NixOS:master Jun 11, 2025
26 of 31 checks passed
@limwa limwa mentioned this pull request Jun 16, 2025
3 tasks
@ofalvai ofalvai mentioned this pull request Jun 24, 2025
13 tasks
fnichol added a commit to systeminit/si that referenced this pull request Jul 18, 2025
Pin Deno to version 2.2.12 as this is the last version that successfully
built via Hydra. All newer versions revert to source-building which
takes way too long for every developer.

References: NixOS/nixpkgs#417331
References: NixOS/nixpkgs#384838

Signed-off-by: Fletcher Nichol <fletcher@systeminit.com>
fnichol added a commit to systeminit/si that referenced this pull request Jul 19, 2025
Pin Deno to version 2.2.12 as this is the last version that successfully
built via Hydra. All newer versions revert to source-building which
takes way too long for every developer.

References: NixOS/nixpkgs#417331
References: NixOS/nixpkgs#384838

Signed-off-by: Fletcher Nichol <fletcher@systeminit.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. 11.by: package-maintainer This PR was created by a maintainer of all the package it changes. 12.approvals: 3+ This PR was reviewed and approved by three or more persons.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

9 participants