Skip to content

cannot use .pkgs of pythons provided here #14

Closed

Description

@permahorse

I'm not sure if using .pkgs.something is intended with these pythons,
but i'm surely getting a strange error:

error: builder for '/nix/store/jwc3cbbp74lc3krq8ilkhgd7izg8bdxd-Python-3.8.17.tar.xz.drv' failed with exit code 1;
       last 10 log lines:
       >   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
       >                                  Dload  Upload   Total   Spent    Left  Speed
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: www.python.org
       > Warning: Problem : timeout. Will retry in 1 seconds. 3 retries left.
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: www.python.org
       > Warning: Problem : timeout. Will retry in 2 seconds. 2 retries left.
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: www.python.org
       > Warning: Problem : timeout. Will retry in 4 seconds. 1 retries left.
       >   0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0curl: (6) Could not resolve host: www.python.org
       > error: cannot download Python-3.8.17.tar.xz from any mirror
       For full logs, run 'nix log /nix/store/jwc3cbbp74lc3krq8ilkhgd7izg8bdxd-Python-3.8.17.tar.xz.drv'.
error: 1 dependencies of derivation '/nix/store/idxlik38iac33hicidlf7qhjc4nn494m-python3-3.8.17.drv' failed to build
error: 1 dependencies of derivation '/nix/store/ppgrg13rqs00lsh6mphrhx9nlknq770m-wrap-python-hook.drv' failed to build
error: 1 dependencies of derivation '/nix/store/2lpg8ysd173ifdrbmsd26lrxnkkyqdhj-nix-shell-env.drv' failed to build

to reproduce - just add python.pkgs.wrapPython to buildInputs of a shell (or any derivation),
for example:

{
  inputs = {
    nixpkgs.url = "github:NixOS/nixpkgs";
    nixpython = {
      url = "github:cachix/nixpkgs-python";
      inputs.nixpkgs.follows = "nixpkgs";
    };
  };
  outputs = { self, nixpkgs, nixpython }:
  let
    pkgs = nixpkgs.legacyPackages.x86_64-linux;
    python = nixpython.packages.x86_64-linux."3.8";
  in {
    packages.x86_64-linux = rec {
      py = python;
      test_python = pkgs.mkShell {
        buildInputs = [
          python.pkgs.wrapPython
        ];
      };
    };
  };
}

and do nix build .#test_python
while nix build .#py works fine and builds python from source
or removing .pkgs.wrapPython and leaving just python in buildInputs works fine too

I'm relatively new to the whole nix thing, so I have no idea if I'm doing something wrong

It does seem that for some reason it tries to build python38 again, even if i have just built it separately... and it has no network while trying to fetch sources, as if it was called from within build sandbox, but how is this possible??

P.S. my network is fine, i can access the url it tries to fetch, and i can build python38 from this repository from source without any issues

Activity

  1. mcdonc commented on Jul 29, 2023

    @mcdonc

    FTR, this also happens when using one inside environment.systemPackages:

    environment.systemPackages = with pkgs; [
      pkgs.allthepythons.packages.x86_64-linux."3.9.16"
    ....
    

    Where "allthepythons" is an overlay within a flake:

    overlay-nixpkgs-python = final: prev: {
        allthepythons = import nixpkgs-python;
      };
    
  2. domenkozar commented on Oct 3, 2023

    @domenkozar
    Member

    For some reason it uses .xz in the url, while it should be https://www.python.org/ftp/python/3.8.18/Python-3.8.18.tgz.

    This means something is wrong how overrides are applied, it's not passing the correct hash and the url.

  3. domenkozar commented on Jan 11, 2024

    @domenkozar
    Member

    Should be fixed on main, can you try?

  4. domenkozar commented on Feb 5, 2024

    @domenkozar
    Member

    It works now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions