Skip to content

Commit bede720

Browse files
authored
Merge pull request #287 from zong-zhe/fix-missing-mod
fix: fix missing deps in local path
2 parents 90314fd + 3d2873b commit bede720

File tree

21 files changed

+55
-1
lines changed

21 files changed

+55
-1
lines changed

pkg/client/client.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,10 @@ func (c *KpmClient) ResolvePkgDepsMetadata(kclPkg *pkg.KclPkg, update bool) erro
248248
return err
249249
}
250250
d.FromKclPkg(depPkg)
251-
kclPkg.Dependencies.Deps[name] = d
251+
err = c.AddDepToPkg(kclPkg, &d)
252+
if err != nil {
253+
return err
254+
}
252255
} else {
253256
// Otherwise, re-vendor it.
254257
if kclPkg.IsVendorMode() {
@@ -815,6 +818,11 @@ func (c *KpmClient) Download(dep *pkg.Dependency, homePath, localPath string) (*
815818
return nil, err
816819
}
817820
dep.FromKclPkg(kpkg)
821+
abspath, err := filepath.Abs(dep.GetLocalFullPath(homePath))
822+
if err != nil {
823+
return nil, err
824+
}
825+
dep.Source.Local.Path = abspath
818826
}
819827

820828
var err error
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[package]
2+
name = "test_add_with_name"
3+
edition = "v0.8.0"
4+
version = "0.0.1"
5+

test/e2e/test_suites/test_data/test_add_with_name/kcl.mod.lock

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The_first_kcl_program = 'Hello World!'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
name = "pkg2"
3+
edition = "v0.8.0"
4+
version = "0.0.1"
5+
6+
[dependencies]
7+
pkg3 = { path = "../pkg3" }
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[dependencies]
2+
[dependencies.pkg3]
3+
name = "pkg3"
4+
full_name = "pkg3_0.0.1"
5+
version = "0.0.1"
6+
sum = "T29gAv6K/tLithhP5jVHyurV5zRFui+i1ulyMt/ncnM="
7+
path = "../pkg3"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import pkg3
2+
3+
The_first_kcl_program = pkg3.The_first_kcl_program
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
[package]
2+
name = "pkg3"
3+
edition = "v0.8.0"
4+
version = "0.0.1"
5+

test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg/pkg3/kcl.mod.lock

Whitespace-only changes.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
The_first_kcl_program = 'Hello World!'
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[package]
2+
name = "pkg1"
3+
edition = "v0.8.0"
4+
version = "0.0.1"
5+
6+
[dependencies]
7+
pkg2 = { path = "../pkg/pkg2" }
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[dependencies]
2+
[dependencies.pkg2]
3+
name = "pkg2"
4+
full_name = "pkg2_0.0.1"
5+
version = "0.0.1"
6+
sum = "JbfIAXPJb3L6xX7hi/A5mrXzjpB8eFoKfEmJMdHsewY="
7+
path = "../pkg/pkg2"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import pkg2
2+
3+
The_first_kcl_program = pkg2.The_first_kcl_program

0 commit comments

Comments
 (0)