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

fix not hardcoding "Project.toml" when fixing up extensions in manifest #3851

Merged
merged 3 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,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 @@ -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)
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
Loading