pinokiod 5.1.23 → 5.1.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/kernel/shell.js +17 -8
  2. package/package.json +1 -1
package/kernel/shell.js CHANGED
@@ -973,16 +973,25 @@ class Shell {
973
973
  }
974
974
 
975
975
  const compiler_log = '"%TEMP%\\pinokio-vs.log"'
976
- const compiler_cmd = [
977
- `if exist "%CONDA_PREFIX%\\etc\\conda\\activate.d\\pinokio\\vs2019_compiler_vars.bat" (call "%CONDA_PREFIX%\\etc\\conda\\activate.d\\pinokio\\vs2019_compiler_vars.bat" > ${compiler_log} 2>&1)`,
978
- `else if exist "%CONDA_PREFIX%\\etc\\conda\\activate.d\\pinokio\\vs2022_compiler_vars.bat" (call "%CONDA_PREFIX%\\etc\\conda\\activate.d\\pinokio\\vs2022_compiler_vars.bat" > ${compiler_log} 2>&1)`,
979
- `else if exist "%CONDA_PREFIX%\\etc\\conda\\activate.d\\vs2019_compiler_vars.bat" (call "%CONDA_PREFIX%\\etc\\conda\\activate.d\\vs2019_compiler_vars.bat" > ${compiler_log} 2>&1)`,
980
- `else if exist "%CONDA_PREFIX%\\etc\\conda\\activate.d\\vs2022_compiler_vars.bat" (call "%CONDA_PREFIX%\\etc\\conda\\activate.d\\vs2022_compiler_vars.bat" > ${compiler_log} 2>&1)`,
976
+ const activate_root = this.kernel.bin.path("miniconda/etc/conda/activate.d")
977
+ const compiler_candidates = [
978
+ path.resolve(activate_root, "pinokio", "vs2019_compiler_vars.bat"),
979
+ path.resolve(activate_root, "pinokio", "vs2022_compiler_vars.bat"),
980
+ path.resolve(activate_root, "vs2019_compiler_vars.bat"),
981
+ path.resolve(activate_root, "vs2022_compiler_vars.bat"),
981
982
  ]
982
- if (vcvars_path && arg) {
983
- compiler_cmd.push(`else if exist "${vcvars_path}" (CALL "${vcvars_path}" ${arg} > ${compiler_log} 2>&1)`)
983
+ let compiler_script = null
984
+ for (const candidate of compiler_candidates) {
985
+ if (await this.exists(candidate)) {
986
+ compiler_script = candidate
987
+ break
988
+ }
989
+ }
990
+ if (compiler_script) {
991
+ conda_activation.push(`CALL "${compiler_script}" > ${compiler_log} 2>&1`)
992
+ } else if (vcvars_path && arg) {
993
+ conda_activation.push(`CALL "${vcvars_path}" ${arg} > ${compiler_log} 2>&1`)
984
994
  }
985
- conda_activation.push(compiler_cmd.join(" "))
986
995
  conda_activation.push("@echo off")
987
996
  conda_activation.push("set TORCH_CUDA_ARCH_LIST=")
988
997
  conda_activation.push("set CUDAARCHS=")
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "5.1.23",
3
+ "version": "5.1.24",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {