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

ci/nur/combine.py: Try to fix File exists: 'lib' error #764

Merged
merged 1 commit into from
Sep 17, 2024

Conversation

Rhys-T
Copy link
Contributor

@Rhys-T Rhys-T commented Sep 17, 2024

Followup to #762.

I don't know how I thought my changes in #762 were working on my machine. I really did try to test it, but I just noticed that the last couple of update_nur jobs failed with this error:

Traceback (most recent call last):
  File "/nix/store/jixljq3pr9zfyxvn1bz4r7h49awh00lc-nur/bin/.nur-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/jixljq3pr9zfyxvn1bz4r7h49awh00lc-nur/lib/python3.10/site-packages/nur/__init__.py", line 63, in main
    args.func(args)
  File "/nix/store/jixljq3pr9zfyxvn1bz4r7h49awh00lc-nur/lib/python3.10/site-packages/nur/combine.py", line 175, in combine_command
    setup_combined()
  File "/nix/store/jixljq3pr9zfyxvn1bz4r7h49awh00lc-nur/lib/python3.10/site-packages/nur/combine.py", line 162, in setup_combined
    shutil.copytree(str(ROOT.joinpath("lib")), manifest_lib, symlinks=True)
  File "/nix/store/412d25bdawy2idxfpnis8vjcm8cz2ag7-python3-3.10.11/lib/python3.10/shutil.py", line 559, in copytree
    return _copytree(entries=entries, src=src, dst=dst, symlinks=symlinks,
  File "/nix/store/412d25bdawy2idxfpnis8vjcm8cz2ag7-python3-3.10.11/lib/python3.10/shutil.py", line 457, in _copytree
    os.makedirs(dst, exist_ok=dirs_exist_ok)
  File "/nix/store/412d25bdawy2idxfpnis8vjcm8cz2ag7-python3-3.10.11/lib/python3.10/os.py", line 225, in makedirs
    mkdir(name, mode)
FileExistsError: [Errno 17] File exists: 'lib'

I think this pull is the correct fix - passing dirs_exist_ok=True should make shutil.copytree overwrite existing files and reuse existing directories, mimicking its distutils counterpart more closely. But I clearly don't know how to test it properly. Can you offer any guidance on this, so I can avoid causing any more problems like this in the future?

Sorry for breaking things.

@Rhys-T
Copy link
Contributor Author

Rhys-T commented Sep 17, 2024

If this doesn't work, I'd suggest just reverting #762 to get NUR working again until we can figure out how to fix this properly. I think the old script was working for most users - it was just Darwin/macOS where it was failing.

@Mic92
Copy link
Member

Mic92 commented Sep 17, 2024

@mergify queue

Copy link
Contributor

mergify bot commented Sep 17, 2024

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at 1ec6e1a

@mergify mergify bot merged commit 1ec6e1a into nix-community:master Sep 17, 2024
3 checks passed
@Mic92
Copy link
Member

Mic92 commented Sep 17, 2024

Also see #755

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

Successfully merging this pull request may close these issues.

2 participants