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

hplip: fix plugin fetch #391529

Merged
merged 3 commits into from
Mar 23, 2025
Merged

hplip: fix plugin fetch #391529

merged 3 commits into from
Mar 23, 2025

Conversation

psentee
Copy link
Contributor

@psentee psentee commented Mar 20, 2025

HP now returns 403 for unrecognized user-agents:

building '/nix/store/r9airhak8ic5pqpmbl7v9ixv1sif43rn-hplip-3.24.4-plugin.run.drv'...
error: builder for '/nix/store/r9airhak8ic5pqpmbl7v9ixv1sif43rn-hplip-3.24.4-plugin.run.drv' failed with exit code 1;
       last 19 log lines:
       >
       > trying https://developers.hp.com/sites/default/files/hplip-3.24.4-plugin.run
       >   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
       >                                  Dload  Upload   Total   Spent    Left  Speed
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 403
       > Warning: Problem (retrying all errors). Will retry in 1 seconds. 3 retries
       > Warning: left.
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 403
       > Warning: Problem (retrying all errors). Will retry in 2 seconds. 2 retries
       > Warning: left.
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 403
       > Warning: Problem (retrying all errors). Will retry in 4 seconds. 1 retries
       > Warning: left.
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
       > curl: (22) The requested URL returned error: 403
       > error: cannot download hplip-3.24.4-plugin.run from any mirror
       For full logs, run 'nix log /nix/store/r9airhak8ic5pqpmbl7v9ixv1sif43rn-hplip-3.24.4-plugin.run.drv'.

This change sets fetch user-agent to Firefox prefix (bare 'Mozilla/5.0' wasn't enough).

Also adds plugin source as a second source instead of a closed-over binding so it's possible to read and override it from outside (e.g. point at internal mirror or vendor the file).

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: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1 10.rebuild-linux: 1-10 labels Mar 20, 2025
@nix-owners nix-owners bot requested a review from ttuegel March 20, 2025 10:05
HP now returns 403 for unrecognized user-agents, set it to Firefox
prefix (bare 'Mozilla/5.0' wasn't enough).

Also adds `plugin` as a derivation parameter instead of a closed-over
binding so it's possible to `overrideAttrs` it (e.g. point at internal
mirror or vendor the file).
@SuperSandro2000 SuperSandro2000 merged commit 60b7c9f into NixOS:master Mar 23, 2025
33 of 35 checks passed
andrew-field pushed a commit to andrew-field/alterware that referenced this pull request Mar 23, 2025
@raboof raboof mentioned this pull request Mar 24, 2025
13 tasks
@Atemo-C Atemo-C mentioned this pull request Mar 25, 2025
3 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants