You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Do not require vendoring packages in git (i.e., use a global cache) #2503
CUE only looks for packages in cue.mod/{pkg,gen,usr} (merging these directories). This has required us to commit packages to git.
Solution
We do have our own dagger.mod and dagger.sum files, like Go. We can make them good enough to be depended on to reinstall packages in new git clones like in CI (verifying checksums). This makes committing cue.mod/pkg less necessary.
But I want to propose using a global cache here.
Global cache
We can take a hint from cuemod, which downloads modules into a global cache (GOMODCACHE in that case), and then symlinking them into cue.mod/pkg. @morlay took inspiration from pnpm (homebrew does this as well), although it uses hard links instead of symlinks (there's a whole discussion on why that's better).
We could do the same. Use the global cache to avoid re-downloading repos and also for verifying the checksums. At which point, link packages into cue.mod/pkg so that CUE can read them. CI can also be configured to cache this directory.
Ask upstream to add setting
It would be much better if upstream supported looking for packages in a $CUEMODCACHE environment variable, besides cue.mod/pkg, even if they don't use/manage it themselves yet. It would avoid the need to symlink and I think it's a very easy change on their part. Planned even.
UPDATE: not an easy change to ask because of lack of version concept.
changed the title [-]Do not require to commit vendored packages in git (e.g. commit only `dagger.mod` and `dagger.sum`, just like go)[/-][+]Do not require to commit vendored packages in git[/+]on May 24, 2022
changed the title [-]Do not require to commit vendored packages in git[/-][+]Do not require vendoring packages in git (i.e., use a global cache)[/+]on May 24, 2022
For the global cache to work, we need to support multiple versions of packages, so it's not a simple ask for upstream to add the setting because there's no concept of module versions yet.
Activity
[-]Do not require to commit vendored packages in git (e.g. commit only `dagger.mod` and `dagger.sum`, just like go)[/-][+]Do not require to commit vendored packages in git[/+][-]Do not require to commit vendored packages in git[/-][+]Do not require vendoring packages in git (i.e., use a global cache)[/+]helderco commentedon May 26, 2022
For the global cache to work, we need to support multiple versions of packages, so it's not a simple ask for upstream to add the setting because there's no concept of module versions yet.
Example:
helderco commentedon Dec 22, 2022
Closing. More context in parent issue: #2163.