From 8875120ad0b7c84f6ea62737030fe953aae3d7ba Mon Sep 17 00:00:00 2001 From: Kristoffer Carlsson Date: Tue, 23 Jul 2024 20:19:48 +0200 Subject: [PATCH] fix not hardcoding "Project.toml" when fixing up extensions in manifest (#3851) * fix not hardcoding "Project.toml" when fixing up extensions in manifest file * abspath to be extra safe --------- Co-authored-by: KristofferC Co-authored-by: Ian Butterworth --- src/Operations.jl | 10 ++++++---- src/Types.jl | 2 +- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/Operations.jl b/src/Operations.jl index 022d1eed1b..30f01dab71 100644 --- a/src/Operations.jl +++ b/src/Operations.jl @@ -228,9 +228,11 @@ end # about extensions function fixups_from_projectfile!(env::EnvCache) for pkg in values(env.manifest) - v = joinpath(source_path(env.manifest_file, pkg), "Project.toml") - if isfile(v) - p = Types.read_project(v) + # 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 pkg.exts = p.exts pkg.entryfile = p.entryfile @@ -2104,7 +2106,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 df2284112d..ef7b0d51cc 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