oven-sh / bun

Incredibly fast JavaScript runtime, bundler, test runner, and package manager – all in one
https://bun.sh
Other
73.28k stars 2.69k forks source link

`install.cache.dir` completely ignored #6423

Open wojtekmaj opened 11 months ago

wojtekmaj commented 11 months ago

What version of Bun is running?

1.0.5+1bf28e0d77a8b2261befbdb708cefd03e0126960

What platform is your computer?

Darwin 23.0.0 arm64 arm

What steps can reproduce the bug?

Create global .bunfig.toml with the following:

[install.cache]
dir = ".bun/cache"

And/or, create local bunfig.toml with the same contents

Run bun pm cache

What is the expected behavior?

install cache dir to be set to .bun/cache directory relative to project's root

What do you see instead?

install cache dir option completely ignored

Additional information

image
uncenter commented 9 months ago

I'm also seeing this:

uncenter commented 9 months ago

This issue seems like a duplicate of the more general #5636.

LiamMartens commented 8 months ago

This issue seems like a duplicate of the more general #5636.

This problem also appears using a local config. This problem prohibits Gitlab CI from persisting the cache across jobs without a workaround

michelalbers commented 5 months ago

Same issue here ... cannot use it in CI since the option is completely ignored.

Leftium commented 5 months ago

This env var works: BUN_INSTALL_CACHE_DIR (Windows + git bash; env var set via Windows settings.)

image

SeanGriffin-Wellsky commented 5 months ago

In case anyone wondered, the env var workaround mentioned above works for non-Windows as well (at least Mac, I'd assume Linux as well).

jakubknejzlik commented 1 month ago

It seems, that this also applies to --cache-dir option as running install with it ignores any value.

Quick test on macos:

$ bun pm cache --cache-dir .bun 
/Users/john.doe/.bun/install/cache

$ BUN_INSTALL_CACHE_DIR=.bun bun pm cache           
/Users/my/current/path/.bun
ragavpr commented 2 weeks ago

Tested valid config locations

Current workaround