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

python312Packages.pypdfium2: Fix incorrect hash #378156

Closed
wants to merge 1 commit into from

Conversation

sarahec
Copy link
Contributor

@sarahec sarahec commented Jan 30, 2025

Replaced incorrect hash for headers
Removed unneeded python import

Fixes #378154

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.

@GaetanLepage
Copy link
Contributor

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 378156


x86_64-linux

❌ 4 packages failed to build:
  • python312Packages.pypdfium2
  • python312Packages.pypdfium2.dist
  • python313Packages.pypdfium2
  • python313Packages.pypdfium2.dist

aarch64-linux

❌ 4 packages failed to build:
  • python312Packages.pypdfium2
  • python312Packages.pypdfium2.dist
  • python313Packages.pypdfium2
  • python313Packages.pypdfium2.dist

x86_64-darwin

❌ 4 packages failed to build:
  • python312Packages.pypdfium2
  • python312Packages.pypdfium2.dist
  • python313Packages.pypdfium2
  • python313Packages.pypdfium2.dist

aarch64-darwin

❌ 4 packages failed to build:
  • python312Packages.pypdfium2
  • python312Packages.pypdfium2.dist
  • python313Packages.pypdfium2
  • python313Packages.pypdfium2.dist

@GaetanLepage
Copy link
Contributor

┃ error: hash mismatch in fixed-output derivation '/nix/store/bzac5ysjadv6nhbl6g5m2f0lv2px8wvw-public.tar.gz.drv':
┃          specified: sha256-RJOhv9v/uI8jYh0hoM7FxGu2lcVV+7BjLkiZW0eX4hk=
┃             got:    sha256-SKnIF+Ib/S813AnIXMMSF0vdvrWcECcMO1JgbNLPs5Q=

@sarahec
Copy link
Contributor Author

sarahec commented Jan 31, 2025

This is bizarre: I'm getting a different hash per platform for the same file.

@sarahec
Copy link
Contributor Author

sarahec commented Jan 31, 2025

Closing this, and asking @booxter to please take a look. I suspect you'll need to vary the hash by platform as you do with the binaries.

@sarahec sarahec closed this Jan 31, 2025
}:

let
pdfiumVersion = "${pdfium-binaries.version}";

headers = fetchurl {
url = "https://pdfium.googlesource.com/pdfium/+archive/refs/heads/chromium/${pdfiumVersion}/public.tar.gz";
hash = "sha256-vKfs4Jd8LEtA3aTI+DcJMS0VOErq1IR1eThnMlxiER0=";
hash = "sha256-RJOhv9v/uI8jYh0hoM7FxGu2lcVV+7BjLkiZW0eX4hk=";
Copy link
Member

Choose a reason for hiding this comment

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

This isn't even the hash obtained in #378154.

Copy link
Contributor Author

@sarahec sarahec Jan 31, 2025

Choose a reason for hiding this comment

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

I wrote #378154 using x86-Linux but was developing this PR on aarch64-darwin. (The linux box was busy running a nixpkgs-review.) It looks like the hash varies per platform.

@dotlambda
Copy link
Member

dotlambda commented Jan 31, 2025

The problem is that we're not fetching from a fixed commit. It has nothing to do with different platforms.

@sarahec
Copy link
Contributor Author

sarahec commented Jan 31, 2025

The problem is that we're not fetching from a fixed commit. It has nothing to do with different platforms.

Good to know. I'm passing this back to the package maintainer.

@@ -9,15 +9,14 @@
numpy,
pillow,
pytestCheckHook,
python,
}:

let
pdfiumVersion = "${pdfium-binaries.version}";

headers = fetchurl {
url = "https://pdfium.googlesource.com/pdfium/+archive/refs/heads/chromium/${pdfiumVersion}/public.tar.gz";
Copy link
Member

Choose a reason for hiding this comment

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

What's the difference between this URL and https://pdfium.googlesource.com/pdfium/+archive/refs/heads/chromium/${pdfiumVersion}.tar.gz?

@dotlambda
Copy link
Member

The problem is that we're not fetching from a fixed commit. It has nothing to do with different platforms.

Actually, that's probably not quite it. I assume that the archive is generated on the fly and contains some timestamp, thus the hashes obtained at different times are different. Use either fetchzip or fetchgit. Both of those recursively hash the content of the tarball rather than the file itself.

@sarahec
Copy link
Contributor Author

sarahec commented Jan 31, 2025

OK, I know why he's using fetchurl -- the resulting file contains subfolders where fetchzip expects a flat folder.

@booxter
Copy link
Contributor

booxter commented Jan 31, 2025

I think the issue is that I erroneously refer to a branch, not a tag, so it can change. (I didn't realize that.) We will probably have to pin a particular revision.

@booxter
Copy link
Contributor

booxter commented Jan 31, 2025

Sent #378177 FYI

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.

Build failure: python3Packages.pypdfium2
4 participants