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

Add Bazel buildtools #41194

Merged
merged 1 commit into from Jun 8, 2018
Merged

Add Bazel buildtools #41194

merged 1 commit into from Jun 8, 2018

Conversation

uri-canva
Copy link
Contributor

@uri-canva uri-canva commented May 29, 2018

Motivation for this change

Adds three new derivations for https://github.com/bazelbuild/buildtools .

These are added as three completely separate derivations, even though they're all carbon copies of each other, because the three are independent, so they can be updated independently, and in fact in some cases will have to be updated independently, as a certain version of one of the tools might be incompatible with the other tools built on the same commit.

Still the repetition is pretty ugly, so I'm open to suggestions on how to refactor it.

Also open to suggestions on what the commit message should be, as I don't think the one I've put now is quite in line with the guidelines.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option build-use-sandbox in nix.conf on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • other Linux distributions
  • Tested via one or more NixOS test(s) if existing and applicable for the change (look inside nixos/tests)
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.

@uri-canva
Copy link
Contributor Author

Sorry, I had rebased it onto channels/nixpkgs-18.03-darwin so I could build it from cache, and it added a bunch of reviewers, and I can't remove them.

Copy link
Member

@Mic92 Mic92 left a comment

Choose a reason for hiding this comment

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

The rest is fine. I tested the package


buildGoPackage rec {
name = "buildifier";
version = "588d90030bc8054b550967aa45a8a8d170deba0b";
Copy link
Member

Choose a reason for hiding this comment

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

Please you day of commit as version, because this can be numerical sorted (needed for nix-env) and is human-readable. rev then will be the sha256


buildGoPackage rec {
name = "buildozer";
version = "588d90030bc8054b550967aa45a8a8d170deba0b";
Copy link
Member

Choose a reason for hiding this comment

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

here too.


buildGoPackage rec {
name = "unused_deps";
version = "588d90030bc8054b550967aa45a8a8d170deba0b";
Copy link
Member

Choose a reason for hiding this comment

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

here too.

@Mic92
Copy link
Member

Mic92 commented May 29, 2018

Please also make one commit per package:

buildifier: init at <version>
buildozer: init at <version>
...

repo = "buildtools";
rev = "${version}";
sha256 = "18q1z138545kh4s5k0jcqwhpzc1w7il4x00l7yzv9wq8bg1vn1rv";
};
Copy link
Member

Choose a reason for hiding this comment

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

You can reuse the source here:

inherit (buildifier) src;

version = "588d90030bc8054b550967aa45a8a8d170deba0b";

goPackagePath = "github.com/bazelbuild/buildtools";
subPackages = [ "buildifier" ];
Copy link
Member

Choose a reason for hiding this comment

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

Or is it possible to build multiple subPackages in one go?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it's possible, but then it wouldn't be possible to choose the tools to instantiate individually. Is that ok?

Copy link
Member

Choose a reason for hiding this comment

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

Could be solved by outputs. If someone needs this, this can be implemented on demand.

@uri-canva
Copy link
Contributor Author

One single derivation now. I still added separate attributes to pkgs for each tool so that they can be found easily with nix-env -qa and such.

@uri-canva
Copy link
Contributor Author

@Mic92 ping

@Mic92 Mic92 merged commit 7212a6c into NixOS:master Jun 8, 2018
@uri-canva uri-canva deleted the bazel-buildtools branch June 17, 2018 05:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants