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
avoid PermissionError on Lustre when copying files (fixes #25354) #27247
Conversation
It looks like the CI fails due to this function accessing a member variable that only exists in Python 3.3+, but I've guarded against accessing it for earlier verions:
|
I tried this on theta at ANL.
On
With the patch to
So, I can confirm the bug on lustre and the patch works for me. Btw, it's not just the This is with current spack develop as of today, Nov 9, 2021.
|
I tested this a week ago, and I was able to reproduce the problem and @tldahlgren You understand I don't have commit access (and don't really want it), right? |
Yes, I do understand. I was just flagging PRs with the people who have provided reviews so it's visible on the PR list. IMO it's an easier way to distinguish PRs with real feedback (e.g., something other than spackbot comments). Perhaps this is a good topic to clarify in the Spack User meeting? |
Not sure why this was not reviewed, but one issue is we would add PSF-licensed
Can you rebase the PR? |
Rebased. I didn't realize the license issue. How does this work for vendored dependencies? Would adding shutil (from 3.7.4 or higher) as a vendored dependency fix this problem? |
The error message for the unittests (2.7, clingo) check is inscrutable to me. Is this a CI problem, or an actual problem with this patch? |
There's still some issue with Python 2.7, see the failing test.
|
@spackbot fix style |
Let me see if I can fix that for you! |
I was able to run spack style --fix==> Running style checks on spack
selected: isort, black, flake8, mypy
==> Modified files
lib/spack/llnl/util/filesystem.py
==> Running isort checks
isort checks were clean
==> Running black checks
reformatted lib/spack/llnl/util/filesystem.py
All done! ✨ 🍰 ✨
1 file reformatted.
black checks were clean
==> Running flake8 checks
flake8 checks were clean
==> Running mypy checks
Success: no issues found in 555 source files
mypy checks were clean
==> spack style checks were clean
I've updated the branch with style fixes. |
Since Python 2.7 support has been dropped, is there anything currently blocking this? |
I tried rebasing to latest develop, and it succeeded. But it turns out I
don't have write access to your branch 🥲
…On Fri, Feb 17, 2023, 09:53 Ben Wibking ***@***.***> wrote:
There's still some issue with Python 2.7, see the failing test.
TypeError: stat() takes no keyword arguments
Since Python 2.7 support has been dropped, is there anything currently
blocking this?
—
Reply to this email directly, view it on GitHub
<#27247 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AMERY5F3NBKQQPMFPE3P4NDWX6GG7ANCNFSM5HO4P76A>
.
You are receiving this because you were assigned.Message ID:
***@***.***>
|
I've checked the "Allow edits and access to secrets by maintainers" box. Is there anything else I need to do? |
There is a bug in Python versions < 3.7.4 that causes PermissionError to occur when using shutil.copy2 to copy read-only files that have extended attributes set by Lustre (which is used by lib/spack/llnl/util/filesystem.py:504 to copy directory trees). The upstream Python bug is here.
Setting SPACK_PYTHON to point to a python executable >= version 3.7.4 fixes the problem. However, for Python versions below this, we monkeypatch shutil.copystat to set extended attributes before setting permissions. This means that copying read-only files that have extended attributes set by Lustre can succeed, which is necessary to install openjdk (and fix #25354). I have confirmed on my cluster that this patch fixes openjdk installation when spack is installed on a Lustre FS when using Python 3.6.