kcl-lang / kpm

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

Bug(v0.9.0-rc): Downloading modules fails with /tmp on tmpfs #370

Closed ngergs closed 2 months ago

ngergs commented 3 months ago

Bug Report

1. Minimal reproduce step (Required)

Use the kcl cli and have on linux /tmp on a tmpfs (or any filesystem separate from where the cli will be executed)

kcl mod init && kcl mod add k8s

Relevant excerpt from mount:

tmpfs on /tmp type tmpfs (rw,nosuid,nodev,nr_inodes=1048576,inode64)

2. What did you expect to see? (Required)

No error ;)

3. What did you see instead (Required)

adding dependency 'k8s'
downloading 'kcl-lang/k8s:1.30' from 'ghcr.io/kcl-lang/k8s:1.30'
rename /tmp/336415861 /home/ngergs/.kcl/kpm/k8s_1.30: invalid cross-device link

4. What is your KCL components version? (Required)

kcl cli is 0.9.0-rc.1-linux-amd64

5. Error origin

The bug originates from here.

os.Rename is just a thin wrapper around syscall.Rename which errors if source and destination are not on the same filesystem.

Possible quickfixes that I see after glancing over it:

Peefy commented 3 months ago

Thanks for the feedback. PRs welcome or I'll take it later. ❤