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

home-assistant: relax dependencies #147483

Merged
merged 1 commit into from
Nov 27, 2021
Merged

Conversation

mweinelt
Copy link
Member

@mweinelt mweinelt commented Nov 26, 2021

Motivation for this change
  • Relaxes a few dependency constraints to fix nixosTests.home-assistant.
  • home-assistant itself is broken by aiopvapi @fabaff

Meh. Not sure if this is possible to fix on master...

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 21.11 Release Notes (or backporting 21.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
    • (Release notes changes) Ran nixos/doc/manual/md-to-db.sh to update generated release notes
  • Fits CONTRIBUTING.md.

@mweinelt mweinelt requested review from fabaff and dotlambda November 26, 2021 11:23
@mweinelt mweinelt marked this pull request as ready for review November 26, 2021 11:23
@ofborg ofborg bot requested review from globin and Mic92 November 26, 2021 11:35
@ofborg ofborg bot added 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 labels Nov 26, 2021
@fabaff
Copy link
Member

fabaff commented Nov 26, 2021

Meh. Not sure if this is possible to fix on master...

Me neither. For now, I'm working on fixing the deps which were affected by async_timeout-4.0.1 and aiohttp-3.8.0. I had to push back httpx>0.2x.x. as there is an overlap with aiohttp/async_timeout.

There is a big chance that we need a couple of new overrides for 2021.12.x. I will get to that if I have a "base line" established.

Comment on lines 181 to +188
substituteInPlace setup.py \
--replace "async_timeout==3.0.1" "async_timeout" \
--replace "awesomeversion==21.10.1" "awesomeversion" \
--replace "aiohttp==3.7.4.post0" "aiohttp" \
--replace "bcrypt==3.1.7" "bcrypt" \
--replace "pip>=8.0.3,<20.3" "pip" \
--replace "pyyaml==6.0" "pyyaml" \
--replace "yarl==1.6.3" "yarl==1.7.0"
--replace "yarl==1.6.3" "yarl"
Copy link
Contributor

Choose a reason for hiding this comment

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

This is just me thinking loudly here, but maybe we could have a function to relax Python dependencies (or even something that is part of buildPython{Module,Application}) since this is a pretty common pattern in nixpkgs 🤔 ?

Something like:

relaxSetuppyDependencies = [
  "async_timeout"
  "awesomeversion"
  ...
];

Copy link
Member Author

Choose a reason for hiding this comment

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

Sometimes they're in setup.py, sometimes in setup.cfg, sometimes sourced from requirements.txt or worse from python code somewhere in the repository, in newer projects in pyproject.toml and other files. It's a good idea, but gets hairy fast.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, but we could have something generic since they pretty much use the same syntax to declare its values. Maybe as a function available to Python derivations like we already have the substituteInPlace, so we could have maybe relaxPythonDependencies setup.cfg ... instead.

Copy link
Contributor

Choose a reason for hiding this comment

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

And of course, you can still use substituteInPlace or even sed if necessary for those more strange cases.

@@ -179,10 +179,13 @@ in with py.pkgs; buildPythonApplication rec {

postPatch = ''
substituteInPlace setup.py \
--replace "async_timeout==3.0.1" "async_timeout" \
Copy link
Member

Choose a reason for hiding this comment

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

Looks very similar to my fix: Mic92@4bc1481

@mweinelt mweinelt merged commit e2730a7 into NixOS:master Nov 27, 2021
@mweinelt mweinelt deleted the relax-my-hass branch November 28, 2021 22:46
@Lahvuun
Copy link

Lahvuun commented Dec 2, 2021

I'm running nixos-21.11 on aarch64 and home-assistant doesn't build without the changes in this PR because it there is no aiohttp-3.7.4.post0

Is it possible to merge this into 21.11?

@mweinelt
Copy link
Member Author

mweinelt commented Dec 2, 2021

I can look into that in a bit. In the meanwhile please check out https://nixos.wiki/wiki/Home_Assistant#Running_a_recent_version_using_an_overlay, because we cannot update home-assistant on release branches.

@mweinelt
Copy link
Member Author

mweinelt commented Dec 2, 2021

Sorry, the async_timeout fallout radius is too big and I think it shouldn't have landed before the branch-off. @dotlambda

Basically I'd need to update home-assistant dependencies to work with async_timeout>=4.0 but then the dependencies are too new for home-assistant itself.

@dotlambda
Copy link
Member

Sorry, the async_timeout fallout radius is too big and I think it shouldn't have landed before the branch-off.

Sorry for that.

I don't think reverting #145602 is an option either, so I suggest we mark home-assistant as broken. It would be nice if we could make the error message refer people to the wiki.

@dotlambda
Copy link
Member

Maybe we can, within home-assistant, override aiohttp and async_timeout to make it work again? #148242

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants