more detail on broken pipeline and vm suit tests
This commit is contained in:
@@ -21,6 +21,54 @@ var my$_ = actor_api
|
||||
|
||||
var core = "core"
|
||||
|
||||
// Generate a random 5-letter uppercase identifier for package symbol naming.
|
||||
// Avoids collisions with existing IDs and "CORE".
|
||||
function generate_package_id() {
|
||||
var lock = Shop.load_lock()
|
||||
var existing = {}
|
||||
var keys = array(lock)
|
||||
var _i = 0
|
||||
while (_i < length(keys)) {
|
||||
if (lock[keys[_i]] && lock[keys[_i]].id)
|
||||
existing[lock[keys[_i]].id] = true
|
||||
_i = _i + 1
|
||||
}
|
||||
existing["CORE"] = true
|
||||
|
||||
var id = null
|
||||
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
|
||||
var _j = 0
|
||||
while (true) {
|
||||
id = ""
|
||||
_j = 0
|
||||
while (_j < 5) {
|
||||
id = id + chars[abs(os.random()) % 26]
|
||||
_j = _j + 1
|
||||
}
|
||||
if (!existing[id]) return id
|
||||
}
|
||||
}
|
||||
|
||||
// Get the assigned ID for a package, generating one if needed.
|
||||
// Core always returns "core". Other packages get a random 5-letter ID
|
||||
// assigned lazily on first use and persisted in lock.toml.
|
||||
function get_package_id(pkg) {
|
||||
if (pkg == core) return core
|
||||
|
||||
var lock = Shop.load_lock()
|
||||
var entry = lock[pkg]
|
||||
if (entry && entry.id) return entry.id
|
||||
|
||||
var id = generate_package_id()
|
||||
if (!entry) {
|
||||
entry = {}
|
||||
lock[pkg] = entry
|
||||
}
|
||||
entry.id = id
|
||||
Shop.save_lock(lock)
|
||||
return id
|
||||
}
|
||||
|
||||
function pull_from_cache(content)
|
||||
{
|
||||
var path = hash_path(content)
|
||||
@@ -593,12 +641,11 @@ function resolve_locator(path, ctx)
|
||||
}
|
||||
|
||||
// Generate symbol name for a C module file
|
||||
// Uses the same format as Shop.c_symbol_for_file
|
||||
// Symbol names are based on canonical package names, not link targets
|
||||
// Uses the package's assigned ID (5-letter random or "core") instead of the full name
|
||||
function make_c_symbol(pkg, file) {
|
||||
var pkg_safe = replace(replace(replace(pkg, '/', '_'), '.', '_'), '-', '_')
|
||||
var pkg_id = get_package_id(pkg)
|
||||
var file_safe = replace(replace(replace(file, '/', '_'), '.', '_'), '-', '_')
|
||||
return 'js_' + pkg_safe + '_' + file_safe + '_use'
|
||||
return 'js_' + pkg_id + '_' + file_safe + '_use'
|
||||
}
|
||||
|
||||
// Get the deterministic dylib path for a module in lib/<pkg>/<stem>.dylib
|
||||
@@ -1360,28 +1407,32 @@ Shop.get_package_dir = function(pkg) {
|
||||
}
|
||||
|
||||
// Generate C symbol name for a file within a package
|
||||
// e.g., c_symbol_for_file('gitea.pockle.world/john/prosperon', 'sprite.c')
|
||||
// -> 'js_gitea_pockle_world_john_prosperon_sprite_use'
|
||||
// Uses the package's assigned ID (e.g., "WAWOF") instead of the full name
|
||||
// e.g., c_symbol_for_file('gitea.pockle.world/john/prosperon', 'sprite.c')
|
||||
// -> 'js_WAWOF_sprite_use'
|
||||
Shop.c_symbol_for_file = function(pkg, file) {
|
||||
var pkg_safe = replace(replace(replace(pkg, '/', '_'), '.', '_'), '-', '_')
|
||||
var pkg_id = get_package_id(pkg)
|
||||
var file_safe = replace(replace(fd.stem(file), '/', '_'), '.', '_')
|
||||
var suffix = ends_with(file, '.ce') ? '_program' : '_use'
|
||||
return 'js_' + pkg_safe + '_' + file_safe + suffix
|
||||
return 'js_' + pkg_id + '_' + file_safe + suffix
|
||||
}
|
||||
|
||||
// Generate C symbol prefix for a package
|
||||
// e.g., c_symbol_prefix('gitea.pockle.world/john/prosperon') -> 'js_gitea_pockle_world_john_prosperon_'
|
||||
// e.g., c_symbol_prefix('gitea.pockle.world/john/prosperon') -> 'js_WAWOF_'
|
||||
Shop.c_symbol_prefix = function(pkg) {
|
||||
var pkg_safe = replace(replace(replace(pkg, '/', '_'), '.', '_'), '-', '_')
|
||||
return 'js_' + pkg_safe + '_'
|
||||
var pkg_id = get_package_id(pkg)
|
||||
return 'js_' + pkg_id + '_'
|
||||
}
|
||||
|
||||
// Get the library name for a package (without extension)
|
||||
// e.g., 'gitea.pockle.world/john/prosperon' -> 'gitea_pockle_world_john_prosperon'
|
||||
// Get the library name for a package
|
||||
// e.g., 'gitea.pockle.world/john/prosperon' -> 'WAWOF'
|
||||
Shop.lib_name_for_package = function(pkg) {
|
||||
return replace(replace(replace(pkg, '/', '_'), '.', '_'), '-', '_')
|
||||
return get_package_id(pkg)
|
||||
}
|
||||
|
||||
// Get the assigned package ID (public API)
|
||||
Shop.get_package_id = get_package_id
|
||||
|
||||
// Returns { ok: bool, results: [{pkg, ok, error}] }
|
||||
// Get the deterministic dylib path for a module (public API)
|
||||
Shop.get_dylib_path = function(pkg, stem) {
|
||||
|
||||
Reference in New Issue
Block a user