| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
tool_wrapper: add missing wrappers and drop tools that don't need them Purpose: - Fix "No wrapper script found for tool: node" error - Reduce code duplication by using symlinks for related tools - Drop tools that don't download packages and don't need wrappers Problem: - node, bundle, mvn listed in SUPPORTED_TOOLS but no wrapper scripts - gofmt, rustc, java, javac don't download packages, don't need wrappers - gofmt: code formatter only - rustc: compiler only (cargo handles downloads) - java: runtime only (mvn handles downloads) - javac: compiler only Solution: - Create symlinks: - node -> npm (shares npm_config_registry) - bundle -> shell-wrapper.sh (generic wrapper) - mvn -> shell-wrapper.sh (generic wrapper) - Add node, npx to TOOL_SYMLINKS to share npm's config - Remove gofmt, rustc, java, javac from: - SUPPORTED_TOOLS - TOOL_CONFIG_FILES - TOOL_ENV_VARS - TOOL_ALT_PATHS Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 5 个月前 | |
tool_wrapper: add mirror acceleration for pip/npm/gem/go/cargo Purpose: Automatically inject mirror environment variables for common package managers when running in epkg environment, accelerating downloads for users in regions like China, EU, etc. Solution: - Create wrapper scripts in $env_root/usr/local/bin/ that: 1. Read region-specific mirror config from ~/.config/epkg/tool/my_region/{tool}.yaml 2. Export mirror env vars if not already set 3. Execute the original tool binary - Setup symlinks on 'epkg self install': - ~/.config/epkg/tool/env_vars -> $EPKG_SRC/assets/tool/env_vars - ~/.config/epkg/tool/my_region -> {cn|eu|us} (based on country code) - Create wrappers on 'epkg install' after link_packages() - Skip wrapper if user config exists or env var already set Region mapping: - CN -> cn (China) - AT,BE,BG,HR,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HU,IE,IT,LT,LU,LV,MT,NL,PL,PT,RO,SE,SI,SK -> eu - US,JP,KR,AU,CA,NZ -> us Files: - assets/tool/env_vars/{cn}/*.yaml - mirror config for each region - assets/tool/wrappers/pip - Python wrapper (imports pip directly) - assets/tool/wrappers/npm - Node.js wrapper - assets/tool/wrappers/gem - Ruby wrapper - assets/tool/wrappers/shell-wrapper.sh - generic shell wrapper - assets/tool/wrappers/{go,cargo} -> shell-wrapper.sh - src/tool_wrapper.rs - Rust module with setup functions Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 5 个月前 | |
tool_wrapper: move config from ~/.config/epkg to ~/.epkg/config Problem/Purpose: - Tool config at ~/.config/epkg/tool required separate virtiofs mount - ~/.epkg is already mounted in VM guest, so config under it needs no extra mount Solution: 1. Change config path from ~/.config/epkg/tool to ~/.epkg/config/tool 2. Update all wrapper scripts to use new path with EPKG_HOME support 3. Remove separate tool_config mount in libkrun/core.rs 4. Update docs and comments for new path Benefits: - Eliminates one virtiofs mount (virtiofs has limited device slots) - Config is under home_epkg which is already mounted - Simpler code, no special handling needed Files changed: - src/tool_wrapper.rs: get_tool_config_dir() path change - assets/tool/wrappers/*: config path + EPKG_HOME fallback - src/libkrun/core.rs: remove tool_config mount code - docs: update path references - src/models.rs, src/run.rs, CHANGELOG.md: comment updates Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
tool_wrapper: add mirror acceleration for pip/npm/gem/go/cargo Purpose: Automatically inject mirror environment variables for common package managers when running in epkg environment, accelerating downloads for users in regions like China, EU, etc. Solution: - Create wrapper scripts in $env_root/usr/local/bin/ that: 1. Read region-specific mirror config from ~/.config/epkg/tool/my_region/{tool}.yaml 2. Export mirror env vars if not already set 3. Execute the original tool binary - Setup symlinks on 'epkg self install': - ~/.config/epkg/tool/env_vars -> $EPKG_SRC/assets/tool/env_vars - ~/.config/epkg/tool/my_region -> {cn|eu|us} (based on country code) - Create wrappers on 'epkg install' after link_packages() - Skip wrapper if user config exists or env var already set Region mapping: - CN -> cn (China) - AT,BE,BG,HR,CY,CZ,DE,DK,EE,ES,FI,FR,GB,GR,HU,IE,IT,LT,LU,LV,MT,NL,PL,PT,RO,SE,SI,SK -> eu - US,JP,KR,AU,CA,NZ -> us Files: - assets/tool/env_vars/{cn}/*.yaml - mirror config for each region - assets/tool/wrappers/pip - Python wrapper (imports pip directly) - assets/tool/wrappers/npm - Node.js wrapper - assets/tool/wrappers/gem - Ruby wrapper - assets/tool/wrappers/shell-wrapper.sh - generic shell wrapper - assets/tool/wrappers/{go,cargo} -> shell-wrapper.sh - src/tool_wrapper.rs - Rust module with setup functions Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 5 个月前 | |
tool_wrapper: add missing wrappers and drop tools that don't need them Purpose: - Fix "No wrapper script found for tool: node" error - Reduce code duplication by using symlinks for related tools - Drop tools that don't download packages and don't need wrappers Problem: - node, bundle, mvn listed in SUPPORTED_TOOLS but no wrapper scripts - gofmt, rustc, java, javac don't download packages, don't need wrappers - gofmt: code formatter only - rustc: compiler only (cargo handles downloads) - java: runtime only (mvn handles downloads) - javac: compiler only Solution: - Create symlinks: - node -> npm (shares npm_config_registry) - bundle -> shell-wrapper.sh (generic wrapper) - mvn -> shell-wrapper.sh (generic wrapper) - Add node, npx to TOOL_SYMLINKS to share npm's config - Remove gofmt, rustc, java, javac from: - SUPPORTED_TOOLS - TOOL_CONFIG_FILES - TOOL_ENV_VARS - TOOL_ALT_PATHS Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 5 个月前 | |
expose: fix Node.js ebin wrappers for npm/node/npx Root Cause: 1. The node wrapper was a symlink to npm wrapper (Node.js script), which tried to require('/usr/bin/node') - creating circular dependency (needing Node.js to run Node.js) 2. npm/npx wrappers used require() to load Node.js scripts, breaking module resolution 3. ebin wrappers pointed to store paths instead of env paths 4. ebin/sh shebang (elf-loader) requires SOURCE_ENV_DIR, unavailable when running wrappers directly Solution: 1. Changed node wrapper symlink from npm to shell-wrapper.sh 2. Changed npm/npx to symlinks to shell-wrapper.sh in assets/ 3. Updated get_exec_command() to: - Convert store paths to env paths for proper module resolution - Special handling for npm/npx to call -cli.js files directly 4. Updated create_script_wrapper() to use #!/bin/sh for NodeScript and npm/npx Reproduce: epkg -e dev-openeuler install nodejs npm node Then: ENV_ROOT=... envs/dev-openeuler/ebin/npm --version Error was: "Argument list too long" or "Cannot find module '/usr/bin/node_modules/...'" Fixes: ./tests/dev-projects/run.sh -o openeuler -t node | 5 个月前 | |
expose: fix Node.js ebin wrappers for npm/node/npx Root Cause: 1. The node wrapper was a symlink to npm wrapper (Node.js script), which tried to require('/usr/bin/node') - creating circular dependency (needing Node.js to run Node.js) 2. npm/npx wrappers used require() to load Node.js scripts, breaking module resolution 3. ebin wrappers pointed to store paths instead of env paths 4. ebin/sh shebang (elf-loader) requires SOURCE_ENV_DIR, unavailable when running wrappers directly Solution: 1. Changed node wrapper symlink from npm to shell-wrapper.sh 2. Changed npm/npx to symlinks to shell-wrapper.sh in assets/ 3. Updated get_exec_command() to: - Convert store paths to env paths for proper module resolution - Special handling for npm/npx to call -cli.js files directly 4. Updated create_script_wrapper() to use #!/bin/sh for NodeScript and npm/npx Reproduce: epkg -e dev-openeuler install nodejs npm node Then: ENV_ROOT=... envs/dev-openeuler/ebin/npm --version Error was: "Argument list too long" or "Cannot find module '/usr/bin/node_modules/...'" Fixes: ./tests/dev-projects/run.sh -o openeuler -t node | 5 个月前 | |
expose: fix Node.js ebin wrappers for npm/node/npx Root Cause: 1. The node wrapper was a symlink to npm wrapper (Node.js script), which tried to require('/usr/bin/node') - creating circular dependency (needing Node.js to run Node.js) 2. npm/npx wrappers used require() to load Node.js scripts, breaking module resolution 3. ebin wrappers pointed to store paths instead of env paths 4. ebin/sh shebang (elf-loader) requires SOURCE_ENV_DIR, unavailable when running wrappers directly Solution: 1. Changed node wrapper symlink from npm to shell-wrapper.sh 2. Changed npm/npx to symlinks to shell-wrapper.sh in assets/ 3. Updated get_exec_command() to: - Convert store paths to env paths for proper module resolution - Special handling for npm/npx to call -cli.js files directly 4. Updated create_script_wrapper() to use #!/bin/sh for NodeScript and npm/npx Reproduce: epkg -e dev-openeuler install nodejs npm node Then: ENV_ROOT=... envs/dev-openeuler/ebin/npm --version Error was: "Argument list too long" or "Cannot find module '/usr/bin/node_modules/...'" Fixes: ./tests/dev-projects/run.sh -o openeuler -t node | 5 个月前 | |
tool_wrapper: move config from ~/.config/epkg to ~/.epkg/config Problem/Purpose: - Tool config at ~/.config/epkg/tool required separate virtiofs mount - ~/.epkg is already mounted in VM guest, so config under it needs no extra mount Solution: 1. Change config path from ~/.config/epkg/tool to ~/.epkg/config/tool 2. Update all wrapper scripts to use new path with EPKG_HOME support 3. Remove separate tool_config mount in libkrun/core.rs 4. Update docs and comments for new path Benefits: - Eliminates one virtiofs mount (virtiofs has limited device slots) - Config is under home_epkg which is already mounted - Simpler code, no special handling needed Files changed: - src/tool_wrapper.rs: get_tool_config_dir() path change - assets/tool/wrappers/*: config path + EPKG_HOME fallback - src/libkrun/core.rs: remove tool_config mount code - docs: update path references - src/models.rs, src/run.rs, CHANGELOG.md: comment updates Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 | |
tool_wrapper: add pip3 wrapper symlink Purpose: Fix "No wrapper script found for tool: pip3" error when running python tests on fedora and other distros. Solution: Create assets/tool/wrappers/pip3 as a symlink to pip wrapper. The pip wrapper already handles both 'pip' and 'pip3' via sys.argv[0] inspection. This follows the existing pattern used for npm/npx/node/gem/bundle/go/cargo/mvn which all use symlinks to share wrapper code. Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 5 个月前 | |
tool_wrapper: move config from ~/.config/epkg to ~/.epkg/config Problem/Purpose: - Tool config at ~/.config/epkg/tool required separate virtiofs mount - ~/.epkg is already mounted in VM guest, so config under it needs no extra mount Solution: 1. Change config path from ~/.config/epkg/tool to ~/.epkg/config/tool 2. Update all wrapper scripts to use new path with EPKG_HOME support 3. Remove separate tool_config mount in libkrun/core.rs 4. Update docs and comments for new path Benefits: - Eliminates one virtiofs mount (virtiofs has limited device slots) - Config is under home_epkg which is already mounted - Simpler code, no special handling needed Files changed: - src/tool_wrapper.rs: get_tool_config_dir() path change - assets/tool/wrappers/*: config path + EPKG_HOME fallback - src/libkrun/core.rs: remove tool_config mount code - docs: update path references - src/models.rs, src/run.rs, CHANGELOG.md: comment updates Signed-off-by: Wu Fengguang <wfg@mail.ustc.edu.cn> | 3 个月前 |