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

python/setup.py: incremental build fails due to already existing setup.py link #268

Closed
jhgit opened this issue Jan 18, 2023 · 0 comments · Fixed by #269
Closed

python/setup.py: incremental build fails due to already existing setup.py link #268

jhgit opened this issue Jan 18, 2023 · 0 comments · Fixed by #269

Comments

@jhgit
Copy link
Contributor

jhgit commented Jan 18, 2023

Trying to build the python binding fails after the first attempt because it tries to create a link to setup.py that was created already in the first build attempt:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "setup.py", line 45, in <module>
    os.link('python/setup.py', 'setup.py')
FileExistsError: [Errno 17] File exists: 'python/setup.py' -> 'setup.py'

The following patch avoids creating the link if it already exists:

--- python/setup.py.orig    2023-01-08 10:03:32 UTC
+++ python/setup.py
@@ -41,7 +41,7 @@ template = 'python/MANIFEST.in'
 # distutils assume setup.py is in the root of the project
 # we need to include C source from the parent so trick it
 in_ucl_root = 'setup.py' in os.listdir('python')
-if in_ucl_root:
+if not os.path.isfile('setup.py') and in_ucl_root:
     os.link('python/setup.py', 'setup.py')

 setup(
jhgit added a commit to jhgit/libucl that referenced this issue Jan 18, 2023
Fixes vstakhov#268 (python/setup.py: incremental build fails due to already existing setup.py link)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant