Skip to content

Commit

Permalink
fix not hardcoding "Project.toml" when fixing up extensions in manife…
Browse files Browse the repository at this point in the history
…st (JuliaLang#3851)

* fix not hardcoding "Project.toml" when fixing up extensions in manifest file

* abspath to be extra safe

---------

Co-authored-by: KristofferC <[email protected]>
Co-authored-by: Ian Butterworth <[email protected]>
  • Loading branch information
3 people authored Jul 23, 2024
1 parent 90d42a1 commit 8875120
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 6 additions & 4 deletions src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/Types.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8875120

Please sign in to comment.