Skip to content

Conversation

trofi
Copy link
Contributor

@trofi trofi commented Jun 23, 2022

Without the change build with config.configurePlatformsByDefault = true
fails as:

Error: Unknown flag: --build=x86_64-unknown-linux-gnu
Description of changes
Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • 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/)
  • 22.11 Release Notes (or backporting 22.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
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

Without the change build with `config.configurePlatformsByDefault = true`
fails as:

    Error: Unknown flag: --build=x86_64-unknown-linux-gnu
@ofborg ofborg bot requested review from 7c6f434c and teto June 23, 2022 09:34
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 501-1000 This PR causes many rebuilds on Darwin and should normally 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. labels Jun 23, 2022
@teto
Copy link
Member

teto commented Jun 23, 2022

I dont know about this option I suspect it's about cross-platform compilation (EDIT: I see the issue you linked).
Would it be interesting to modify upstream to accept the flag instead (doesn't seem like it would) ? having to add configurePlatforms = [ ]; to this many packages kinda feels off.

@trofi
Copy link
Contributor Author

trofi commented Jun 23, 2022

It's a good question.

Generally presence of ./configure implies autoconf-compatible script: options like --prefix= and --sysconfdir= (present in luarocks) and --build= / --host= / --target= (missing in luarocks). I would say it's relatively rare not to support these options, but it does happen (ffmpeg or perl are good examples). Thus sprinkling configurePlatforms = [ ]; around does not seem to be widespread (so far).

Adding --build= / --host= / --target= should be fine. My only mild worry is that these options might be complete no-ops: luarocks seems to only install .lua and .shell files (but also runs a lua interpreter).

@7c6f434c
Copy link
Member

There has to be a rock that compiles a native library I guess? We can see how this looks like in the wild, maybe

@teto
Copy link
Member

teto commented Jun 27, 2022

some rockspecs build C libraries via make or cmake e.g. https://luarocks.org/modules/xpol/rapidjson/0.7.1-1 so if luarocks could forward these flags, it may be useful ?
Note that for the cmake libraries, it's best to build them via nix rather than via luarocks and then tell the lua library to use the nix library (it is recommended by the luarocks author too)

@Mindavi Mindavi added the 6.topic: cross-compilation Building packages on a different platform than they will be used on label Jun 27, 2022
@7c6f434c 7c6f434c merged commit 4090c10 into NixOS:staging Jul 1, 2022
@7c6f434c
Copy link
Member

7c6f434c commented Jul 1, 2022

But yeah, would be nice to see if stuff like rapidjson can be cross-compiled with Nixpkgs

@trofi trofi deleted the configurePlatform-luarocks branch July 1, 2022 17:14
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 10.rebuild-darwin: 501-1000 This PR causes many rebuilds on Darwin 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: 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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants