pinokiod 3.3.12 → 3.3.14

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.
package/kernel/bin/vs.js CHANGED
@@ -125,7 +125,8 @@ class VS {
125
125
  PATH: [
126
126
  // "C:\\Windows\\System32",
127
127
  "C:\\Windows\\System32\\WindowsPowerShell\\v1.0",
128
- ]
128
+ ],
129
+ BUILD_PATH: paths.BUILD_PATH
129
130
  }
130
131
 
131
132
  if (paths.MSVC_PATH) env.PATH = env.PATH.concat(paths.MSVC_PATH)
package/kernel/shell.js CHANGED
@@ -657,14 +657,53 @@ class Shell {
657
657
 
658
658
 
659
659
  if (this.platform === "win32") {
660
- const vs_path_env = this.kernel.bin.vs_path_env
661
- console.log({ vs_path_env })
662
- if (vs_path_env && vs_path_env.PATH) {
663
- this.env.VS_RELATED_PATHS = `${vs_path_env.PATH.join(path.delimiter)}${path.delimiter}`
664
- const vs = `set PATH=%VS_RELATED_PATHS%${path.delimiter}%PATH%`
665
- console.log({ vs })
666
- conda_activation.push(vs)
660
+ try {
661
+ const architecture = os.arch().toLowerCase(); // 'x64', 'ia32' (32-bit), etc.
662
+ const armArchitecture = process.arch.toLowerCase(); // For ARM-based architectures (on Windows), process.arch might be 'arm64', 'arm', etc.
663
+
664
+ // Map architectures to vcvarsall.bat argument
665
+ let arg
666
+ if (architecture === 'x64' || armArchitecture === 'arm64') {
667
+ arg = 'x64'; // 64-bit architecture
668
+ } else if (architecture === 'ia32' || armArchitecture === 'arm') {
669
+ arg = 'x86'; // 32-bit architecture
670
+ } else if (armArchitecture === 'amd64_arm') {
671
+ arg = 'amd64_arm'; // ARM-specific 64-bit
672
+ } else if (armArchitecture === 'x86_arm') {
673
+ arg = 'x86_arm'; // ARM-based 32-bit
674
+ }
675
+ if (architecture === 'x64' || armArchitecture === 'arm64') {
676
+ arg = 'amd64'; // Native 64-bit architecture
677
+ } else if (architecture === 'ia32' || armArchitecture === 'arm') {
678
+ arg = 'x86'; // Native 32-bit architecture
679
+ } else if (armArchitecture === 'x86_arm64') {
680
+ arg = 'x86_arm64'; // ARM64 on x86
681
+ } else if (armArchitecture === 'x86_arm') {
682
+ arg = 'x86_arm'; // ARM on x86
683
+ } else if (armArchitecture === 'amd64_arm64') {
684
+ arg = 'amd64_arm64'; // ARM64 on x64
685
+ } else if (armArchitecture === 'amd64_arm') {
686
+ arg = 'amd64_arm'; // ARM on x64
687
+ } else {
688
+ console.log(`Unsupported arch: os.arch()=${architecture}, process.arch=${armArchitecture}`)
689
+ }
690
+
691
+ if (arg) {
692
+ let vcvars_path = path.resolve(this.kernel.bin.vs_path_env.BUILD_PATH, "vcvarsall.exe")
693
+ console.log({ arg, vcvars_path })
694
+ conda_activation.push(`${vcvars_path} ${arg} > nul 2>&1`)
695
+ }
696
+ } catch (e) {
667
697
  }
698
+
699
+ // const vs_path_env = this.kernel.bin.vs_path_env
700
+ // console.log({ vs_path_env })
701
+ // if (vs_path_env && vs_path_env.PATH) {
702
+ // this.env.VS_RELATED_PATHS = `${vs_path_env.PATH.join(path.delimiter)}${path.delimiter}`
703
+ // const vs = `set PATH=%VS_RELATED_PATHS%${path.delimiter}%PATH%`
704
+ // console.log({ vs })
705
+ // conda_activation.push(vs)
706
+ // }
668
707
  }
669
708
 
670
709
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.3.12",
3
+ "version": "3.3.14",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {