Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

spider: init at 2.33.11 #389848

Merged
merged 2 commits into from
Mar 18, 2025
Merged

spider: init at 2.33.11 #389848

merged 2 commits into from
Mar 18, 2025

Conversation

KSJ2000
Copy link
Contributor

@KSJ2000 KSJ2000 commented Mar 14, 2025

Resolves #388120

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.

Copy link
Member

@ethancedwards8 ethancedwards8 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

@KSJ2000 KSJ2000 mentioned this pull request Mar 16, 2025
13 tasks
Comment on lines 2 to 12
fetchFromGitHub,
lib,
nix-update-script,
openssl,
pkg-config,
rust-jemalloc-sys,
rustPlatform,
stdenv,
sqlite,
versionCheckHook,
zstd,
Copy link
Contributor

Choose a reason for hiding this comment

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

Please, sort the inputs in the order of apparition in the derivation (except lib which should remain at the top).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this written somewhere? because I think alphabetical order is easy to read/find and to add new as needed, so pretty logical.
Probably only chinese people would not agree.

Copy link
Contributor

Choose a reason for hiding this comment

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

No, I don't think it is written in an official document.
It is just significantly more consensual within the code base.
Now, if you prefer having it this way, I will not block this PR for this reason.

pkg-config,
rust-jemalloc-sys,
rustPlatform,
stdenv,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
stdenv,

unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

most of the package is taken from nix-init

Copy link
Contributor

Choose a reason for hiding this comment

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

nix-init does not put lib at the top?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the alphabetical order around the package was my doing when I removed some deprecated darwin features and added a some for checks
nix-init added stdenv which I did not see it's not used
definitely needs an update

Copy link
Contributor

Choose a reason for hiding this comment

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

Ok understood. nix-init would need to be updated indeed.
The "apparition ordering" is way more common across the nixpkgs code base. This is why I asked you to adopt it.

@GaetanLepage
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 389848


x86_64-linux

✅ 1 package built:
  • spider

aarch64-linux

✅ 1 package built:
  • spider

x86_64-darwin

❌ 1 package failed to build:
  • spider

aarch64-darwin

❌ 1 package failed to build:
  • spider

@KSJ2000
Copy link
Contributor Author

KSJ2000 commented Mar 17, 2025

That is quite weird to fail on darwin because I built it fine on aarch64-darwin.



nixpkgs-review result

Generated using nixpkgs-review-gha

Command: nixpkgs-review pr 389848

Logs: https://github.com/KSJ2000/nixpkgs-review-gha/actions/runs/13893515914


x86_64-linux

✅ 1 package built:
  • spider

aarch64-linux

✅ 1 package built:
  • spider

x86_64-darwin

✅ 1 package built:
  • spider

aarch64-darwin

✅ 1 package built:
  • spider

@GaetanLepage
Copy link
Contributor

I keep getting those failures on the darwin community builders:

test website::test_link_duplicates ... FAILED
test website::test_crawl_subscription ... FAILED
test website::test_crawl_budget ... FAILED
test website::not_crawl_blacklist ... FAILED

failures:

---- website::test_link_duplicates stdout ----

thread 'website::test_link_duplicates' panicked at /private/tmp/nix-build-spider-2.33.11.drv-0/spider-2.33.11-vendor/system-configuration-0.6.1/src/dynamic_store.rs:154:1:
Attempted to create a NULL object.

---- website::test_crawl_subscription stdout ----

thread 'website::test_crawl_subscription' panicked at /private/tmp/nix-build-spider-2.33.11.drv-0/spider-2.33.11-vendor/system-configuration-0.6.1/src/dynamic_store.rs:154:1:
Attempted to create a NULL object.
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

---- website::test_crawl_budget stdout ----

thread 'website::test_crawl_budget' panicked at /private/tmp/nix-build-spider-2.33.11.drv-0/spider-2.33.11-vendor/system-configuration-0.6.1/src/dynamic_store.rs:154:1:
Attempted to create a NULL object.

---- website::not_crawl_blacklist stdout ----

thread 'website::not_crawl_blacklist' panicked at /private/tmp/nix-build-spider-2.33.11.drv-0/spider-2.33.11-vendor/system-configuration-0.6.1/src/dynamic_store.rs:154:1:
Attempted to create a NULL object.


failures:
    website::not_crawl_blacklist
    website::test_crawl_budget
    website::test_crawl_subscription
    website::test_link_duplicates

test result: FAILED. 21 passed; 4 failed; 0 ignored; 0 measured; 8 filtered out; finished in 0.01s

I tried to add __darwinAllowLocalNetworking = true; but it doesn't seem to help. Are you building it with the sandbox disabled?

@KSJ2000
Copy link
Contributor Author

KSJ2000 commented Mar 18, 2025

That seems to be the case.
I haven't changed anything since installing nix, but nix-info -m shows sandbox: no

I tried enabling it with the following:

  1. export NIX_SANDBOX=1
  2. add sandbox = true to /etc/nix/nix.conf

Neither have changed sandbox to true
Last thing I found was adding --option sandbox true to nix-build, but it gives an error:

warning: Ignoring the client-specified setting 'sandbox', because it is a restricted setting and you are not a trusted user

I'm guessing I should add those failing tests to checkFlags list.
Is there a way to enable sandbox on darwin? I don't understand why it's not enabled by default.



EDIT: Need to reboot system for changes to /etc/nix/nix.conf to take effect!

@ethancedwards8
Copy link
Member

Add your user to trusted-users in nix.conf. For example, mine is:

trusted-users = root ece @wheel @admin

The @ means a group.

Comment on lines 45 to 47
# Network and io_uring not available in sandbox
checkFlags = [
"--skip=website::crawl"
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
# Network and io_uring not available in sandbox
checkFlags = [
"--skip=website::crawl"
checkFlags = [
# Network and io_uring not available in sandbox
"--skip=website::crawl"

nit

"--skip=page::test_status_code"
"--skip=pdl_is_fresh"
"--skip=verify_revision_available"
];
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
];
] ++ lib.optionals stdenv.isDarwin [
# Fail in the darwin sandbox with:
# Attempted to create a NULL object.
"--skip=website::not_crawl_blacklist"
"--skip=website::test_crawl_budget"
"--skip=website::test_crawl_subscription"
"--skip=website::test_link_duplicates"
];

Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you add more tests than the one listed in my comment? Were they failing too?
Also, I think that it is relevant to mention that it is a sandbox limitation. You have only written the error message.

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, they were failing. I added everything until the package built.
I thought it was obvious those were fails in the darwin sandbox because of the ++ lib.optionals stdenv.isDarwin
Sandbox limitation: Attempted to create a NULL object
would probably be a better message, right? just like io_uring which is available outside the sandbox

Copy link
Contributor

Choose a reason for hiding this comment

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

Sandbox limitation: Attempted to create a NULL object

This would be clearer indeed.

@KSJ2000
Copy link
Contributor Author

KSJ2000 commented Mar 18, 2025

It is not enough to add trusted-users to /etc/nix/nix.conf which is what I also tried. You need to reboot the system too, for it to take effect.

The weird thing is that even ofborg doesn't have the sandbox enabled since it built the package just fine:
https://logs.ofborg.org/?attempt_id=e8be082e-62ad-4f9d-967e-685b7981679f&key=nixos%2Fnixpkgs.389848
https://logs.ofborg.org/?attempt_id=0713a389-e2b8-443b-9467-3360a302d548&key=nixos%2Fnixpkgs.389848

@GaetanLepage
Copy link
Contributor

The weird thing is that even ofborg doesn't have the sandbox enabled since it built the package just fine:

No, ofborg does not enable the darwin sandbow indeed. So many things would be broken otherwise...

@GaetanLepage
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 389848


x86_64-linux

✅ 1 package built:
  • spider

aarch64-linux

✅ 1 package built:
  • spider

x86_64-darwin

✅ 1 package built:
  • spider

aarch64-darwin

✅ 1 package built:
  • spider

Copy link
Contributor

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

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

LGTM, thanks

@GaetanLepage GaetanLepage merged commit be1654a into NixOS:master Mar 18, 2025
27 of 30 checks passed
@KSJ2000 KSJ2000 deleted the spider branch March 19, 2025 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Package request: spider
3 participants