Skip to content

Commit

Permalink
Use public API for Pkg stdlibs
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Nov 15, 2024
1 parent fefea70 commit e7ea3d4
Showing 1 changed file with 3 additions and 16 deletions.
19 changes: 3 additions & 16 deletions src/packages/PkgCompat.jl
Original file line number Diff line number Diff line change
Expand Up @@ -255,22 +255,9 @@ end
# Standard Libraries
###

# (⚠️ Internal API with fallback)
_stdlibs() = try
stdlibs = values(Pkg.Types.stdlibs())
T = eltype(stdlibs)
if T == String
stdlibs
elseif T <: Tuple{String,Any}
first.(stdlibs)
else
error()
end
catch e
@warn "Pkg compat: failed to load standard libraries." exception=(e,catch_backtrace())

String["ArgTools", "Artifacts", "Base64", "CRC32c", "CompilerSupportLibraries_jll", "Dates", "DelimitedFiles", "Distributed", "Downloads", "FileWatching", "Future", "GMP_jll", "InteractiveUtils", "LLD_jll", "LLVMLibUnwind_jll", "LazyArtifacts", "LibCURL", "LibCURL_jll", "LibGit2", "LibGit2_jll", "LibOSXUnwind_jll", "LibSSH2_jll", "LibUV_jll", "LibUnwind_jll", "Libdl", "LinearAlgebra", "Logging", "MPFR_jll", "Markdown", "MbedTLS_jll", "Mmap", "MozillaCACerts_jll", "NetworkOptions", "OpenBLAS_jll", "OpenLibm_jll", "PCRE2_jll", "Pkg", "Printf", "Profile", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "SuiteSparse", "SuiteSparse_jll", "TOML", "Tar", "Test", "UUIDs", "Unicode", "Zlib_jll", "dSFMT_jll", "libLLVM_jll", "libblastrampoline_jll", "nghttp2_jll", "p7zip_jll"]
end
# (✅ Public API)
_stdlibs_found = readdir(Sys.STDLIB)
_stdlibs() = _stdlibs_found

# ⚠️ Internal API with fallback
is_stdlib(package_name::AbstractString) = package_name _stdlibs()
Expand Down

0 comments on commit e7ea3d4

Please sign in to comment.