Skip to content
This repository has been archived by the owner on Mar 12, 2024. It is now read-only.

add a --force flag to pass force=True to add_distribution? #13

Closed
nathantsoi opened this issue Jul 17, 2018 · 6 comments
Closed

add a --force flag to pass force=True to add_distribution? #13

nathantsoi opened this issue Jul 17, 2018 · 6 comments
Assignees

Comments

@nathantsoi
Copy link

nathantsoi commented Jul 17, 2018

Perhaps there is a better fix for this, but packaging selenium, I get existing file errors unless I patch https://github.com/facebookincubator/xar/blob/master/xar/xar_builder.py#L392 to force=True

e.g.

-        wheel.install(sys_paths, xar_paths, force=False)
+        wheel.install(sys_paths, xar_paths, force=True)

Any suggestions or should I look into passing through a --force flag?

edit: to clarify, packaging an executable with selenium as a dependency.

@terrelln terrelln self-assigned this Jul 17, 2018
@terrelln
Copy link
Contributor

Hmm, it shouldn't require force=True, I'll look into it.

@terrelln
Copy link
Contributor

Can you provide reproduction instructions? I'm not sure how to build selenium.

@nathantsoi
Copy link
Author

here ya go: https://github.com/nathantsoi/xar_packaging_test

building this with: pipenv run python setup.py bdist_xar

i get:

removing 'build/bdist.macosx-10.13-x86_64/xar' (and everything under it)
Traceback (most recent call last):
  File "setup.py", line 14, in <module>
    entry_points={'console_scripts':['test=test:main']}
  File "/Users/ntsoi/.local/share/virtualenvs/testpackage-OKd-JeQ2/lib/python3.7/site-packages/setuptools/__init__.py", line 131, in setup
    return distutils.core.setup(**attrs)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python/3.7.0/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "/Users/ntsoi/.local/share/virtualenvs/testpackage-OKd-JeQ2/lib/python3.7/site-packages/xar/commands/bdist_xar.py", line 232, in run
    xar.add_distribution(dep)
  File "/Users/ntsoi/.local/share/virtualenvs/testpackage-OKd-JeQ2/lib/python3.7/site-packages/xar/xar_builder.py", line 392, in add_distribution
    wheel.install(sys_paths, xar_paths, force=False)
  File "/Users/ntsoi/.local/share/virtualenvs/testpackage-OKd-JeQ2/lib/python3.7/site-packages/xar/py_util.py", line 261, in install
    self.copy_installation(src_paths, dst_paths, force)
  File "/Users/ntsoi/.local/share/virtualenvs/testpackage-OKd-JeQ2/lib/python3.7/site-packages/xar/py_util.py", line 355, in copy_installation
    raise self.Error("'%s' already exists" % dst_record)
xar.py_util.Error: '/var/folders/36/1q_9rkrj1xv5vx9qmvb8790c0000gn/T/tmprpq8xf49/selenium/webdriver/firefox/amd64/x_ignore_nofocus.so' already exists

@terrelln
Copy link
Contributor

Awesome, I reproduced the failure! I will look into it, and get a fix out.

@terrelln
Copy link
Contributor

The file selenium/webdriver/firefox/amd64/x_ignore_nofocus.so is present in the data, and in the {pure,plat}lib install locations, which are the same for XAR. In this case passing the force flag would work, since they are the same file, but I'm not sure if is a good idea in general.

Ideally wheel would have a flag meaning "don't force, but its okay to have duplicated files have the same sha256".

@terrelln
Copy link
Contributor

It should be fixed once PR #15 lands.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants