Skip to content

tesseract: ensure fixupPhase is run, e.g. ensuring library codesigning on darwin#352788

Merged
vcunat merged 1 commit intoNixOS:masterfrom
elohmeier:tesseract-ensure-fixup
Dec 23, 2024
Merged

tesseract: ensure fixupPhase is run, e.g. ensuring library codesigning on darwin#352788
vcunat merged 1 commit intoNixOS:masterfrom
elohmeier:tesseract-ensure-fixup

Conversation

@elohmeier
Copy link
Contributor

Since the tesseract wrapper replaces the phases in tesseractBase with it's buildCommand, this prevents running e.g. the fixupPhase which would codesign the modified library for darwin.
This change ensures the fixupPhase is executed, ensuring a valid code signature for libtesseract.5.dylib.

Before the change:

$ nix-build -A tesseract5.tesseractBase
/nix/store/5f9hf5d2lgdkb44x60khx5b2cm50xyv5-tesseract-5.3.4
$ codesign -vvv result/lib/libtesseract.5.dylib
result/lib/libtesseract.5.dylib: valid on disk
result/lib/libtesseract.5.dylib: satisfies its Designated Requirement

$ nix-build -A tesseract5
/nix/store/zxmnplp54g4iks4h9hrllfrd2rlbbj20-tesseract-5.3.4
$ codesign -vvv result/lib/libtesseract.5.dylib
result/lib/libtesseract.5.dylib: invalid signature (code or signature have been modified)
In architecture: arm64

After the change:

$ nix-build -A tesseract5.tesseractBase
/nix/store/5f9hf5d2lgdkb44x60khx5b2cm50xyv5-tesseract-5.3.4
$ codesign -vvv result/lib/libtesseract.5.dylib
result/lib/libtesseract.5.dylib: valid on disk
result/lib/libtesseract.5.dylib: satisfies its Designated Requirement

$ nix-build -A tesseract5
/nix/store/zxmnplp54g4iks4h9hrllfrd2rlbbj20-tesseract-5.3.4
$ codesign -vvv result/lib/libtesseract.5.dylib
result/lib/libtesseract.5.dylib: valid on disk
result/lib/libtesseract.5.dylib: satisfies its Designated Requirement

Fixes #350072.

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/)
  • 24.11 Release Notes (or backporting 23.11 and 24.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.

@ofborg ofborg bot added 6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux. labels Nov 1, 2024
@sarahec sarahec added the 0.kind: ZHF Fixes Fixes during the Zero Hydra Failures (ZHF) campaign label Nov 2, 2024
@sarahec
Copy link
Contributor

sarahec commented Nov 2, 2024

Result of nixpkgs-review pr 352788 run on aarch64-darwin 1

49 packages marked as broken and skipped:
  • almanah
  • arcan
  • arcan-all-wrapped
  • arcan-wrapped
  • arcan.dev
  • arcan.lib
  • arcan.man
  • cat9-wrapped
  • durden-wrapped
  • evolutionWithPlugins
  • gscan2pdf
  • gscan2pdf.man
  • khoj
  • khoj.dist
  • perl538Packages.ImageOCRTesseract
  • perl538Packages.ImageOCRTesseract.devdoc
  • perl540Packages.ImageOCRTesseract
  • perl540Packages.ImageOCRTesseract.devdoc
  • pipeworld-wrapped
  • prio-wrapped
  • private-gpt
  • private-gpt.dist
  • python311Packages.llama-index
  • python311Packages.llama-index-readers-file
  • python311Packages.llama-index-readers-file.dist
  • python311Packages.llama-index-readers-s3
  • python311Packages.llama-index-readers-s3.dist
  • python311Packages.llama-index.dist
  • python311Packages.paperwork-backend
  • python311Packages.paperwork-backend.dist
  • python311Packages.paperwork-shell
  • python311Packages.paperwork-shell.dist
  • python311Packages.private-gpt
  • python311Packages.private-gpt.dist
  • python312Packages.llama-index
  • python312Packages.llama-index-readers-file
  • python312Packages.llama-index-readers-file.dist
  • python312Packages.llama-index-readers-s3
  • python312Packages.llama-index-readers-s3.dist
  • python312Packages.llama-index.dist
  • python312Packages.paperwork-backend
  • python312Packages.paperwork-backend.dist
  • python312Packages.paperwork-shell
  • python312Packages.paperwork-shell.dist
  • python312Packages.private-gpt
  • python312Packages.private-gpt.dist
  • spamassassin
  • spamassassin.devdoc
  • xarcan
2 packages failed to build:
  • python311Packages.pdf2docx
  • python311Packages.pdf2docx.dist
51 packages built:
  • browsr
  • browsr.dist
  • ccextractor
  • invoice2data
  • invoice2data.dist
  • manga-cli
  • mcomix
  • mcomix.dist
  • normcap
  • normcap.dist
  • ocrmypdf (python312Packages.ocrmypdf)
  • ocrmypdf.dist (python312Packages.ocrmypdf.dist)
  • paperless-ngx
  • python311Packages.layoutparser
  • python311Packages.layoutparser.dist
  • python311Packages.ocrmypdf
  • python311Packages.ocrmypdf.dist
  • python311Packages.pymupdf
  • python311Packages.pymupdf.dist
  • python311Packages.pyocr
  • python311Packages.pyocr.dist
  • python311Packages.pytesseract
  • python311Packages.pytesseract.dist
  • python311Packages.pytikz-allefeld
  • python311Packages.pytikz-allefeld.dist
  • python311Packages.videocr
  • python311Packages.videocr.dist
  • python312Packages.layoutparser
  • python312Packages.layoutparser.dist
  • python312Packages.pdf2docx
  • python312Packages.pdf2docx.dist
  • python312Packages.pymupdf
  • python312Packages.pymupdf.dist
  • python312Packages.pyocr
  • python312Packages.pyocr.dist
  • python312Packages.pytesseract
  • python312Packages.pytesseract.dist
  • python312Packages.pytikz-allefeld
  • python312Packages.pytikz-allefeld.dist
  • python312Packages.videocr
  • python312Packages.videocr.dist
  • qt-box-editor
  • subtitleedit
  • termpdfpy
  • termpdfpy.dist
  • tesseract (tesseract5)
  • tesseract3
  • tesseract4
  • vimPlugins.openscad-nvim
  • vobsub2srt
  • zathura

@axeltlarsson
Copy link
Contributor

Hi, thanks for fixing this. Any idea when it can be merged 🙏?

@vcunat vcunat merged commit 39f0c2c into NixOS:master Dec 23, 2024
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented Dec 23, 2024

nativeBuildInputs = [ makeWrapper ];

buildCommand = ''
phases = [ "buildPhase" "fixupPhase" ];
Copy link
Member

Choose a reason for hiding this comment

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

phases should not be set in packages

Copy link
Member

Choose a reason for hiding this comment

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

This PR still definitely seemed like an improvement, though.

Copy link
Member

Choose a reason for hiding this comment

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

0.kind: ZHF Fixes Fixes during the Zero Hydra Failures (ZHF) campaign 6.topic: darwin Running or building packages on Darwin 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 11-100 This PR causes between 11 and 100 packages to rebuild on Linux.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build failure: python312Packages.pymupdf @ 1.24.10 on Darwin

5 participants