Skip to content

Commit

Permalink
use .cache instead of _cache, because currently V allows for `import …
Browse files Browse the repository at this point in the history
…_cache`, but not `import .cache`
  • Loading branch information
spytheman committed Oct 10, 2024
1 parent 6c8e137 commit 9fc4e7f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cmd/tools/vpm/settings.v
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ fn init_settings() VpmSettings {
}
if !is_ci && !is_dbg {
// Log by default:
cache_path := os.join_path(vmodules_path, '_cache')
cache_path := os.join_path(vmodules_path, '.cache')
os.mkdir_all(cache_path, mode: 0o700) or { panic(err) }
logger.set_output_path(os.join_path(cache_path, 'vpm.log'))
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vpm/vpm.v
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const default_vpm_server_urls = ['https://vpm.vlang.io', 'https://vpm.url4e.com'
const vpm_server_urls = rand.shuffle_clone(default_vpm_server_urls) or { [] } // ensure that all queries are distributed fairly
const valid_vpm_commands = ['help', 'search', 'install', 'update', 'upgrade', 'outdated', 'list',
'remove', 'show']
const excluded_dirs = ['_cache', 'vlib']
const excluded_dirs = ['.cache', 'vlib']

fn main() {
// This tool is intended to be launched by the v frontend,
Expand Down
2 changes: 1 addition & 1 deletion vlib/v/gen/c/embed.v
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ fn (mut g Gen) gen_embed_file_init(mut node ast.ComptimeCall) {
if node.embed_file.compression_type == 'none' {
node.embed_file.bytes = file_bytes
} else {
cache_dir := os.join_path(os.vmodules_dir(), '_cache', 'embed_file')
cache_dir := os.join_path(os.vmodules_dir(), '.cache', 'embed_file')
cache_key := rand.ulid()
// cache_key := md5.hexhash(node.embed_file.apath)
if !os.exists(cache_dir) {
Expand Down
2 changes: 1 addition & 1 deletion vlib/v/tests/multiple_paths_in_vmodules/path1/.gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## this folder is the first one that will be put in vmodules.
## V uses that to put there its cache too.
## Just ignore it for now.
_cache/
.cache/
2 changes: 1 addition & 1 deletion vlib/v/vcache/vcache.v
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ pub mut:
pub fn new_cache_manager(opts []string) CacheManager {
mut vcache_basepath := os.getenv('VCACHE')
if vcache_basepath == '' {
vcache_basepath = os.join_path(os.vmodules_dir(), '_cache') // use a path, that would not conflict with a user installable module
vcache_basepath = os.join_path(os.vmodules_dir(), '.cache') // use a path, that would not conflict with a user installable module
}
nlog(@FN, 'vcache_basepath: ${vcache_basepath}\n opts: ${opts}\n os.args: ${os.args.join(' ')}')
dlog(@FN, 'vcache_basepath: ${vcache_basepath} | opts:\n ${opts}')
Expand Down

0 comments on commit 9fc4e7f

Please sign in to comment.