cache config in package.cm

This commit is contained in:
2026-01-15 15:54:58 -06:00
parent 78a46b4a72
commit 5018901acb
2 changed files with 17 additions and 12 deletions

View File

@@ -517,25 +517,17 @@ function resolve_locator(path, ctx)
// Generate symbol name for a C module file
// Uses the same format as Shop.c_symbol_for_file
// Resolves linked packages to their actual target first
// Symbol names are based on canonical package names, not link targets
function make_c_symbol(pkg, file) {
// Check if this package is linked - if so, use the link target for symbol name
var link_target = link.get_target(pkg)
var resolved_pkg = link_target ? link_target : pkg
var pkg_safe = resolved_pkg.replace(/\//g, '_').replace(/\./g, '_').replace(/-/g, '_')
var pkg_safe = pkg.replace(/\//g, '_').replace(/\./g, '_').replace(/-/g, '_')
var file_safe = file.replace(/\//g, '_').replace(/\./g, '_').replace(/-/g, '_')
return 'js_' + pkg_safe + '_' + file_safe + '_use'
}
// Get the library path for a package in .cell/lib
// Resolves linked packages to their actual target first
// Library names are based on canonical package names, not link targets
function get_lib_path(pkg) {
// Check if this package is linked - if so, use the link target
var link_target = link.get_target(pkg)
var resolved_pkg = link_target ? link_target : pkg
var lib_name = resolved_pkg.replace(/\//g, '_').replace(/\./g, '_').replace(/-/g, '_')
var lib_name = pkg.replace(/\//g, '_').replace(/\./g, '_').replace(/-/g, '_')
return global_shop_path + '/lib/' + lib_name + dylib_ext
}