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

Avoid stat-ing stdlib path if it's unreadable #55980

Merged

Conversation

giordano
Copy link
Contributor

@giordano giordano commented Oct 3, 2024

This seems to fix #55966 for me on v1.10:

julia> run(`sudo mkdir -p $(abspath(Sys.BUILD_STDLIB_PATH))`);

julia> run(`sudo chmod go-x $(abspath(Sys.BUILD_STDLIB_PATH))`);

julia> using SuiteSparse
[ Info: Precompiling SuiteSparse [4607b0f0-06f3-5cda-b6b1-a6196a1729e9]

julia>

It's hard to make a proper test for this because it requires fiddling with the build directory, which for from-source builds is likely needed and you don't want to mess with it, and in general may require admin access.

I'll make a separate PR for master, as sketched in #55966 (comment), I started from v1.10 because that's the only version where I can reliably reproduce the issue, and so test it locally easily. Also, the code around these lines is changed in v1.11, so this would need a manual backport in any case.

@giordano giordano added the packages Package management and loading label Oct 3, 2024
@giordano
Copy link
Contributor Author

giordano commented Oct 3, 2024

Note that the core testset is bound to fail because it's currently broken on the target branch.

base/loading.jl Outdated Show resolved Hide resolved
@giordano giordano force-pushed the mg/stat-fixup-stdlib-1.10 branch from 3f2bfcd to 264f4a4 Compare October 4, 2024 09:55
base/loading.jl Outdated Show resolved Hide resolved
@giordano giordano force-pushed the mg/stat-fixup-stdlib-1.10 branch from c4e9213 to 19cf293 Compare October 4, 2024 13:52
Copy link
Member

@fatteneder fatteneder left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

loading.jl contains many more fs calls that run through stat and could potentially fail the same way.
I guess we need to make more use of isaccessibledir and friends to filter such cases prematurely (but that's also not the case here).

@giordano giordano merged commit c3490ed into JuliaLang:backports-release-1.10 Oct 4, 2024
3 of 5 checks passed
@giordano giordano deleted the mg/stat-fixup-stdlib-1.10 branch October 4, 2024 19:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages Package management and loading
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants