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

gns3: Fix python package not being pinned #77701

Merged
merged 2 commits into from
Jan 17, 2020
Merged

Conversation

Alan01252
Copy link
Contributor

@Alan01252 Alan01252 commented Jan 14, 2020

Due to #44426 the correct psutils
package is not picked up, this commit changes the code so the correct
version is always picked

Things done
  • Tested using sandboxing (nix.useSandbox on NixOS, or option sandbox in nix.conf on non-NixOS linux)
  • Built on platform(s)
    • [x ] 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"
  • [x ] 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
  • [ x] Fits CONTRIBUTING.md.

Sorry, something went wrong.

Due to NixOS#44426 the correct psutils
package is not picked up, this commit changes the code so the correct
version is always picked.
@Alan01252 Alan01252 requested a review from primeos January 14, 2020 21:42
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 labels Jan 14, 2020
@Alan01252
Copy link
Contributor Author

Thank you :) I learnt a lot from your commit! :)

Copy link
Member

@primeos primeos left a comment

Choose a reason for hiding this comment

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

Hey @Alan01252 thanks for your PR :)

I've added an extra commit (will be squashed before merging) that tries to get rid of some redundancy (though not all of it, atm it would also make sense to move defaultOverrides into default.nix but I'm not sure if this will always be the case). I also took care of some minor style and copy&paste issues.

I've dropped the aiohttp pinning as I couldn't reproduce any issues. Does your overlay also override aiohttp or are you using a different channel? On the most recent nixos-unstable channel I currently get the expected version:

$ nix-build -A python3Packages.aiohttp
/nix/store/xw8zl3qcl8zha6wi7fns5rzmz2p1mqim-python3.7-aiohttp-3.6.2

@Alan01252
Copy link
Contributor Author

I'm using stable and just had this as an override which is why I had to pin aiohttp, and copy that config over from the latest unstable to get it to build on my machine.

Trying to upgrade just aiohttp package from unstable and get it working with this code warped my mind a little bit and I wasn't able to figure it out.

@ofborg ofborg bot added 10.rebuild-linux: 0 This PR does not cause any packages to rebuild on Linux and removed 10.rebuild-linux: 1-10 labels Jan 17, 2020
@primeos
Copy link
Member

primeos commented Jan 17, 2020

@Alan01252 ok, I see. I suggest that we drop the aiohttp pinning then as this will probably quickly become too difficult to maintain as the stable and unstable branches diverge further (in the worst case we would have to pin every dependency). It would be nice to have but generally I try to avoid all overrides that are not necessary (I'd actually like to avoid the psutil and jsonschema overrides as well, but in the past I often had bad luck (bugs) when ignoring the version constraints from upstream). But at the same time I agree that this could be useful to have.

As for your use-case: If you use channels you could try something like this in your NixOS configuration (untested but looks fine - source):

{ config, pkgs, ... }:
let
  unstable = import <nixos-unstable> {};
in {
  environment.systemPackages = [ unstable.packagehere ];
}

Or if you use a local git checkout the following should work:

{ config, pkgs, ... }:
let
  unstable = import /path/to/nixpkgs {};
in {
  environment.systemPackages = [ unstable.packagehere ]; # Or maybe unstable.pkgs.packagehere
}

Maybe also interesting (but most likely without the allowUnfree = true; example): https://nixos.wiki/wiki/Cheatsheet#Customizing_Packages

With nix-shell and nix-env this is possible as well (I can also post an example if you want).

Hope this helps.

Copy link
Member

@primeos primeos left a comment

Choose a reason for hiding this comment

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

The current state LGTM, so I'll already merge it, but of course I'm still open to discussing additional changes, if you want to change something else (e.g. regarding the aiohttp pining) ;)

Anyway, thanks for the PR :) The current pinning should now work as expected when using overlays.

@primeos primeos merged commit 4f4d792 into NixOS:master Jan 17, 2020
@Alan01252
Copy link
Contributor Author

No this is great thank you. The problem I was having is I wanted "stable" python but "unstable" aiohttp and that combination I just could not figure out. I should probably just move to unstable python.
I should also mention to get ubridge to work proplerly with gns3 ( using local server ) I had to make sure that all the executables were started in the same directory so I've got this.

`
security.wrappers.gns3 = {
source = "${pkgs.myGns3.guiStable.out}/bin/gns3";
owner = "nobody";
group = "nogroup";
};

security.wrappers.gns3server = {
source = "${pkgs.myGns3.serverStable.out}/bin/gns3server";
owner = "nobody";
group = "nogroup";
};

security.wrappers.ubridge = {
source = "${pkgs.ubridge.out}/bin/ubridge";
owner = "nobody";
group = "nogroup";
capabilities = "cap_net_admin,cap_net_raw+ep";
};

In my configuration to make this work

@Janik-Haag Janik-Haag added the 12. first-time contribution This PR is the author's first one; please be gentle! label Jun 12, 2023
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: 0 This PR does not cause any packages to rebuild on Linux 12. first-time contribution This PR is the author's first one; please be gentle!
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants