Skip to content

also collect packages tracking a repo when "traversing" developed packages #4198

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

Merged
merged 2 commits into from
Apr 9, 2025
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
22 changes: 13 additions & 9 deletions src/Operations.jl
Original file line number Diff line number Diff line change
Expand Up @@ -359,18 +359,22 @@ function collect_developed!(env::EnvCache, pkg::PackageSpec, developed::Vector{P
source = project_rel_path(env, source_path(env.manifest_file, pkg))
source_env = EnvCache(projectfile_path(source))
pkgs = load_project_deps(source_env.project, source_env.project_file, source_env.manifest, source_env.manifest_file)
for pkg in filter(is_tracking_path, pkgs)
for pkg in pkgs
if any(x -> x.uuid == pkg.uuid, developed)
continue
end
# normalize path
# TODO: If path is collected from project, it is relative to the project file
# otherwise relative to manifest file....
pkg.path = Types.relative_project_path(env.manifest_file,
project_rel_path(source_env,
source_path(source_env.manifest_file, pkg)))
push!(developed, pkg)
collect_developed!(env, pkg, developed)
if is_tracking_path(pkg)
# normalize path
# TODO: If path is collected from project, it is relative to the project file
# otherwise relative to manifest file....
pkg.path = Types.relative_project_path(env.manifest_file,
project_rel_path(source_env,
source_path(source_env.manifest_file, pkg)))
push!(developed, pkg)
collect_developed!(env, pkg, developed)
elseif is_tracking_repo(pkg)
push!(developed, pkg)
end
end
end

Expand Down
6 changes: 6 additions & 0 deletions test/sources.jl
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ temp_pkg_dir() do project_path
Pkg.test()
end
end

cd(joinpath(dir, "WithSources", "URLSourceInDevvedPackage")) do
with_current_env() do
Pkg.test()
end
end
end
end
end
Expand Down
4 changes: 4 additions & 0 deletions test/test_packages/WithSources/TestMonorepo/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@ uuid = "864d8eef-2526-4817-933e-34008eadd182"
authors = ["KristofferC <[email protected]>"]
version = "0.1.0"

[deps]
Unregistered = "dcb67f36-efa0-11e8-0cef-2fc465ed98ae"

[extras]
Example = "d359f271-ef68-451f-b4fc-6b43e571086c"

[sources]
Example = {url = "https://github.com/JuliaLang/Pkg.jl", subdir = "test/test_packages/Example"}
Unregistered = {url = "https://github.com/00vareladavid/Unregistered.jl", rev = "1b7a462"}

[targets]
test = ["Example"]
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
module TestMonorepo
using Unregistered

greet() = print("Hello World!")

Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
using Example
using Unregistered
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
name = "URLSourceInDevvedPackage"
uuid = "78d3b172-12ec-4a7f-9187-8bf78594552a"
version = "0.1.0"
authors = ["Kristoffer <[email protected]>"]

[deps]
TestMonorepo = "864d8eef-2526-4817-933e-34008eadd182"

[sources]
TestMonorepo = {path = "../TestMonorepo"}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module URLSourceInDevvedPackage

greet() = print("Hello World!")

end # module URLSourceInDevvedPackage
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
using URLSourceInDevvedPackage
using TestMonorepo