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 1 for backwards compatibility #81033

Merged
merged 1 commit into from Mar 2, 2020
Merged

Conversation

mjlbach
Copy link
Contributor

@mjlbach mjlbach commented Feb 25, 2020

Motivation for this change

Certain packages such as tensorflow build with older versions of bazel, this creates a selectable version bazel derivation. See #80970. I'm sure this could be cleaned up, so I welcome any feedback.

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • 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 nixpkgs-review --run "nixpkgs-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Determined the impact on package closure size (by running nix path-info -S before and after)
  • Ensured that relevant documentation is up to date
  • Fits CONTRIBUTING.md.

@mjlbach mjlbach changed the title Add bazel 1 for backwards compatibilitiy Add bazel 1 for backwards compatibility Feb 25, 2020
@ofborg ofborg bot requested a review from mboes February 25, 2020 16:13
Copy link
Member

@andir andir left a comment

Choose a reason for hiding this comment

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

I did a first review of this. There are a few things that we might want to adjust to make it more future proof (e.g. me adding bazel 0.25 right after this goes in).

Also we will have to squash and reword most of the commits to make them fit our contribution guide.

pkgs/development/tools/build-managers/bazel/common.nix Outdated Show resolved Hide resolved
pkgs/development/tools/build-managers/bazel/common.nix Outdated Show resolved Hide resolved
pkgs/development/tools/build-managers/bazel/common.nix Outdated Show resolved Hide resolved
pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
pkgs/development/tools/build-managers/bazel/common.nix Outdated Show resolved Hide resolved
@mjlbach
Copy link
Contributor Author

mjlbach commented Feb 26, 2020

@andir Thanks for the review, still very new :) I'll squash my commits and clean up the message prior to its merge. I took care of the simpler things you suggested, and left some comments.

@FRidh
Copy link
Member

FRidh commented Feb 26, 2020

Just duplicate the whole expression instead of factoring out a common part. The expression for Bazel 2 should be able to move freely, and 1 should remain stable.

@mjlbach
Copy link
Contributor Author

mjlbach commented Feb 26, 2020

@FRidh Would you want a separate subdirectory within pkgs/development/tools/build-managers/bazel for each bazel? Do we share patches?

@mjlbach
Copy link
Contributor Author

mjlbach commented Feb 26, 2020

@FRidh here is my first crack at it https://github.com/mjlbach/nixpkgs/tree/bazel_separate_branches

I was also thinking of creating a patch folder, or I can duplicate all of the patches for each version and put them in each folder...

Happy to close and submit and alternate PR if that is what's best.

@FRidh
Copy link
Member

FRidh commented Feb 26, 2020

I suggest calling the folder bazel 1 so there is no need to rename in case of a patch release.

@FRidh
Copy link
Member

FRidh commented Feb 26, 2020

You can just push to this branch/PR.

@mjlbach mjlbach force-pushed the bazel_1 branch 2 times, most recently from 41cfc75 to e6a323b Compare February 26, 2020 12:28
@mjlbach
Copy link
Contributor Author

mjlbach commented Feb 26, 2020

@FRidh done and commits squashed.

@andir
Copy link
Member

andir commented Feb 26, 2020

Testing this in combination with #80970. Will report back once TF finished compiling.

@andir
Copy link
Member

andir commented Feb 26, 2020

TF did build (without CUDA; cuda build still running). It appears to be at least as function as before (still hitting #48902, so likely requires more work on my side to fix that).

@mjlbach mjlbach force-pushed the bazel_1 branch 2 times, most recently from d5742b6 to 13ad0fb Compare February 26, 2020 16:22
@mjlbach
Copy link
Contributor Author

mjlbach commented Feb 26, 2020

Is there anything else necessary for this PR?

@andir
Copy link
Member

andir commented Feb 26, 2020 via email

@mjlbach
Copy link
Contributor Author

mjlbach commented Feb 26, 2020

Thank you for the guidance :)

@Profpatsch
Copy link
Member

It looks fine to me.

Usually I’m all for deduplication, but for these old version the main use case is being able to delete them very easily in the future, without creating dead code paths (or complications) in the current version. So yeah, whenever we update a major version let’s just copy the old one to a subdirectory, reference it from outside and be done with it.

3 similar comments
@Profpatsch
Copy link
Member

It looks fine to me.

Usually I’m all for deduplication, but for these old version the main use case is being able to delete them very easily in the future, without creating dead code paths (or complications) in the current version. So yeah, whenever we update a major version let’s just copy the old one to a subdirectory, reference it from outside and be done with it.

@Profpatsch
Copy link
Member

It looks fine to me.

Usually I’m all for deduplication, but for these old version the main use case is being able to delete them very easily in the future, without creating dead code paths (or complications) in the current version. So yeah, whenever we update a major version let’s just copy the old one to a subdirectory, reference it from outside and be done with it.

@Profpatsch
Copy link
Member

It looks fine to me.

Usually I’m all for deduplication, but for these old version the main use case is being able to delete them very easily in the future, without creating dead code paths (or complications) in the current version. So yeah, whenever we update a major version let’s just copy the old one to a subdirectory, reference it from outside and be done with it.

@mjlbach
Copy link
Contributor Author

mjlbach commented Feb 29, 2020

Ready for final review

@andir
Copy link
Member

andir commented Mar 1, 2020

@mjlbach Can you rebase this on master? It seems that #80739 go into our way :-)

@mjlbach
Copy link
Contributor Author

mjlbach commented Mar 1, 2020

@andir done!

@andir
Copy link
Member

andir commented Mar 1, 2020

@GrahamcOfBorg build gvisor
@GrahamcOfBorg build bazel_1

@mjlbach
Copy link
Contributor Author

mjlbach commented Mar 1, 2020

*renamed it to bazel-1

@FRidh
Copy link
Member

FRidh commented Mar 1, 2020

Why the rename? Versioned packages ought to be named with underscores preceding their major/minor numbers.

@mjlbach
Copy link
Contributor Author

mjlbach commented Mar 1, 2020

I was making it consistent with the directory structure/didn't realize that was the trend. I reverted it.

@Profpatsch
Copy link
Member

@GrahamcOfBorg build gvisor
@GrahamcOfBorg build bazel_1

@Profpatsch
Copy link
Member

I think the bazel version before the update to 2.0 was succeeding on darwin, is this the same?

@mjlbach
Copy link
Contributor Author

mjlbach commented Mar 2, 2020

I just backported changes from https://github.com/NixOS/nixpkgs/pull/80635/files which should fix the build on darwin. Testing now.

@mjlbach
Copy link
Contributor Author

mjlbach commented Mar 2, 2020

@Profpatsch the latest builds on darwin

@FRidh FRidh merged commit 1c4f22a into NixOS:master Mar 2, 2020
@mjlbach mjlbach mentioned this pull request Mar 2, 2020
10 tasks
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

4 participants