-
-
Notifications
You must be signed in to change notification settings - Fork 13.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
buildHarePackage: init #294881
buildHarePackage: init #294881
Conversation
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/buildharepackage-looking-for-feedback/41189/1 |
Pinging Hare package maintainers for feedback: @starzation, @uninsane, @patwid and @auchter. |
d8cdbbb
to
5a3b846
Compare
if the same goal here can be achieved via a setup hook, i would prefer that. it's also pretty tough to get a anyway, i'm sure there's been more detailed discussion around what i just wrote before in nixpkgs, but i don't know where that would be :( the closest i could find is this discussion when zig was considering a |
Good point, @uninsane. After reading it, it does make a lot more sense to have a setup hook, since Hare builds do not deviate that much from what I'll try to come up also with a hook and see what the other maintainers think about it. When we are ready to decide on which one, I'll rebase and remove the not chosen option. |
5a3b846
to
bc00000
Compare
@uninsane, I've created a hare.hook PR. I've based its implementation on zig's. As of now, I'm unable to cross-compile, but both |
Moreover, for everybody on this PR, do you think it would be better to create an issue regarding both PRs? By doing so, I think it would be easier to keep track of them until the final decision is made. |
@onemoresuza Maybe it would be a good idea to create a new issue. |
Closing this PR, since the decision was made for a |
Description of changes
The
buildHarePackage
gets rid of boilerplate code for Hare packages:HARECACHE
;PREFIX
;-qRa<arch>
hare flags.-a${stdenv.hostPlatform.uname.processor}
, the derivation needsto do nothing else for the package to cross-compile.
It, however, relies on the existence of the
HAREFLAGS
make or environmentvariable. Thus, if not yet present on the project, the derivation must patch it.
This is behavior goes hand in hand with
Hare
's project structure described in its documentation.Do note that
HARECACHE
,PREFIX
andHAREFLAGS
are set both as make flags andas environment variables, so that it may be accessed by other build systems, e. g.,
haredo
.I've only changed
haredo
andhareThirdParty.hare-toml
to make use ofbuildHarePackage
because I am their maintainer and we have with them bothexamples of a Hare package: a program, the former, and a library, the latter.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.