pinokiod 2.1.21 → 2.1.23

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.
@@ -8,6 +8,9 @@ class Registry {
8
8
 
9
9
  let res = await this.kernel.bin.exec({
10
10
  message: "reg query HKLM\\SYSTEM\\CurrentControlSet\\Control\\FileSystem /v LongPathsEnabled",
11
+ conda: {
12
+ skip: true
13
+ }
11
14
  }, (stream) => {
12
15
  })
13
16
  console.log("registry check", { res })
package/kernel/bin/vs.js CHANGED
@@ -26,60 +26,94 @@ class VS {
26
26
  }
27
27
  }
28
28
  async getpaths() {
29
- const ROOT_PATH = process.env["ProgramFiles(x86)"] || process.env["ProgramFiles"]
30
-
31
- const MSVC_2019_PATH = path.resolve(ROOT_PATH, "Microsoft Visual Studio", "2019", "BuildTools/VC/Tools/MSVC")
32
- const MSVC_2022_PATH = path.resolve(ROOT_PATH, "Microsoft Visual Studio", "2022", "BuildTools/VC/Tools/MSVC")
33
- const e1 = await this.kernel.bin.exists(MSVC_2019_PATH)
34
- const e2 = await this.kernel.bin.exists(MSVC_2022_PATH)
35
29
  let MSVC_PATH
36
- if (e1) {
37
- MSVC_PATH = MSVC_2019_PATH
38
- } else if (e2) {
39
- MSVC_PATH = MSVC_2022_PATH
40
- }
41
-
42
- const BUILD_2019_PATH = path.resolve(ROOT_PATH, "Microsoft Visual Studio", "2019", "BuildTools/VC/Auxiliary/Build")
43
- const BUILD_2022_PATH = path.resolve(ROOT_PATH, "Microsoft Visual Studio", "2022", "BuildTools/VC/Auxiliary/Build")
44
- const e3 = await this.kernel.bin.exists(BUILD_2019_PATH)
45
- const e4 = await this.kernel.bin.exists(BUILD_2022_PATH)
46
30
  let BUILD_PATH
47
- if (e3) {
48
- BUILD_PATH = BUILD_2019_PATH
49
- } else if (e4) {
50
- BUILD_PATH = BUILD_2022_PATH
51
- }
52
-
53
- const CMAKE_2019_PATH = path.resolve(ROOT_PATH, "Microsoft Visual Studio", "2019", "BuildTools/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin")
54
- const CMAKE_2022_PATH = path.resolve(ROOT_PATH, "Microsoft Visual Studio", "2022", "BuildTools/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin")
55
- const e5 = await this.kernel.bin.exists(CMAKE_2019_PATH)
56
- const e6 = await this.kernel.bin.exists(CMAKE_2022_PATH)
57
31
  let CMAKE_PATH
58
- if (e5) {
59
- CMAKE_PATH = CMAKE_2019_PATH
60
- } else if (e6) {
61
- CMAKE_PATH = CMAKE_2022_PATH
62
- }
63
-
64
- console.log({
65
- e1, e2, e3, e4, e5, e6,
66
- ROOT_PATH,
67
- MSVC_2019_PATH, MSVC_2022_PATH,
68
- BUILD_2019_PATH, BUILD_2022_PATH,
69
- CMAKE_2019_PATH, CMAKE_2022_PATH,
70
- MSVC_PATH,
71
- BUILD_PATH,
72
- CMAKE_PATH
73
- })
32
+ let CL_PATH
33
+ const program_file_paths = [process.env["ProgramFiles(x86)"], process.env["ProgramFiles"]]
34
+ for(let rp of program_file_paths) {
35
+ const ROOT_PATH = path.resolve(rp, "Microsoft Visual Studio")
74
36
 
37
+ const e1 = await this.kernel.bin.exists(ROOT_PATH)
38
+ if (e1) {
39
+ console.log("exists", ROOT_PATH)
40
+ MSVC_PATH = await glob('**/VC/Tools/MSVC', { cwd: ROOT_PATH })
41
+ if (MSVC_PATH.length > 0) {
42
+ console.log({ MSVC_PATH })
43
+ BUILD_PATH = await glob('**/VC/Auxiliary/Build', { cwd: ROOT_PATH })
44
+ console.log({ BUILD_PATH })
45
+ CMAKE_PATH = await glob('**/Microsoft/CMake/CMake/bin', { cwd: ROOT_PATH })
46
+ console.log({ CMAKE_PATH })
47
+ CL_PATH = await glob('**/Hostx64/x64/cl.exe', { cwd: ROOT_PATH })
48
+ break;
49
+ }
50
+ }
51
+ }
52
+ console.log({ MSVC_PATH, BUILD_PATH, CMAKE_PATH, CL_PATH })
75
53
  return {
76
- ROOT_PATH,
54
+ // ROOT_PATH,
77
55
  MSVC_PATH,
78
56
  BUILD_PATH,
79
- CMAKE_PATH
57
+ CMAKE_PATH,
58
+ CL_PATH,
80
59
  }
81
60
 
82
61
  }
62
+ // async getpaths() {
63
+ // const ROOT_PATH = process.env["ProgramFiles(x86)"] || process.env["ProgramFiles"]
64
+ //
65
+ // const MSVC_2019_PATH = path.resolve(ROOT_PATH, "Microsoft Visual Studio", "2019", "BuildTools/VC/Tools/MSVC")
66
+ // const MSVC_2022_PATH = path.resolve(ROOT_PATH, "Microsoft Visual Studio", "2022", "BuildTools/VC/Tools/MSVC")
67
+ // const e1 = await this.kernel.bin.exists(MSVC_2019_PATH)
68
+ // const e2 = await this.kernel.bin.exists(MSVC_2022_PATH)
69
+ // let MSVC_PATH
70
+ // if (e1) {
71
+ // MSVC_PATH = MSVC_2019_PATH
72
+ // } else if (e2) {
73
+ // MSVC_PATH = MSVC_2022_PATH
74
+ // }
75
+ //
76
+ // const BUILD_2019_PATH = path.resolve(ROOT_PATH, "Microsoft Visual Studio", "2019", "BuildTools/VC/Auxiliary/Build")
77
+ // const BUILD_2022_PATH = path.resolve(ROOT_PATH, "Microsoft Visual Studio", "2022", "BuildTools/VC/Auxiliary/Build")
78
+ // const e3 = await this.kernel.bin.exists(BUILD_2019_PATH)
79
+ // const e4 = await this.kernel.bin.exists(BUILD_2022_PATH)
80
+ // let BUILD_PATH
81
+ // if (e3) {
82
+ // BUILD_PATH = BUILD_2019_PATH
83
+ // } else if (e4) {
84
+ // BUILD_PATH = BUILD_2022_PATH
85
+ // }
86
+ //
87
+ // const CMAKE_2019_PATH = path.resolve(ROOT_PATH, "Microsoft Visual Studio", "2019", "BuildTools/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin")
88
+ // const CMAKE_2022_PATH = path.resolve(ROOT_PATH, "Microsoft Visual Studio", "2022", "BuildTools/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin")
89
+ // const e5 = await this.kernel.bin.exists(CMAKE_2019_PATH)
90
+ // const e6 = await this.kernel.bin.exists(CMAKE_2022_PATH)
91
+ // let CMAKE_PATH
92
+ // if (e5) {
93
+ // CMAKE_PATH = CMAKE_2019_PATH
94
+ // } else if (e6) {
95
+ // CMAKE_PATH = CMAKE_2022_PATH
96
+ // }
97
+ //
98
+ // console.log({
99
+ // e1, e2, e3, e4, e5, e6,
100
+ // ROOT_PATH,
101
+ // MSVC_2019_PATH, MSVC_2022_PATH,
102
+ // BUILD_2019_PATH, BUILD_2022_PATH,
103
+ // CMAKE_2019_PATH, CMAKE_2022_PATH,
104
+ // MSVC_PATH,
105
+ // BUILD_PATH,
106
+ // CMAKE_PATH
107
+ // })
108
+ //
109
+ // return {
110
+ // ROOT_PATH,
111
+ // MSVC_PATH,
112
+ // BUILD_PATH,
113
+ // CMAKE_PATH
114
+ // }
115
+ //
116
+ // }
83
117
  async init() {
84
118
  if (this.kernel.platform === "win32") {
85
119
  let paths = await this.getpaths()
@@ -91,15 +125,16 @@ class VS {
91
125
  ]
92
126
  }
93
127
 
94
- if (paths.MSVC_PATH) env.PATH.push(paths.MSVC_PATH)
95
- if (paths.BUILD_PATH) env.PATH.push(paths.BUILD_PATH)
96
- if (paths.CMAKE_PATH) env.PATH.push(paths.CMAKE_PATH)
128
+ if (paths.MSVC_PATH) env.PATH = env.PATH.concat(paths.MSVC_PATH)
129
+ if (paths.BUILD_PATH) env.PATH = env.PATH.concat(paths.BUILD_PATH)
130
+ if (paths.CMAKE_PATH) env.PATH = env.PATH.concat(paths.CMAKE_PATH)
131
+ if (paths.CL_PATH) env.PATH = env.PATH.concat(paths.CL_PATH)
97
132
 
98
- const clpaths = await glob('**/bin/Hostx64/x64/cl.exe', { cwd: paths.MSVC_PATH })
99
- if (clpaths && clpaths.length > 0) {
100
- let win_cl_path = path.resolve(paths.MSVC_PATH, path.dirname(clpaths[0]))
101
- env.PATH.push(win_cl_path)
102
- }
133
+ // const clpaths = await glob('**/bin/Hostx64/x64/cl.exe', { cwd: paths.MSVC_PATH })
134
+ // if (clpaths && clpaths.length > 0) {
135
+ // let win_cl_path = path.resolve(paths.MSVC_PATH, path.dirname(clpaths[0]))
136
+ // env.PATH.push(win_cl_path)
137
+ // }
103
138
  this._env = env
104
139
  }
105
140
  }
package/kernel/shell.js CHANGED
@@ -7,7 +7,8 @@ const fastq = require('fastq')
7
7
  const { v4: uuidv4 } = require('uuid');
8
8
  const os = require('os');
9
9
  const fs = require('fs');
10
- const pty = require('node-pty-prebuilt-multiarch-cp');
10
+ //const pty = require('node-pty-prebuilt-multiarch-cp');
11
+ const pty = require('@cocktailpeanut/node-pty-prebuilt-multiarch')
11
12
  const path = require("path")
12
13
  const sudo = require("sudo-prompt-programfiles-x86");
13
14
  const unparse = require('yargs-unparser-custom-flag');
@@ -572,12 +573,15 @@ class Shell {
572
573
  }
573
574
 
574
575
  // Visual Studio Build Tools (Exception)
575
- const vs_path_env = this.kernel.bin.vs_path_env
576
- console.log({ vs_path_env })
577
- if (vs_path_env && vs_path_env.PATH) {
578
- const vs = `conda env config vars set ${vs_path_env.PATH.join(path.delimiter)}${path.delimiter}%PATH%`
579
- console.log({ vs })
580
- conda_activation.push(vs)
576
+ // only add conda env if conda exists
577
+ if (conda_activation.length > 0) {
578
+ const vs_path_env = this.kernel.bin.vs_path_env
579
+ console.log({ vs_path_env })
580
+ if (vs_path_env && vs_path_env.PATH) {
581
+ const vs = `conda env config vars set PATH=${vs_path_env.PATH.join(path.delimiter)}${path.delimiter}%PATH%`
582
+ console.log({ vs })
583
+ conda_activation.push(vs)
584
+ }
581
585
  }
582
586
 
583
587
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "2.1.21",
3
+ "version": "2.1.23",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -9,6 +9,7 @@
9
9
  "author": "",
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
+ "@cocktailpeanut/node-pty-prebuilt-multiarch": "^0.11.16",
12
13
  "7zip-min-win-asar-support": "^1.4.4",
13
14
  "async-retry": "^1.3.3",
14
15
  "axios": "^1.4.0",
@@ -45,7 +46,6 @@
45
46
  "multer": "^1.4.5-lts.1",
46
47
  "node-downloader-helper": "^2.1.9",
47
48
  "node-gradio-client": "^0.14.6",
48
- "node-pty-prebuilt-multiarch-cp": "^0.10.1-pre.48",
49
49
  "pdrive": "^0.0.26",
50
50
  "portfinder-cp": "^1.0.34",
51
51
  "qrcode": "^1.5.3",