kcl-lang / kpm

KCL Package Manager
https://kcl-lang.io
Apache License 2.0
27 stars 44 forks source link

Issues with kcl modules about the package re-downloading and local package deps #320

Closed dennybaa closed 5 months ago

dennybaa commented 6 months ago

Hello there, again thank you very much for a beautiful project.

I'm just filing an issue to keep track of it, though totally not crucial:

  1. Seems that the dependencies can be fetched twice.
kcl mod update
adding 'file-manifests' with version '0.1.0'
downloading 'some-org/iaas-kcl-modules/file-manifests:0.1.0' from 'ghcr.io/some-org/iaas-kcl-modules/file-manifests:0.1.0'
downloading 'some-org/iaas-kcl-modules/file-manifests:0.1.0' from 'ghcr.io/some-org/iaas-kcl-modules/file-manifests:0.1.0'
  1. Modules with local dependencies do not work.

Let's admit we have a remote module with the mod file (if I'm not wrong with the actual syntax) as bellow:

[package]
name = "file-manifets"
edition = "v0.8.0"
version = "0.1.0"

[dependencies]
k8s = { oci = "oci://ghcr.io/kcl-lang/k8s", tag = "1.28" }
names = { path = "../names" }

The above package after published is broken, since kcl mod later on tries to resolve names and this doesn't work... Something should be decided regarding this, like would it or not make sense to vendor local dependencies together with the package.

Peefy commented 6 months ago

Thanks for the feedback.

Related Issues:

cc @zong-zhe

dennybaa commented 6 months ago

Hello there @Peefy @zong-zhe , another issue which might be approached by the above enchancments:

1) kcl -dY kcl.yaml rules/main.k as expected 2) cd ../; kcl -dY main/kcl.yaml main/rules/main.k. Evidently tries to duplicate path...

    Error: Cannot find the kcl file, please check the file path /.../main/main/rules/main.k

3) cd ../; kcl -dY main/kcl.yaml rules/main.k. Already fails to resolve modules ....

Peefy commented 5 months ago
  1. Closed by https://github.com/kcl-lang/kpm/pull/327 https://github.com/kcl-lang/kpm/pull/330 https://github.com/kcl-lang/kpm/pull/331 https://github.com/kcl-lang/kpm/pull/332
  2. Closed by #327
  3. Closed by https://github.com/kcl-lang/kcl-go/pull/314