Skip to content

buildLuarocksPackage: fix cross compilation wrapping#481511

Merged
teto merged 2 commits intoNixOS:stagingfrom
doronbehar:pkg/wrapLua@cross
Mar 12, 2026
Merged

buildLuarocksPackage: fix cross compilation wrapping#481511
teto merged 2 commits intoNixOS:stagingfrom
doronbehar:pkg/wrapLua@cross

Conversation

@doronbehar
Copy link
Contributor

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.

@doronbehar doronbehar requested a review from Artturin January 19, 2026 03:11
@doronbehar doronbehar changed the title luaPackages.wrapLua: fix makeWrapper to wrap with host bash luaPackages: crucial cross compilation fixes Jan 19, 2026
@ofborg ofborg bot added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Jan 19, 2026
@nixpkgs-ci nixpkgs-ci bot added 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should target the staging branches. 10.rebuild-darwin: 1001-2500 This PR causes many rebuilds on Darwin and should most likely target the staging branches. 6.topic: lua Lua is a powerful, efficient, lightweight, embeddable scripting language. labels Jan 19, 2026
github-actions[bot]

This comment was marked as outdated.

@doronbehar doronbehar requested a review from teto January 25, 2026 19:42
@doronbehar doronbehar changed the base branch from master to staging January 25, 2026 22:09
@nixpkgs-ci nixpkgs-ci bot closed this Jan 25, 2026
@nixpkgs-ci nixpkgs-ci bot reopened this Jan 25, 2026
@doronbehar doronbehar marked this pull request as ready for review January 25, 2026 22:09
@github-actions github-actions bot dismissed their stale review January 25, 2026 22:10

Review dismissed automatically

@khaneliman
Copy link
Contributor

@teto any opinions on approach ?

@doronbehar doronbehar changed the title luaPackages: crucial cross compilation fixes buildLuarocksPackage: fix cross compilation wrapping Feb 4, 2026
@doronbehar doronbehar marked this pull request as draft February 4, 2026 16:51
@doronbehar doronbehar marked this pull request as ready for review February 22, 2026 10:48
@doronbehar
Copy link
Contributor Author

OK so I found time to fix this properly and test it! @Artturin the changes I perform here are sort of overriding your changes here:

Please if you could give your opinion on this it will be deeply appreciated 🙏.

patchShebangs already takes care of this automatically and does it well,
before this hook runs.
@doronbehar doronbehar marked this pull request as draft March 9, 2026 15:37
- Make `lua` gain `luaOnBuildFor{Build,Host,Target}` and alike attributes.
- wrapLua: correctly substitute build & host lua & luarocks_bootstrap
- Disallow build platform references when using `buildLuarocksPackage`
  in cross building.
@doronbehar
Copy link
Contributor Author

Tested that these build properly:

nix build -Lf. pkgsCross.armv7l-hf-multiplatform.lua54Packages.cjson lua54Packages.tree-sitter-http

Let me know please if you can think of other edge cases that will challenge the changes made here.

@doronbehar doronbehar marked this pull request as ready for review March 9, 2026 16:40
@doronbehar doronbehar requested a review from Artturin March 9, 2026 16:40
@nixpkgs-ci nixpkgs-ci bot added the 12.approvals: 1 This PR was reviewed and approved by one person. label Mar 11, 2026
@teto teto added this pull request to the merge queue Mar 12, 2026
Merged via the queue into NixOS:staging with commit ca45c71 Mar 12, 2026
30 of 32 checks passed
@doronbehar
Copy link
Contributor Author

doronbehar commented Mar 13, 2026 via email

vcunat pushed a commit that referenced this pull request Mar 13, 2026
(cherry picked from commit ca45c71)
It looks like the rebuild costs won't be high really.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: cross-compilation Building packages on a different platform than they will be used on 6.topic: lua Lua is a powerful, efficient, lightweight, embeddable scripting language. 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 1001-2500 This PR causes many rebuilds on Darwin and should most likely target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 1001-2500 This PR causes many rebuilds on Linux and should 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.

4 participants