Skip to content

'#' in file path causing pip compilation issues (FreeBSD) #118

@bikingcoder

Description

@bikingcoder

Hi, I can't build a Python pex file on FreeBSD because pip is unable to compile the pynacl library (in fact the libsodium dependency). The error can be reproduced quite simply:

vagrant@freebsd:~ % ls
libsodium-1.0.18-stable.tar.gz
vagrant@freebsd:~ % tar -xf libsodium-1.0.18-stable.tar.gz 
vagrant@freebsd:~ % ls
libsodium-1.0.18-stable.tar.gz	libsodium-stable
vagrant@freebsd:~ % mv libsodium-stable libsodium#stable
vagrant@freebsd:~ % cd libsodium#stable/
vagrant@freebsd:~/libsodium#stable % ./con
configure* contrib/   
vagrant@freebsd:~/libsodium#stable % ./configure 
checking build system type... x86_64-unknown-freebsd12.2
checking host system type... x86_64-unknown-freebsd12.2
checking target system type... x86_64-unknown-freebsd12.2
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... configure: error: unsafe absolute working directory name
vagrant@freebsd:~/libsodium#stable % 

(using FreeBSD12)

Exactly the same error occurs in the Please logs, eg:

× Building wheel for pynacl (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [105 lines of output]
      /home/vagrant/builds/xxx/plz-out/tmp/libs/_pynacl#srcs._build/pip-build-env-_zdguq2n/overlay/lib/python3.9/site-packages/setuptools/config/setupcfg.py:293: _DeprecatedConfig: Deprecated config in `setup.cfg`
      !!
      
              ********************************************************************************
              The license_file parameter is deprecated, use license_files instead.
      
              By 2023-Oct-30, you need to update your project and remove deprecated calls
              or your builds will no longer be supported.
      
              See https://setuptools.pypa.io/en/latest/userguide/declarative_config.html for details.
              ********************************************************************************
      
      !!
        parsed = self.parsers.get(option_name, lambda x: x)(value)
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.freebsd-12.3-STABLE-amd64-cpython-39
      creating build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl
      copying src/nacl/__init__.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl
      copying src/nacl/encoding.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl
      copying src/nacl/exceptions.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl
      copying src/nacl/hash.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl
      copying src/nacl/hashlib.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl
      copying src/nacl/public.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl
      copying src/nacl/secret.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl
      copying src/nacl/signing.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl
      copying src/nacl/utils.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl
      creating build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/pwhash
      copying src/nacl/pwhash/__init__.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/pwhash
      copying src/nacl/pwhash/_argon2.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/pwhash
      copying src/nacl/pwhash/argon2i.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/pwhash
      copying src/nacl/pwhash/argon2id.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/pwhash
      copying src/nacl/pwhash/scrypt.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/pwhash
      creating build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/bindings
      copying src/nacl/bindings/__init__.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/bindings
      copying src/nacl/bindings/crypto_aead.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/bindings
      copying src/nacl/bindings/crypto_box.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/bindings
      copying src/nacl/bindings/crypto_core.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/bindings
      copying src/nacl/bindings/crypto_generichash.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/bindings
      copying src/nacl/bindings/crypto_hash.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/bindings
      copying src/nacl/bindings/crypto_kx.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/bindings
      copying src/nacl/bindings/crypto_pwhash.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/bindings
      copying src/nacl/bindings/crypto_scalarmult.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/bindings
      copying src/nacl/bindings/crypto_secretbox.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/bindings
      copying src/nacl/bindings/crypto_secretstream.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/bindings
      copying src/nacl/bindings/crypto_shorthash.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/bindings
      copying src/nacl/bindings/crypto_sign.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/bindings
      copying src/nacl/bindings/randombytes.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/bindings
      copying src/nacl/bindings/sodium_core.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/bindings
      copying src/nacl/bindings/utils.py -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl/bindings
      copying src/nacl/py.typed -> build/lib.freebsd-12.3-STABLE-amd64-cpython-39/nacl
      running build_clib
      checking build system type... x86_64-unknown-freebsd12.3
      checking host system type... x86_64-unknown-freebsd12.3
      checking target system type... x86_64-unknown-freebsd12.3
      checking for a BSD-compatible install... /usr/bin/install -c
      checking whether build environment is sane... configure: error: unsafe absolute working directory name
      Traceback (most recent call last):
        File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/usr/local/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/home/vagrant/builds/xxx/plz-out/tmp/libs/_pynacl#srcs._build/pip-build-env-_zdguq2n/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 416, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
        File "/home/vagrant/builds/xxx/plz-out/tmp/libs/_pynacl#srcs._build/pip-build-env-_zdguq2n/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 401, in _build_with_temp_dir
          self.run_setup()
        File "/home/vagrant/builds/xxx/plz-out/tmp/libs/_pynacl#srcs._build/pip-build-env-_zdguq2n/overlay/lib/python3.9/site-packages/setuptools/build_meta.py", line 338, in run_setup
          exec(code, locals())
        File "<string>", line 202, in <module>
        File "/home/vagrant/builds/xxx/plz-out/tmp/libs/_pynacl#srcs._build/pip-build-env-_zdguq2n/overlay/lib/python3.9/site-packages/setuptools/__init__.py", line 107, in setup
          return distutils.core.setup(**attrs)
        File "/home/vagrant/builds/xxx/plz-out/tmp/libs/_pynacl#srcs._build/pip-build-env-_zdguq2n/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
        File "/home/vagrant/builds/xxx/plz-out/tmp/libs/_pynacl#srcs._build/pip-build-env-_zdguq2n/overlay/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/home/vagrant/builds/xxx/plz-out/tmp/libs/_pynacl#srcs._build/pip-build-env-_zdguq2n/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/home/vagrant/builds/xxx/plz-out/tmp/libs/_pynacl#srcs._build/pip-build-env-_zdguq2n/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/home/vagrant/builds/xxx/plz-out/tmp/libs/_pynacl#srcs._build/pip-build-env-_zdguq2n/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/home/vagrant/builds/xxx/plz-out/tmp/libs/_pynacl#srcs._build/pip-build-env-_zdguq2n/overlay/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 346, in run
          self.run_command("build")
        File "/home/vagrant/builds/xxx/plz-out/tmp/libs/_pynacl#srcs._build/pip-build-env-_zdguq2n/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/home/vagrant/builds/xxx/plz-out/tmp/libs/_pynacl#srcs._build/pip-build-env-_zdguq2n/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/home/vagrant/builds/xxx/plz-out/tmp/libs/_pynacl#srcs._build/pip-build-env-_zdguq2n/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/home/vagrant/builds/xxx/plz-out/tmp/libs/_pynacl#srcs._build/pip-build-env-_zdguq2n/overlay/lib/python3.9/site-packages/setuptools/_distutils/command/build.py", line 131, in run
          self.run_command(cmd_name)
        File "/home/vagrant/builds/xxx/plz-out/tmp/libs/_pynacl#srcs._build/pip-build-env-_zdguq2n/overlay/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command
          self.distribution.run_command(command)
        File "/home/vagrant/builds/xxx/plz-out/tmp/libs/_pynacl#srcs._build/pip-build-env-_zdguq2n/overlay/lib/python3.9/site-packages/setuptools/dist.py", line 1234, in run_command
          super().run_command(command)
        File "/home/vagrant/builds/xxx/plz-out/tmp/libs/_pynacl#srcs._build/pip-build-env-_zdguq2n/overlay/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "<string>", line 160, in run
        File "/usr/local/lib/python3.9/subprocess.py", line 373, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/home/vagrant/builds/xxx/plz-out/tmp/libs/_pynacl#srcs._build/pip-install-_5cuv1uf/pynacl_bf5fea3585644001b89db417bbde9a23/src/libsodium/configure', '--disable-shared', '--enable-static', '--disable-debug', '--disable-dependency-tracking', '--with-pic', '--prefix', '/home/vagrant/builds/xxx/plz-out/tmp/libs/_pynacl#srcs._build/pip-install-_5cuv1uf/pynacl_bf5fea3585644001b89db417bbde9a23/build/temp.freebsd-12.3-STABLE-amd64-cpython-39']' returned non-zero exit status 1.
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pynacl
Failed to build pynacl
ERROR: Could not build wheels for pynacl, which is required to install pyproject.toml-based projects

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions