gnuports@2rosenthals.com ?????????????? ????? #40

???: "Lewis G Rosenthal" <gnuports@2rosenthals.com> ?? ????
?????????
??: Assertion error with pip building
??: Fri, 30 Sep 2022 22:18:58 -0400
??: GNU Ports for eCS Mailing List <gnuports@2rosenthals.com>

Greetings...

For a project (Privoxy), I got involved in building Mbed TLS (https://www.trustedfirmware.org/projects/mbed-tls/). Mbed TLS seems to require the Jinja2 Pyhthon module (https://pypi.org/project/Jinja2/).

Unfortunately, pip (well, gcc, more likely) is having a hard time building wheel, as a prereq for MarkupCode, which itself is a prereq for Jinja2.

I've hackishly worked around the problem by removing line 91 from python3.9/site-packages/setuptools/command/install_lib.py:

assert preserve_mode and preserve_times and not preserve_symlinks


What I'm failing to understand, however, is why the assertion fails in the first place. It seems perfectly reasonable, unless I'm missing something. Before I open a ticket for bww about this, I thought I might mention it here, in case anyone has any ideas.

Thanks

Here's a bit of the output (mind the wrapping):

--

[j:\usr\lib\python3.9\site-packages] python pip install MarkupSafe
WARNING: The directory 'c:/home/default/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Collecting MarkupSafe
  Downloading MarkupSafe-2.1.1.tar.gz (18 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: MarkupSafe
  Building wheel for MarkupSafe (setup.py) ... error
  error: subprocess-exited-with-error

  python setup.py bdist_wheel did not run successfully.
  exit code: 1

  [69 lines of output]
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build/lib.os2knix-3.9
  creating build/lib.os2knix-3.9/markupsafe
  copying src/markupsafe/_native.py -> build/lib.os2knix-3.9/markupsafe
  copying src/markupsafe/__init__.py -> build/lib.os2knix-3.9/markupsafe
  running egg_info
  writing src/MarkupSafe.egg-info/PKG-INFO
  writing dependency_links to src/MarkupSafe.egg-info/dependency_links.txt
  writing top-level names to src/MarkupSafe.egg-info/top_level.txt
  reading manifest file 'src/MarkupSafe.egg-info/SOURCES.txt'
  reading manifest template 'MANIFEST.in'
  no previously-included directories found matching 'docs/_build'
  warning: no previously-included files matching '*.pyc' found anywhere in distribution
  adding license file 'LICENSE.rst'
  writing manifest file 'src/MarkupSafe.egg-info/SOURCES.txt'
  copying src/markupsafe/_speedups.c -> build/lib.os2knix-3.9/markupsafe
  copying src/markupsafe/_speedups.pyi -> build/lib.os2knix-3.9/markupsafe
  copying src/markupsafe/py.typed -> build/lib.os2knix-3.9/markupsafe
  running build_ext
  building 'markupsafe._speedups' extension
  creating build/temp.os2knix-3.9
  creating build/temp.os2knix-3.9/src
  creating build/temp.os2knix-3.9/src/markupsafe
  gcc.exe -Wno-unused-result -Wsign-compare -DNDEBUG -g -fwrapv -O3 -Wall -O2 -g -march=pentium4 -mno-avx -mstackrealign -fno-common -ffile-prefix-map=E:/rpmbuild/BUILD=. -O2 -g -march=pentium4 -mno-avx -mstackrealign -fno-common -ffile-prefix-map=E:/rpmbuild/BUILD=. -g -O2 -IJ:/USR/include/python3.9 -c src/markupsafe/_speedups.c -o build/temp.os2knix-3.9/src/markupsafe/_speedups.o  writing build/temp.os2knix-3.9/src/markupsafe/_speedups.def
  gcc -Zdll -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp -lcx -Zhigh-mem -Zomf -Zargs-wild -Zargs-resp -lcx -g -O2 -s build/temp.os2knix-3.9/src/markupsafe/_speedups.o build/temp.os2knix-3.9/src/markupsafe/_speedups.def -L/@unixroot/usr/lib -lpython3.9 -o build/lib.os2knix-3.9/markupsafe/_sp4361.pyd
  Warning! W1121: file C:/var/temp\ldconv__speedups_o_2ab6337543c177df8.obj(src\markupsafe\_speedups.c): '_PyInit__speedups' has already been exported
  installing to build/bdist.os2knix/wheel
  running install
  running install_lib
  Traceback (most recent call last):
    File "<string>", line 2, in <module>
    File "<pip-setuptools-caller>", line 34, in <module>
    File "C:/var/temp/pip-install-3wo4q4m7/markupsafe_024ed9301ed84d8aa462f11cfb48c1f9/setup.py", line 65, in <module>
      run_setup(True)
    File "C:/var/temp/pip-install-3wo4q4m7/markupsafe_024ed9301ed84d8aa462f11cfb48c1f9/setup.py", line 41, in run_setup
      setup(
    File "J:/USR/lib/python3.9/site-packages/setuptools/__init__.py", line 153, in setup
      return distutils.core.setup(**attrs)
    File "J:/USR/lib/python3.9/distutils/core.py", line 148, in setup
      dist.run_commands()
    File "J:/USR/lib/python3.9/distutils/dist.py", line 966, in run_commands
      self.run_command(cmd)
    File "J:/USR/lib/python3.9/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "J:/USR/lib/python3.9/site-packages/wheel/bdist_wheel.py", line 335, in run
      self.run_command('install')
    File "J:/USR/lib/python3.9/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "J:/USR/lib/python3.9/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "J:/USR/lib/python3.9/site-packages/setuptools/command/install.py", line 61, in run
      return orig.install.run(self)
    File "J:/USR/lib/python3.9/distutils/command/install.py", line 572, in run
      self.run_command(cmd_name)
    File "J:/USR/lib/python3.9/distutils/cmd.py", line 313, in run_command
      self.distribution.run_command(command)
    File "J:/USR/lib/python3.9/distutils/dist.py", line 985, in run_command
      cmd_obj.run()
    File "J:/USR/lib/python3.9/site-packages/setuptools/command/install_lib.py", line 12, in run
      outfiles = self.install()
    File "J:/USR/lib/python3.9/distutils/command/install_lib.py", line 111, in install
      outfiles = self.copy_tree(self.build_dir, self.install_dir, preserve_symlinks=1)
    File "J:/USR/lib/python3.9/site-packages/setuptools/command/install_lib.py", line 91, in copy_tree
      assert preserve_mode and preserve_times and not preserve_symlinks
  AssertionError
  [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for MarkupSafe
  Running setup.py clean for MarkupSafe

--
Lewis
-------------------------------------------------------------
Lewis G Rosenthal, CNA, CLP, CLE, CWTS, EA
Rosenthal & Rosenthal, LLC                www.2rosenthals.com
visit my IT blog                www.2rosenthals.net/wordpress
-------------------------------------------------------------


???????: ????, ??????, ??????.
?????????
??? ????????