Skip to content
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

Define nixpkgs_unix_configure #95

Merged
merged 4 commits into from
Nov 13, 2019
Merged

Define nixpkgs_unix_configure #95

merged 4 commits into from
Nov 13, 2019

Conversation

aherrmann
Copy link
Member

Adds rules_sh support with nixpkgs_unix_configure, a macro to generate a Unix toolchain with commands provided by Nix.

  • Update Bazel to version 1.0.0
    rules_sh uses the configure attribute to repository_rule which was only introduced in Bazel 0.29.
  • Define nixpkgs constraint
    This is intended to move the nixpkgs platform constraint defined in rules_haskell into rules_nixpkgs so that it can be shared. It is used by nixpkgs_unix_configure in the exec_compatible_with attribute of the generated toolchain.
  • Define nixpkgs_unix_configure
    This uses rules_sh. However, users of rules_nixpkgs will only need to depend on rules_sh if they use this macro. Otherwise, rules_nixpkgs does not depend on rules_sh.
  • Add tests for nixpkgs_unix_configure
    This adds a dependency on rules_sh for the test-suite.

@aherrmann aherrmann requested a review from mboes October 31, 2019 12:19
@Profpatsch
Copy link
Contributor

Profpatsch commented Nov 4, 2019

Can I insist that you move the descriptions into the commit messages? :)

@aherrmann
Copy link
Member Author

Can I insist that you move the descriptions into the commit messages? :)

👍 Done

@mboes
Copy link
Member

mboes commented Nov 4, 2019

See tweag/rules_sh#1.

This uses `rules_sh`. However, users of `rules_nixpkgs` will only need
to depend on `rules_sh` if they use this macro. Otherwise,
`rules_nixpkgs` does not depend on `rules_sh`.
This adds a dependency on `rules_sh` for the test-suite.
@aherrmann
Copy link
Member Author

I've updated this PR to use the rules_sh release.

Copy link
Member

@mboes mboes left a comment

Choose a reason for hiding this comment

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

I think nixpkgs_sh_posix_configure would be clearer as the name of the repository rule, so that it lines up with sh_posix_configure (which has to be called too). But I can live the current name.

If Nixpkgs ever gets ported to windows, we could in principle have nixpkgs_sh_cmd_configure in the future.

@aherrmann
Copy link
Member Author

Sounds good, I've renamed everything accordingly.

@aherrmann aherrmann merged commit 9b47f4b into master Nov 13, 2019
@aherrmann aherrmann deleted the rules_sh branch November 13, 2019 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants