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

use latest protobuf (3.12), remove overrides where possible #91446

Merged
merged 5 commits into from Jul 26, 2020

Conversation

prusnak
Copy link
Member

@prusnak prusnak commented Jun 24, 2020

Motivation for this change

The goal of this PR is to set protobuf to the latest available version (currently 3.12) and remove all protobuf overrides where possible. Some of the changes are possible when a package is updated to more recent version, so this PR contains a couple of version updates (in separate commits) too.

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.

Copy link
Contributor

@andersk andersk left a comment

Choose a reason for hiding this comment

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

or-tools looks good. Upstream wants 3.12.2, I’m sure 3.12.3 is fine.

I’m somewhat worried that future or-tools versions may require newer protobuf than our default protobuf again, but if we’re planning to keep the default protobuf up to date now, that shouldn’t be an issue.

@marsam
Copy link
Contributor

marsam commented Jun 25, 2020

IIRC tensorflow requires 3.8 #87014 (comment) cc: @bhipple

Copy link
Contributor

@rnhmjoj rnhmjoj left a comment

Choose a reason for hiding this comment

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

It seems the override is not needed anymore for monero. Just tested and monero{,-gui} builds and runs fine.

pkgs/top-level/all-packages.nix Outdated Show resolved Hide resolved
pkgs/development/python-modules/aioesphomeapi/default.nix Outdated Show resolved Hide resolved
@prusnak
Copy link
Member Author

prusnak commented Jun 25, 2020

@dotlambda If you don't have to experiment with home-assistant/esphome/aioesphomeapi changes now, I can remove changes to these packages from this PR and will extract them to a separate PR. Just let me know.

@dotlambda
Copy link
Member

I can remove changes to these packages from this PR and will extract them to a separate PR.

Please do so. Home Assistant is quite fragile when it comes to its dependencies' versions.

@prusnak
Copy link
Member Author

prusnak commented Jun 25, 2020

Please do so. Home Assistant is quite fragile when it comes to its dependencies' versions.

OK, removed changes to Home Assistant and its dependencies from this PR. We can discuss this in one of the subsequent PRs.

@ofborg ofborg bot requested review from andersk and rnhmjoj June 25, 2020 10:26
@drewrisinger
Copy link
Contributor

@GrahamcOfBorg build python38Packages.cirq python37Packages.cirq

Copy link
Contributor

@drewrisinger drewrisinger left a comment

Choose a reason for hiding this comment

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

Diff on python-packages.nix & cirq.nix LGTM as maintainer. Builds clean via OfBorg

@prusnak
Copy link
Member Author

prusnak commented Jun 27, 2020

@FRidh or should this go to staging first?

@prusnak prusnak requested a review from marsam July 1, 2020 14:12
@@ -5212,7 +5210,7 @@ in {
protobuf = callPackage ../development/python-modules/protobuf {
disabled = isPyPy;
doCheck = !isPy3k;
protobuf = pkgs.protobuf3_8;
protobuf = pkgs.protobuf3_12;
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this was added for tensorflow, because it requires protobuf==3.8 #81278 tensorflow/tensorflow#35573
Could you please add an override for tensorflow to use protobuf3_8?

Copy link
Member

Choose a reason for hiding this comment

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

That's not ok because then one can get a closure with multiple versions of the protobuf package. This is unsolvable with Python and a reason why we do not always use the latest version of libraries but instead versions that keep most things working.

Copy link
Member Author

Choose a reason for hiding this comment

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

I understand the reason, but this makes it impossible to package software that requires newer python-protobuf into nixpkgs.

Copy link
Member

Choose a reason for hiding this comment

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

Yes, in case of libraries, you are correct. We need to balance this. Thus, that also means, if one or a few packages are extremely slow updating, we may need to reconsider whether they should be part of Nixpkgs.

Copy link
Contributor

Choose a reason for hiding this comment

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

TensorFlow requires protobuf >= 3.8.0, not ==.

#81278 bumped this line from 3.7 to 3.8, but doesn’t seem to indicate that a later version wouldn’t have worked. tensorflow/tensorflow#35573 appears to be an issue with a specific binary distribution.

I see no reason to think it wouldn’t work if everything consistently used the current stable version. Why not protobuf = pkgs.protobuf?

Copy link
Contributor

Choose a reason for hiding this comment

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

I see no reason to think it wouldn’t work if everything consistently used the current stable version. Why not protobuf = pkgs.protobuf?

That sounds good to me. Care to send a PR trying that for tensorflow?

Copy link
Contributor

@andersk andersk Jul 5, 2020

Choose a reason for hiding this comment

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

@bhipple It would have no effect without this PR, because we still have pkgs.protobuf = pkgs.protobuf3_8 in master.

Copy link
Member Author

@prusnak prusnak Jul 5, 2020

Choose a reason for hiding this comment

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

My take is: let's get this into master/staging and fix breakages that might happen. If there are breakages, these should be fixed in upstream, but we'll never discover them if we stick to the old version of protobuf.

@1000101
Copy link
Member

1000101 commented Jul 13, 2020

Is there any update on this PR? I've just stumbled upon another case where a package can't be upgraded because of old protobuf version.

@prusnak
Copy link
Member Author

prusnak commented Jul 13, 2020

I did my best here, but the discussion has stalled. I am still in favor of merging this and fixing all potential breakages. I will happily rebase this PR to staging if that's preferred.

@prusnak
Copy link
Member Author

prusnak commented Jul 16, 2020

Another PR which needs the latest protobuf: #93231

@prusnak prusnak mentioned this pull request Jul 16, 2020
10 tasks
@drewrisinger
Copy link
Contributor

I don't know how the staging pipeline works, but that sounds like a decent idea to me. Some things will probably break, but protobuf needs updated.

@bhipple
Copy link
Contributor

bhipple commented Jul 16, 2020

I'm in favor of merging as long as we can unpin tensorflow to use the latest protobuf consistently with the python libs. It looks like the bound on 3.8 is just a lower bound, so let's go for it?

@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/prs-ready-for-review/3032/229

@prusnak prusnak changed the base branch from master to staging July 26, 2020 13:11
@prusnak
Copy link
Member Author

prusnak commented Jul 26, 2020

Changed the target branch to staging.

@ofborg ofborg bot requested a review from drewrisinger July 26, 2020 13:45
@FRidh FRidh merged commit d9da3e3 into NixOS:staging Jul 26, 2020
@prusnak prusnak deleted the protobuf-latest branch July 26, 2020 18:15
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

10 participants