Skip to content

qrencode: fix build failure#407835

Merged
philiptaron merged 2 commits intoNixOS:stagingfrom
stefano-m:GH-407834/fix-qrencode-build
May 22, 2025
Merged

qrencode: fix build failure#407835
philiptaron merged 2 commits intoNixOS:stagingfrom
stefano-m:GH-407834/fix-qrencode-build

Conversation

@stefano-m
Copy link
Contributor

@stefano-m stefano-m commented May 17, 2025

Resolves #407834

The source tar is no more available at
https://fukuchi.org/works/qrencode/qrencode-4.1.1.tar.gz

E.g.

$ curl -I 'https://fukuchi.org/works/qrencode/qrencode-4.1.1.tar.gz'
HTTP/1.1 404 Not Found
Date: Sat, 17 May 2025 07:13:20 GMT
Server: Apache/2.4.62 (Debian)
Strict-Transport-Security: max-age=31536000
Content-Type: text/html; charset=iso-8859-

However, we can download it from the official repository on GitHub as mentioned
in the project's home page[1].

To make the package build, we use autoreconfHook to mimick the repo's
autogen.sh because the GitHub repo does not contain the configure script as
mentioned in the project's README[2]:

If there is no "configure" script in the source code directory, run
"autogen.sh" at first to generate it - this is mandatory if you downloaded
the source from GitHub.

Additionally, nix fails with an infinite recursion error When running the tests with
SDL2 in nativeCheckInputs.

Removing the dependency fixes the error and the tests still run successfully.

NOTE: I don't know to run the tests as defined in the passthru.tests attribute. Instead, it modified the package temporarily by setting doCheck = true and configureFlags = [ "--with-tests" ] directly in the derivation and observed that the build passed with the tests running successfuly after removing the SDL2 dependency.

Running

nix build -L -I nixpkgs=./ '.#qrencode.passthru.tests'

on my local checkout works

[1] https://web.archive.org/web/20250413215821/https://fukuchi.org/en/works/qrencode/
[2] https://github.com/fukuchi/libqrencode/blob/50b3e5725cafccfde038c0833cdaa5b1c28491e2/README.md#compile--install

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/)
  • Nixpkgs 25.11 Release Notes (or backporting 24.11 and 25.05 Nixpkgs Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
  • NixOS 25.11 Release Notes (or backporting 24.11 and 25.05 NixOS Release notes)
    • (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: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. labels May 17, 2025
Copy link
Member

@Prince213 Prince213 left a comment

Choose a reason for hiding this comment

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

I would suggest that you arrage your commits like this:

  1. qrencode: update src to GitHub, in which you use fetchFromGitHub and add autoreconfHook; and
  2. qrencode: remove SDL2 from nativeCheckInputs

stefano-m added 2 commits May 17, 2025 17:39
The source tar is no more available at
https://fukuchi.org/works/qrencode/qrencode-4.1.1.tar.gz

E.g.

    $ curl -I 'https://fukuchi.org/works/qrencode/qrencode-4.1.1.tar.gz'
    HTTP/1.1 404 Not Found
    Date: Sat, 17 May 2025 07:13:20 GMT
    Server: Apache/2.4.62 (Debian)
    Strict-Transport-Security: max-age=31536000
    Content-Type: text/html; charset=iso-8859-

However, we can download it from the official repository on GitHub as mentioned
in the project's home page[1].

To make the package build, we use autoreconfHook to mimick the repo's
`autogen.sh` because the GitHub repo does not contain the configure script as
mentioned in the project's README[2]:

> If there is no "configure" script in the source code directory, run
> "autogen.sh" at first to generate it - this is mandatory if you downloaded
> the source from GitHub.

[1] https://web.archive.org/web/20250413215821/https://fukuchi.org/en/works/qrencode/
[2] https://github.com/fukuchi/libqrencode/blob/50b3e5725cafccfde038c0833cdaa5b1c28491e2/README.md#compile--install
Nix fails with an infinite recursion error When running the qrencode tests with
SDL2 in nativeCheckInputs.

Removing the dependency fixes the error and the tests still run successfully.
@stefano-m stefano-m requested a review from Prince213 May 17, 2025 16:43
@stefano-m
Copy link
Contributor Author

I hope this can be backported to 24.11

Copy link
Member

@Prince213 Prince213 left a comment

Choose a reason for hiding this comment

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

Built and tested on x86_64-linux.

@Prince213 Prince213 added backport release-24.11 12.approvals: 1 This PR was reviewed and approved by one person. labels May 17, 2025
@philiptaron philiptaron changed the title Fix qrencode build failure qrencode: fix build failure May 22, 2025
@philiptaron philiptaron changed the base branch from master to staging May 22, 2025 18:12
@philiptaron philiptaron merged commit 889f284 into NixOS:staging May 22, 2025
38 of 42 checks passed
@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented May 22, 2025

Backport failed for release-24.11, because it was unable to cherry-pick the commit(s).

Please cherry-pick the changes locally and resolve any conflicts.

git fetch origin release-24.11
git worktree add -d .worktree/backport-407835-to-release-24.11 origin/release-24.11
cd .worktree/backport-407835-to-release-24.11
git switch --create backport-407835-to-release-24.11
git cherry-pick -x 04db9fed9e8a9ef0dae2c829b0abe864e2e7f9df b8246ba626f8c122e615b239985fc340d2eed27c

@nixpkgs-ci
Copy link
Contributor

nixpkgs-ci bot commented May 22, 2025

Successfully created backport PR for release-25.05:

@nixpkgs-ci nixpkgs-ci bot added the 8.has: port to stable This PR already has a backport to the stable release. label May 22, 2025
@philiptaron
Copy link
Contributor

philiptaron commented May 22, 2025

I hope this can be backported to 24.11

You'll have to manually do that -- the auto-backport failed. Also note that it needs to target staging-24.11 due to rebuild count.

@stefano-m
Copy link
Contributor Author

Created manual backport to staging-24.11: #410581

@philiptaron
Copy link
Contributor

All of the backports have been merged. Thanks for your work @stefano-m.

@stefano-m
Copy link
Contributor Author

All of the backports have been merged. Thanks for your work @stefano-m.

Thank you @philiptaron

Sorry for the late reply. Life happened 😅

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

Labels

8.has: port to stable This PR already has a backport to the stable release. 10.rebuild-darwin: 11-100 This PR causes between 11 and 100 packages to rebuild on Darwin. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. 12.approvals: 1 This PR was reviewed and approved by one person.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Build failure: qrencode

3 participants