Skip to content

Commit bde7ce0

Browse files
authored
also collect packages tracking a repo when "traversing" developed packages (#4198)
1 parent 5432fdd commit bde7ce0

File tree

8 files changed

+42
-9
lines changed

8 files changed

+42
-9
lines changed

src/Operations.jl

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -359,18 +359,22 @@ function collect_developed!(env::EnvCache, pkg::PackageSpec, developed::Vector{P
359359
source = project_rel_path(env, source_path(env.manifest_file, pkg))
360360
source_env = EnvCache(projectfile_path(source))
361361
pkgs = load_project_deps(source_env.project, source_env.project_file, source_env.manifest, source_env.manifest_file)
362-
for pkg in filter(is_tracking_path, pkgs)
362+
for pkg in pkgs
363363
if any(x -> x.uuid == pkg.uuid, developed)
364364
continue
365365
end
366-
# normalize path
367-
# TODO: If path is collected from project, it is relative to the project file
368-
# otherwise relative to manifest file....
369-
pkg.path = Types.relative_project_path(env.manifest_file,
370-
project_rel_path(source_env,
371-
source_path(source_env.manifest_file, pkg)))
372-
push!(developed, pkg)
373-
collect_developed!(env, pkg, developed)
366+
if is_tracking_path(pkg)
367+
# normalize path
368+
# TODO: If path is collected from project, it is relative to the project file
369+
# otherwise relative to manifest file....
370+
pkg.path = Types.relative_project_path(env.manifest_file,
371+
project_rel_path(source_env,
372+
source_path(source_env.manifest_file, pkg)))
373+
push!(developed, pkg)
374+
collect_developed!(env, pkg, developed)
375+
elseif is_tracking_repo(pkg)
376+
push!(developed, pkg)
377+
end
374378
end
375379
end
376380

test/sources.jl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,12 @@ temp_pkg_dir() do project_path
4343
Pkg.test()
4444
end
4545
end
46+
47+
cd(joinpath(dir, "WithSources", "URLSourceInDevvedPackage")) do
48+
with_current_env() do
49+
Pkg.test()
50+
end
51+
end
4652
end
4753
end
4854
end

test/test_packages/WithSources/TestMonorepo/Project.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,15 @@ uuid = "864d8eef-2526-4817-933e-34008eadd182"
33
authors = ["KristofferC <[email protected]>"]
44
version = "0.1.0"
55

6+
[deps]
7+
Unregistered = "dcb67f36-efa0-11e8-0cef-2fc465ed98ae"
8+
69
[extras]
710
Example = "d359f271-ef68-451f-b4fc-6b43e571086c"
811

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

1216
[targets]
1317
test = ["Example"]

test/test_packages/WithSources/TestMonorepo/src/TestMonorepo.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
module TestMonorepo
2+
using Unregistered
23

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
using Example
2+
using Unregistered
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name = "URLSourceInDevvedPackage"
2+
uuid = "78d3b172-12ec-4a7f-9187-8bf78594552a"
3+
version = "0.1.0"
4+
authors = ["Kristoffer <[email protected]>"]
5+
6+
[deps]
7+
TestMonorepo = "864d8eef-2526-4817-933e-34008eadd182"
8+
9+
[sources]
10+
TestMonorepo = {path = "../TestMonorepo"}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module URLSourceInDevvedPackage
2+
3+
greet() = print("Hello World!")
4+
5+
end # module URLSourceInDevvedPackage
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
using URLSourceInDevvedPackage
2+
using TestMonorepo

0 commit comments

Comments
 (0)