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

[BUG] Curly brackets in pathname on VMware virtualenv mess up build process #281

Open
veenstrajelmer opened this issue Nov 21, 2023 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@veenstrajelmer
Copy link

setuptools version

setuptools==69.0.1 (also with the newest 69.0.2)

Python version

Python 3.11

OS

Windows 11 x64 on VM

Additional environment information

No response

Description

When using python -m build on a VMware virtual machine the f-string solving is caught off guard since the path contains curly brackets: "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\[...]". I think we can agree that this is an improper and inconvenient pathname, but I wondered if it can be solved in build anyway.

Expected behavior

successfully build the package, just like it happens on a non-virtual machine.

How to Reproduce

python -m build

Output

Traceback (most recent call last):
  File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\veenstra\AppData\Local\Temp\build-env-zvi13qdy\Lib\site-packages\setuptools\_distutils\util.py", line 212, in subst_vars
    return _subst_compat(s).format_map(lookup)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: '45c63495-0000-0000-0000-100000000000'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\veenstra\Anaconda3\envs\dfm_tools_py311\Lib\site-packages\pyproject_hooks\_in_process\_in_process.py", line 353, in <module>
    main()
  File "C:\Users\veenstra\Anaconda3\envs\dfm_tools_py311\Lib\site-packages\pyproject_hooks\_in_process\_in_process.py", line 335, in main
    json_out['return_val'] = hook(**hook_input['kwargs'])
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\veenstra\Anaconda3\envs\dfm_tools_py311\Lib\site-packages\pyproject_hooks\_in_process\_in_process.py", line 251, in build_wheel
    return _build_backend().build_wheel(wheel_directory, config_settings,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\veenstra\AppData\Local\Temp\build-env-zvi13qdy\Lib\site-packages\setuptools\build_meta.py", line 404, in build_wheel
    return self._build_with_temp_dir(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\veenstra\AppData\Local\Temp\build-env-zvi13qdy\Lib\site-packages\setuptools\build_meta.py", line 389, in _build_with_temp_dir
    self.run_setup()
  File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\veenstra\AppData\Local\Temp\build-env-zvi13qdy\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup
    exec(code, locals())
  File "<string>", line 1, in <module>
  File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\veenstra\AppData\Local\Temp\build-env-zvi13qdy\Lib\site-packages\setuptools\__init__.py", line 103, in setup
    return distutils.core.setup(**attrs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\veenstra\AppData\Local\Temp\build-env-zvi13qdy\Lib\site-packages\setuptools\_distutils\core.py", line 185, in setup
    return run_commands(dist)
           ^^^^^^^^^^^^^^^^^^
  File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\veenstra\AppData\Local\Temp\build-env-zvi13qdy\Lib\site-packages\setuptools\_distutils\core.py", line 201, in run_commands
    dist.run_commands()
  File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\veenstra\AppData\Local\Temp\build-env-zvi13qdy\Lib\site-packages\setuptools\_distutils\dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\veenstra\AppData\Local\Temp\build-env-zvi13qdy\Lib\site-packages\setuptools\dist.py", line 963, in run_command
    super().run_command(command)
  File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\veenstra\AppData\Local\Temp\build-env-zvi13qdy\Lib\site-packages\setuptools\_distutils\dist.py", line 988, in run_command
    cmd_obj.run()
  File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\veenstra\AppData\Local\Temp\build-env-zvi13qdy\Lib\site-packages\wheel\bdist_wheel.py", line 404, in run
    self.run_command("install")
  File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\veenstra\AppData\Local\Temp\build-env-zvi13qdy\Lib\site-packages\setuptools\_distutils\cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\veenstra\AppData\Local\Temp\build-env-zvi13qdy\Lib\site-packages\setuptools\dist.py", line 963, in run_command
    super().run_command(command)
  File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\veenstra\AppData\Local\Temp\build-env-zvi13qdy\Lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command
    cmd_obj.ensure_finalized()
  File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\veenstra\AppData\Local\Temp\build-env-zvi13qdy\Lib\site-packages\setuptools\_distutils\cmd.py", line 111, in ensure_finalized
    self.finalize_options()
  File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\veenstra\AppData\Local\Temp\build-env-zvi13qdy\Lib\site-packages\setuptools\command\install.py", line 55, in finalize_options
    orig.install.finalize_options(self)
  File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\veenstra\AppData\Local\Temp\build-env-zvi13qdy\Lib\site-packages\setuptools\_distutils\command\install.py", line 439, in finalize_options
    self.expand_basedirs()
  File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\veenstra\AppData\Local\Temp\build-env-zvi13qdy\Lib\site-packages\setuptools\_distutils\command\install.py", line 619, in expand_basedirs
    self._expand_attrs(['install_base', 'install_platbase', 'root'])
  File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\veenstra\AppData\Local\Temp\build-env-zvi13qdy\Lib\site-packages\setuptools\_distutils\command\install.py", line 613, in _expand_attrs
    val = subst_vars(val, self.config_vars)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\SnapVolumesTemp\MountPoints\{45c63495-0000-0000-0000-100000000000}\{79DE0690-9470-4166-B9EE-4548DC416BBD}\SVROOT\Users\veenstra\AppData\Local\Temp\build-env-zvi13qdy\Lib\site-packages\setuptools\_distutils\util.py", line 214, in subst_vars
    raise ValueError(f"invalid variable {var}")
ValueError: invalid variable '45c63495-0000-0000-0000-100000000000'

ERROR Backend subprocess exited when trying to invoke build_wheel
@abravalheri
Copy link
Contributor

Help with that is appreciated. I'm happy to discuss PRs, but I suspect that such PRs have to be discussed at the level of the pypa/distutils repository first. It might be wise to discuss fixes with the pypa/distutils maintainers before jumping into implementation.

@abravalheri abravalheri added help wanted Extra attention is needed and removed Needs Triage labels Nov 21, 2023
@veenstrajelmer
Copy link
Author

Ok, thanks @abravalheri. Could you maybe tag one of their developers or forward the issue to them via another method? If it is indeed something for distutils, an issue can be created there instead.

@abravalheri
Copy link
Contributor

@jaraco can probably advise if pypa/distutils would accept any work on this topic.

@jaraco jaraco transferred this issue from pypa/setuptools Aug 16, 2024
@jaraco
Copy link
Member

jaraco commented Aug 16, 2024

I've transferred the issue to the distutils project. I only just today got around to reading it.

I absolutely agree this is a bug and should be fixed.

We need to identify where the {var} substitution is happening and ensure it doesn't happen for legitimate filenames (if possible).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants