From d96797c11c4ccc76d22438282614bc5521dd09e2 Mon Sep 17 00:00:00 2001 From: KristofferC Date: Thu, 21 Mar 2024 15:37:58 +0100 Subject: [PATCH 1/2] fix not hardcoding "Project.toml" when fixing up extensions in manifest file --- src/Operations.jl | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Operations.jl b/src/Operations.jl index 7e837c74c8..4bdb1a4118 100644 --- a/src/Operations.jl +++ b/src/Operations.jl @@ -179,11 +179,11 @@ end # about extensions function fixup_ext!(env, pkgs) for pkg in pkgs - v = joinpath(source_path(env.manifest_file, pkg), "Project.toml") if haskey(env.manifest, pkg.uuid) entry = env.manifest[pkg.uuid] - if isfile(v) - p = Types.read_project(v) + project_file = Base.locate_project_file(source_path(env.manifest_file, pkg)) + if isfile(project_file) + p = Types.read_project(project_file) entry.weakdeps = p.weakdeps entry.exts = p.exts for (name, _) in p.weakdeps From 73a6b86fecc524376c761636b917681549c21f5a Mon Sep 17 00:00:00 2001 From: Ian Butterworth Date: Tue, 23 Jul 2024 12:37:01 -0400 Subject: [PATCH 2/2] abspath to be extra safe --- src/Operations.jl | 6 ++++-- src/Types.jl | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Operations.jl b/src/Operations.jl index db0c8eb48c..d5aa0b22a6 100644 --- a/src/Operations.jl +++ b/src/Operations.jl @@ -227,7 +227,9 @@ end # about extensions function fixups_from_projectfile!(env::EnvCache) for pkg in values(env.manifest) - project_file = Base.locate_project_file(source_path(env.manifest_file, pkg)) + # isfile_casesenstive within locate_project_file used to error on Windows if given a + # relative path so abspath it to be extra safe https://github.com/JuliaLang/julia/pull/55220 + project_file = Base.locate_project_file(abspath(source_path(env.manifest_file, pkg))) if isfile(project_file) p = Types.read_project(project_file) pkg.weakdeps = p.weakdeps @@ -2113,7 +2115,7 @@ function test(ctx::Context, pkgs::Vector{PackageSpec}; # TODO: DRY with code below. # If the test is in the our "workspace", no need to create a temp env etc, just activate and run thests if testdir(source_path) in dirname.(keys(ctx.env.workspace)) - proj = Base.locate_project_file(testdir(source_path)) + proj = Base.locate_project_file(abspath(testdir(source_path))) env = EnvCache(proj) # Instantiate test env Pkg.instantiate(Context(env=env); allow_autoprecomp = false) diff --git a/src/Types.jl b/src/Types.jl index a23214a1d1..419eb61c19 100644 --- a/src/Types.jl +++ b/src/Types.jl @@ -346,7 +346,7 @@ function collect_workspace(base_project_file::String, d::Dict{String, Project}=D projects === nothing && return d project_paths = [abspath(base_project_file_dir, project) for project in projects] for project_path in project_paths - project_file = Base.locate_project_file(project_path) + project_file = Base.locate_project_file(abspath(project_path)) if project_file isa String collect_workspace(project_file, d) end