Skip to content

anki: fix darwin build, add missing platform wheels - #499992

Merged
dotlambda merged 3 commits into
NixOS:masterfrom
tomrfitz:anki-darwin-extra-wheels-upstream
Mar 18, 2026
Merged

anki: fix darwin build, add missing platform wheels#499992
dotlambda merged 3 commits into
NixOS:masterfrom
tomrfitz:anki-darwin-extra-wheels-upstream

Conversation

@tomrfitz

Copy link
Copy Markdown
Contributor

anki-audio and anki-mac-helper aren't available in python3Packages. uv requires them to build on darwin, but sandboxed builder can't fetch them, so fetch them here and link them alongside other wheels.

This fixes the regression on darwin from #498788 which was missing two darwin-specific, anki-only deps. This is less clean than adding those deps to python3Packages, but since they're only used for anki (afaik) this gets darwin back online more quickly. x86_64-linux build is unaffected in my testing since these wheels are platform gated.

before change: failed build output

without any changes:

error: builder for '/nix/store/l2f015sryd4b047cwb3gfp63wrc2g3ky-anki-25.09.2.drv' failed with exit code 1;
       last 25 log lines:
       > DEBUG No cache entry for: https://pypi.org/simple/referencing/
       > DEBUG Sending fresh GET request for: https://pypi.org/simple/referencing/
       > DEBUG No cache entry for: https://pypi.org/simple/requests/
       > DEBUG Sending fresh GET request for: https://pypi.org/simple/requests/
       > DEBUG No cache entry for: https://pypi.org/simple/pyqt6/
       > DEBUG Sending fresh GET request for: https://pypi.org/simple/pyqt6/
       > DEBUG No cache entry for: https://pypi.org/simple/rpds-py/
       > DEBUG Sending fresh GET request for: https://pypi.org/simple/rpds-py/
       > DEBUG No cache entry for: https://pypi.org/simple/send2trash/
       > DEBUG Sending fresh GET request for: https://pypi.org/simple/send2trash/
       > DEBUG No cache entry for: https://pypi.org/simple/soupsieve/
       > DEBUG Sending fresh GET request for: https://pypi.org/simple/soupsieve/
       > DEBUG No cache entry for: https://pypi.org/simple/typing-extensions/
       > DEBUG Sending fresh GET request for: https://pypi.org/simple/typing-extensions/
       > DEBUG No cache entry for: https://pypi.org/simple/waitress/
       > DEBUG Sending fresh GET request for: https://pypi.org/simple/waitress/
       > DEBUG No cache entry for: https://pypi.org/simple/werkzeug/
       > DEBUG Sending fresh GET request for: https://pypi.org/simple/werkzeug/
       > DEBUG No cache entry for: https://pypi.org/simple/urllib3/
       > DEBUG Sending fresh GET request for: https://pypi.org/simple/urllib3/
       >   × No solution found when resolving dependencies:
       >   ╰─▶ Because there are no versions of anki-audio{sys_platform == 'darwin'
       >       or sys_platform == 'win32'} and you require anki-audio{sys_platform
       >       == 'darwin' or sys_platform == 'win32'}, we can conclude that your
       >       requirements are unsatisfiable.

after adding fetch for anki-audio wheel:

error: builder for '/nix/store/hc013n4547yv6digfsnbfy4r6wqkb3bs-anki-25.09.2.drv' failed with exit code 1;
       last 25 log lines:
       > DEBUG Sending fresh GET request for: https://pypi.org/simple/werkzeug/
       > INFO add_decision: Id::<PubGrubPackage>(2) @ 0.1.0 without checking dependencies
       > DEBUG Searching for a compatible version of anki-audio{sys_platform == 'darwin' or sys_platform == 'win32'} (==0.1.0)
       > DEBUG Selecting: anki-audio==0.1.0 [compatible] (anki_audio-0.1.0-cp39-abi3-macosx_11_0_arm64.whl)
       > INFO add_decision: Id::<PubGrubPackage>(37) @ 0.1.0 without checking dependencies
       > DEBUG Searching for a compatible version of anki-mac-helper{sys_platform == 'darwin'} (>=0.1.1)
       > DEBUG No compatible version found for: anki-mac-helper{sys_platform == 'darwin'}
       > INFO Start conflict resolution because incompat satisfied:
       >    anki-mac-helper{sys_platform == 'darwin'} >=0.1.1 is forbidden
       > INFO backtrack to DecisionLevel(1)
       > DEBUG Searching for a compatible version of aqt @ file:///nix/var/nix/b/3vpny2nai9fmpz5ph81gpri493/source/qt (<25.9.2 | >25.9.2)
       > DEBUG No compatible version found for: aqt
       > INFO Start conflict resolution because incompat satisfied:
       >    aqt <25.9.2 | >25.9.2 is forbidden
       > INFO prior cause: aqt depends on anki-mac-helper{sys_platform == 'darwin'} >=0.1.1
       > INFO prior cause: aqt * is forbidden
       > INFO prior cause: root ==0a0.dev0 is forbidden
       >   × No solution found when resolving dependencies:
       >   ╰─▶ Because only aqt==25.9.2 is available and aqt==25.9.2 depends on
       >       anki-mac-helper{sys_platform == 'darwin'}>=0.1.1, we can conclude
       >       that all versions of aqt depend on anki-mac-helper{sys_platform ==
       >       'darwin'}>=0.1.1.
       >       And because only anki-mac-helper{sys_platform == 'darwin'}<0.1.1 is
       >       available and you require aqt, we can conclude that your requirements
       >       are unsatisfiable.
Full nixpkgs-review output
nixpkgs-review rev 043071890391
$ git -c fetch.prune=false fetch --no-tags --force https://github.com/NixOS/nixpkgs master:refs/nixpkgs-review/0
remote: Enumerating objects: 23, done.
remote: Counting objects: 100% (17/17), done.
remote: Compressing objects: 100% (6/6), done.
remote: Total 23 (delta 12), reused 11 (delta 11), pack-reused 6 (from 3)
Unpacking objects: 100% (23/23), 259.51 KiB | 8.37 MiB/s, done.
From https://github.com/NixOS/nixpkgs
   9d1804292ee4..13875c6d92d2  master     -> refs/nixpkgs-review/0
$ git worktree add /Users/tomrfitz/.cache/nixpkgs-review/rev-0430718903911371abc6776aa11914ebf49c2427-1/nixpkgs 13875c6d92d2277f71e5ca2657ece1b8368a5c6d
Preparing worktree (detached HEAD 13875c6d92d2)
Updating files: 100% (51606/51606), done.
HEAD is now at 13875c6d92d2 pkgs/stdenv/linux: update riscv64-unknown-linux-gnu bootstrap-files (#498702)
Local evaluation for computing rebuilds
$ nix-env --extra-experimental-features no-url-literals --option system aarch64-darwin -f <nixpkgs> --nix-path nixpkgs=/Users/tomrfitz/.cache/nixpkgs-review/rev-0430718903911371abc6776aa11914ebf49c2427-1/nixpkgs nixpkgs-overlays=/var/folders/6l/nw6_9p1j7dl24bztqqbr_b4w0000gn/T/tmpda_tsy0_ -qaP --xml --out-path --show-trace --no-allow-import-from-derivation
evaluation warning: Nixpkgs 26.05 will be the last release to support x86_64-darwin; see https://nixos.org/manual/nixpkgs/unstable/release-notes#x86_64-darwin-26.05
$ git merge --no-commit --no-ff 0430718903911371abc6776aa11914ebf49c2427
Automatic merge went well; stopped before committing as requested
$ nix-env --extra-experimental-features no-url-literals --option system aarch64-darwin -f <nixpkgs> --nix-path nixpkgs=/Users/tomrfitz/.cache/nixpkgs-review/rev-0430718903911371abc6776aa11914ebf49c2427-1/nixpkgs nixpkgs-overlays=/var/folders/6l/nw6_9p1j7dl24bztqqbr_b4w0000gn/T/tmpda_tsy0_ -qaP --xml --out-path --show-trace --no-allow-import-from-derivation --meta
evaluation warning: Nixpkgs 26.05 will be the last release to support x86_64-darwin; see https://nixos.org/manual/nixpkgs/unstable/release-notes#x86_64-darwin-26.05
--------- Impacted packages on 'aarch64-darwin' ---------
3 packages updated:
anki ki mnemosyne

warning: Ignoring the client-specified setting 'system', because it is a restricted setting and you are not a trusted user
$ nom build --file /nix/store/69r4ha4fga1xyx9bz47my21pkqy5cqjf-nixpkgs-review-3.6.0/lib/python3.13/site-packages/nixpkgs_review/nix/review-shell.nix --nix-path 'nixpkgs=/Users/tomrfitz/.cache/nixpkgs-review/rev-0430718903911371abc6776aa11914ebf49c2427-1/nixpkgs nixpkgs-overlays=/var/folders/6l/nw6_9p1j7dl24bztqqbr_b4w0000gn/T/tmpda_tsy0_' --extra-experimental-features 'nix-command no-url-literals' --no-link --keep-going --no-allow-import-from-derivation --argstr local-system aarch64-darwin --argstr nixpkgs-path /Users/tomrfitz/.cache/nixpkgs-review/rev-0430718903911371abc6776aa11914ebf49c2427-1/nixpkgs --argstr nixpkgs-config-path /var/folders/6l/nw6_9p1j7dl24bztqqbr_b4w0000gn/T/tmp3troi72k.nix --argstr attrs-path /Users/tomrfitz/.cache/nixpkgs-review/rev-0430718903911371abc6776aa11914ebf49c2427-1/attrs.nix
Finished at 23:35:51 after 5s
--------- Report for 'aarch64-darwin' ---------
8 packages built:
anki anki.doc anki.lib anki.man ki ki.dist mnemosyne mnemosyne.dist

Logs can be found under:
/Users/tomrfitz/.cache/nixpkgs-review/rev-0430718903911371abc6776aa11914ebf49c2427-1/logs

$ /nix/store/qkc1silw07m48blrls2v5qddprvbznkf-nix-output-monitor-2.1.8/bin/nom-shell --argstr local-system aarch64-darwin --argstr nixpkgs-path /Users/tomrfitz/.cache/nixpkgs-review/rev-0430718903911371abc6776aa11914ebf49c2427-1/nixpkgs --argstr nixpkgs-config-path /var/folders/6l/nw6_9p1j7dl24bztqqbr_b4w0000gn/T/tmp3troi72k.nix --argstr attrs-path /Users/tomrfitz/.cache/nixpkgs-review/rev-0430718903911371abc6776aa11914ebf49c2427-1/attrs.nix --nix-path 'nixpkgs=/Users/tomrfitz/.cache/nixpkgs-review/rev-0430718903911371abc6776aa11914ebf49c2427-1/nixpkgs nixpkgs-overlays=/var/folders/6l/nw6_9p1j7dl24bztqqbr_b4w0000gn/T/tmpda_tsy0_' /nix/store/69r4ha4fga1xyx9bz47my21pkqy5cqjf-nixpkgs-review-3.6.0/lib/python3.13/site-packages/nixpkgs_review/nix/review-shell.nix

Things done

  • Built on platform:
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • Tested, as applicable:
  • Ran nixpkgs-review on this PR. See nixpkgs-review usage.
  • Tested basic functionality of all binary files, usually in ./result/bin/.
  • Nixpkgs Release Notes
    • Package update: when the change is major or breaking.
  • NixOS Release Notes
    • Module addition: when adding a new NixOS module.
    • Module update: when the change is significant.
  • Fits CONTRIBUTING.md, pkgs/README.md, maintainers/README.md and other READMEs.

@ofborg ofborg Bot added the 6.topic: darwin Running or building packages on Darwin label Mar 15, 2026
@nixpkgs-ci
nixpkgs-ci Bot requested review from JuneStepp, euank and oxij March 15, 2026 04:57
@nixpkgs-ci nixpkgs-ci Bot added 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. labels Mar 15, 2026
@euank
euank requested a review from dotlambda March 16, 2026 03:20

@euank euank left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

One style comment which I don't feel strongly about at all, feel free to ignore it either way!

I can't test the darwin build since I don't have a macOS device, but the change makes sense to me, thank you!

Comment thread pkgs/by-name/an/anki/package.nix Outdated
@nixpkgs-ci nixpkgs-ci Bot added 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages. labels Mar 16, 2026
@tomrfitz
tomrfitz force-pushed the anki-darwin-extra-wheels-upstream branch from 2d8f998 to b23e67c Compare March 16, 2026 04:11

@dotlambda dotlambda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

anki-audio and anki-mac-helper aren't available in python3Packages

Add them to python3Packages instead.

@tomrfitz
tomrfitz force-pushed the anki-darwin-extra-wheels-upstream branch from b23e67c to 6ce397c Compare March 16, 2026 07:12
@tomrfitz

Copy link
Copy Markdown
Contributor Author

Amended and pushed again with your suggested change as i understand it.

test build passed on x86_64-linux and here's nixpkgs-review output:

16 packages built:
anki anki.doc anki.lib anki.man ki ki.dist mnemosyne mnemosyne.dist python313Packages.anki-audio python313Packages.anki-audio.dist python313Packages.anki-mac-helper python313Packages.anki-mac-helper.dist python314Packages.anki-audio python314Packages.anki-audio.dist python314Packages.anki-mac-helper python314Packages.anki-mac-helper.dist

i haven't worked that in depth before in nixpkgs so that was a fun detour to learn how things work in more detail.

@nixpkgs-ci
nixpkgs-ci Bot requested a review from natsukium March 16, 2026 07:18
@nixpkgs-ci nixpkgs-ci Bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Mar 16, 2026
@tomrfitz
tomrfitz requested a review from dotlambda March 16, 2026 07:20

@dotlambda dotlambda left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

meta.sourceProvenance missing
separate commits please

Comment thread pkgs/development/python-modules/anki-audio/default.nix
@tomrfitz
tomrfitz force-pushed the anki-darwin-extra-wheels-upstream branch from 6ce397c to a5a997c Compare March 16, 2026 18:02
@nixpkgs-ci nixpkgs-ci Bot added the 8.has: package (new) This PR adds a new package label Mar 16, 2026
@tomrfitz
tomrfitz requested a review from dotlambda March 16, 2026 18:08
Comment thread pkgs/development/python-modules/anki-audio/default.nix Outdated
Comment thread pkgs/development/python-modules/anki-mac-helper/default.nix Outdated
Comment thread pkgs/development/python-modules/anki-mac-helper/default.nix Outdated
@tomrfitz
tomrfitz force-pushed the anki-darwin-extra-wheels-upstream branch from a5a997c to 3f2e481 Compare March 17, 2026 18:54
@tomrfitz

Copy link
Copy Markdown
Contributor Author

Pushed again with the two suggested changes:

  • anki-audio: use lib.getExe and ln -s instead of cp
  • anki-mac-helper: use "${finalAttrs.src.name}/ ..." instead of "source/ ..."

Open to feedback regarding where to pin anki-mac-helper.

@tomrfitz
tomrfitz requested a review from dotlambda March 17, 2026 19:13
@tomrfitz
tomrfitz force-pushed the anki-darwin-extra-wheels-upstream branch from 3f2e481 to 7c27d80 Compare March 17, 2026 22:29
wire newly added anki-audio and anki-mac-helper from python3Packages into
pythonDeps
@tomrfitz
tomrfitz force-pushed the anki-darwin-extra-wheels-upstream branch from 7c27d80 to 74db147 Compare March 18, 2026 02:11
@dotlambda
dotlambda added this pull request to the merge queue Mar 18, 2026
Merged via the queue into NixOS:master with commit a214160 Mar 18, 2026
27 of 31 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: darwin Running or building packages on Darwin 6.topic: python Python is a high-level, general-purpose programming language. 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 This PR causes between 1 and 10 packages to rebuild on Darwin. 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux. 12.approvals: 1 This PR was reviewed and approved by one person. 12.approved-by: package-maintainer This PR was reviewed and approved by a maintainer listed in any of the changed packages.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants