diff --git a/pkg/client/client.go b/pkg/client/client.go index f4ec621b..a8e86076 100644 --- a/pkg/client/client.go +++ b/pkg/client/client.go @@ -248,7 +248,10 @@ func (c *KpmClient) ResolvePkgDepsMetadata(kclPkg *pkg.KclPkg, update bool) erro return err } d.FromKclPkg(depPkg) - kclPkg.Dependencies.Deps[name] = d + err = c.AddDepToPkg(kclPkg, &d) + if err != nil { + return err + } } else { // Otherwise, re-vendor it. if kclPkg.IsVendorMode() { @@ -815,6 +818,11 @@ func (c *KpmClient) Download(dep *pkg.Dependency, homePath, localPath string) (* return nil, err } dep.FromKclPkg(kpkg) + abspath, err := filepath.Abs(dep.GetLocalFullPath(homePath)) + if err != nil { + return nil, err + } + dep.Source.Local.Path = abspath } var err error diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name/test_suite.env b/test/e2e/test_suites/kpm/kpm_add/test_add_with_name/test_suite.env similarity index 100% rename from test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name/test_suite.env rename to test/e2e/test_suites/kpm/kpm_add/test_add_with_name/test_suite.env diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name/test_suite.input b/test/e2e/test_suites/kpm/kpm_add/test_add_with_name/test_suite.input similarity index 100% rename from test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name/test_suite.input rename to test/e2e/test_suites/kpm/kpm_add/test_add_with_name/test_suite.input diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name/test_suite.stderr b/test/e2e/test_suites/kpm/kpm_add/test_add_with_name/test_suite.stderr similarity index 100% rename from test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name/test_suite.stderr rename to test/e2e/test_suites/kpm/kpm_add/test_add_with_name/test_suite.stderr diff --git a/test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name/test_suite.stdout b/test/e2e/test_suites/kpm/kpm_add/test_add_with_name/test_suite.stdout similarity index 100% rename from test/e2e/test_suites/kpm/exec_inside_pkg/add_with_name/test_suite.stdout rename to test/e2e/test_suites/kpm/kpm_add/test_add_with_name/test_suite.stdout diff --git a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path/test_suite.env b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path_0/test_suite.env similarity index 100% rename from test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path/test_suite.env rename to test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path_0/test_suite.env diff --git a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path/test_suite.input b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path_0/test_suite.input similarity index 100% rename from test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path/test_suite.input rename to test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path_0/test_suite.input diff --git a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path/test_suite.stderr b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path_0/test_suite.stderr similarity index 100% rename from test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path/test_suite.stderr rename to test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path_0/test_suite.stderr diff --git a/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path/test_suite.stdout b/test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path_0/test_suite.stdout similarity index 100% rename from test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path/test_suite.stdout rename to test/e2e/test_suites/kpm/kpm_run/test_kpm_run_multi_local_path_0/test_suite.stdout diff --git a/test/e2e/test_suites/test_data/test_add_with_name/kcl.mod b/test/e2e/test_suites/test_data/test_add_with_name/kcl.mod new file mode 100644 index 00000000..4c0ed5b2 --- /dev/null +++ b/test/e2e/test_suites/test_data/test_add_with_name/kcl.mod @@ -0,0 +1,5 @@ +[package] +name = "test_add_with_name" +edition = "v0.8.0" +version = "0.0.1" + diff --git a/test/e2e/test_suites/test_data/test_add_with_name/kcl.mod.lock b/test/e2e/test_suites/test_data/test_add_with_name/kcl.mod.lock new file mode 100644 index 00000000..e69de29b diff --git a/test/e2e/test_suites/test_data/test_add_with_name/main.k b/test/e2e/test_suites/test_data/test_add_with_name/main.k new file mode 100644 index 00000000..fa7048e6 --- /dev/null +++ b/test/e2e/test_suites/test_data/test_add_with_name/main.k @@ -0,0 +1 @@ +The_first_kcl_program = 'Hello World!' \ No newline at end of file diff --git a/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg/pkg2/kcl.mod b/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg/pkg2/kcl.mod new file mode 100644 index 00000000..bd4c9bfe --- /dev/null +++ b/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg/pkg2/kcl.mod @@ -0,0 +1,7 @@ +[package] +name = "pkg2" +edition = "v0.8.0" +version = "0.0.1" + +[dependencies] +pkg3 = { path = "../pkg3" } diff --git a/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg/pkg2/kcl.mod.lock b/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg/pkg2/kcl.mod.lock new file mode 100644 index 00000000..75909bea --- /dev/null +++ b/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg/pkg2/kcl.mod.lock @@ -0,0 +1,7 @@ +[dependencies] + [dependencies.pkg3] + name = "pkg3" + full_name = "pkg3_0.0.1" + version = "0.0.1" + sum = "T29gAv6K/tLithhP5jVHyurV5zRFui+i1ulyMt/ncnM=" + path = "../pkg3" diff --git a/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg/pkg2/main.k b/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg/pkg2/main.k new file mode 100644 index 00000000..ec3e4ceb --- /dev/null +++ b/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg/pkg2/main.k @@ -0,0 +1,3 @@ +import pkg3 + +The_first_kcl_program = pkg3.The_first_kcl_program \ No newline at end of file diff --git a/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg/pkg3/kcl.mod b/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg/pkg3/kcl.mod new file mode 100644 index 00000000..0f12aa22 --- /dev/null +++ b/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg/pkg3/kcl.mod @@ -0,0 +1,5 @@ +[package] +name = "pkg3" +edition = "v0.8.0" +version = "0.0.1" + diff --git a/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg/pkg3/kcl.mod.lock b/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg/pkg3/kcl.mod.lock new file mode 100644 index 00000000..e69de29b diff --git a/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg/pkg3/main.k b/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg/pkg3/main.k new file mode 100644 index 00000000..fa7048e6 --- /dev/null +++ b/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg/pkg3/main.k @@ -0,0 +1 @@ +The_first_kcl_program = 'Hello World!' \ No newline at end of file diff --git a/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg1/kcl.mod b/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg1/kcl.mod new file mode 100644 index 00000000..c8b0b9ae --- /dev/null +++ b/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg1/kcl.mod @@ -0,0 +1,7 @@ +[package] +name = "pkg1" +edition = "v0.8.0" +version = "0.0.1" + +[dependencies] +pkg2 = { path = "../pkg/pkg2" } diff --git a/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg1/kcl.mod.lock b/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg1/kcl.mod.lock new file mode 100644 index 00000000..c49fa9ad --- /dev/null +++ b/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg1/kcl.mod.lock @@ -0,0 +1,7 @@ +[dependencies] + [dependencies.pkg2] + name = "pkg2" + full_name = "pkg2_0.0.1" + version = "0.0.1" + sum = "JbfIAXPJb3L6xX7hi/A5mrXzjpB8eFoKfEmJMdHsewY=" + path = "../pkg/pkg2" diff --git a/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg1/main.k b/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg1/main.k new file mode 100644 index 00000000..93576dd4 --- /dev/null +++ b/test/e2e/test_suites/test_data/test_kpm_run_multi_local_path_0/pkg1/main.k @@ -0,0 +1,3 @@ +import pkg2 + +The_first_kcl_program = pkg2.The_first_kcl_program \ No newline at end of file