pinokiod 3.3.40 → 3.3.43

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.
@@ -41,6 +41,8 @@ class Conda {
41
41
  let base = {
42
42
  // CONDA_ROOT: this.kernel.bin.path("miniconda"),
43
43
  CONDA_PREFIX: this.kernel.bin.path("miniconda"),
44
+ CONDA_ENVS_PATH: this.kernel.bin.path("miniconda/envs"),
45
+ CONDA_PKGS_DIRS: this.kernel.bin.path("miniconda/pkgs"),
44
46
  PYTHON: this.kernel.bin.path("miniconda/python"),
45
47
  PATH: this.paths[this.kernel.platform].map((p) => {
46
48
  return this.kernel.bin.path(p)
package/kernel/bin/vs.js CHANGED
@@ -5,19 +5,14 @@ const { glob } = require('glob')
5
5
  class VS {
6
6
  description = "Look for a dialog requesting admin permission and approve it to proceed. This will install Microsoft visual studio build tools, which is required for building several python wheels."
7
7
  async install(req, ondata) {
8
-
9
-
10
8
  // 3. Run installer
11
9
  if (os.release().startsWith("10")) {
12
-
13
10
  // Download installer
14
11
  const installer_url = "https://github.com/cocktailpeanut/bin/releases/download/vs_buildtools/vs_buildtools.exe"
15
12
  const installer = "vs_buildtools.exe"
16
- ondata({ raw: `[1] downloading installer: ${installer_url}...\r\n\r\n` })
13
+ ondata({ raw: `[1] downloading installer: ${installer_url}...\r\n` })
17
14
  await this.kernel.bin.download(installer_url, installer, ondata)
18
-
19
- ondata({ raw: `[2] uninstalling existing vs 2019 in case corrupt...\r\n\r\n` })
20
-
15
+ ondata({ raw: `[2] Installing..\r\n` })
21
16
  let commands = [
22
17
  this.cmd("uninstall"),
23
18
  this.cmd("install"),
@@ -27,32 +22,21 @@ class VS {
27
22
  await this.kernel.bin.exec({ sudo: true, message: cmd, }, (stream) => {
28
23
  ondata(stream)
29
24
  })
30
- /*
31
- const uninstall_cmd = this.cmd("uninstall")
32
- await this.uninstall(req, ondata)
33
-
34
- ondata({ raw: `[3] running installer: ${installer}...\r\n\r\n` })
35
- const cmd = this.cmd("install")
36
- await this.kernel.bin.exec({ sudo: true, message: cmd, }, (stream) => {
37
- ondata(stream)
38
- })
39
- ondata({ raw: `[4] updating...\r\n\r\n` })
40
- const cmd2 = this.cmd("update")
41
- await this.kernel.bin.exec({ sudo: true, message: cmd2, }, (stream) => {
42
- ondata(stream)
43
- })
44
- */
45
25
  ondata({ raw: `Install finished\r\n\r\n` })
26
+ let WARNING = "[NOTICE] If this step keeps repeating, try opening the 'Visual Studio Installer' app on Windows, and check if there are failed installations, and uninstall them and retry."
27
+ ondata({
28
+ raw: `\r\n\x1b[33m${WARNING}\x1b[0m\r\n\r\n`
29
+ })
46
30
  return this.kernel.bin.rm(installer, ondata)
47
31
  } else {
48
32
  ondata({ raw: `Must be Windows 10 or above\r\n` })
49
33
  }
50
34
  }
51
35
  async getpaths() {
52
- let MSVC_PATH
53
- let BUILD_PATH
54
- let CMAKE_PATH
55
- let CL_PATH
36
+ let MSVC_PATH = []
37
+ let BUILD_PATH = []
38
+ let CMAKE_PATH = []
39
+ let CL_PATH = []
56
40
  const program_file_paths = [process.env["ProgramFiles(x86)"], process.env["ProgramFiles"]]
57
41
  for(let rp of program_file_paths) {
58
42
  const ROOT_PATH = path.resolve(rp, "Microsoft Visual Studio")
@@ -60,71 +44,41 @@ class VS {
60
44
  const e1 = await this.kernel.bin.exists(ROOT_PATH)
61
45
  if (e1) {
62
46
  console.log("exists", ROOT_PATH)
63
- MSVC_PATH = await glob('**/VC/Tools/MSVC', { absolute: true, cwd: ROOT_PATH })
64
- if (MSVC_PATH && MSVC_PATH.length > 0) {
65
- // look for 2019 only
66
- MSVC_PATH = MSVC_PATH.filter((x) => {
67
- return /.*2019.*/.test(x)
68
- })
69
- console.log({ MSVC_PATH })
70
- BUILD_PATH = await glob('**/VC/Auxiliary/Build', { absolute: true, cwd: ROOT_PATH })
71
- if (BUILD_PATH && BUILD_PATH.length > 0) {
72
- BUILD_PATH = BUILD_PATH.filter((x) => {
73
- return /.*2019.*/.test(x)
74
- })
47
+ let vcpaths = await glob('**/VC/Tools/MSVC', { absolute: true, cwd: ROOT_PATH })
48
+ if (vcpaths && vcpaths > 0) {
49
+ for(let vcpath of vcpaths) {
50
+ if (/.*2019.*/.test(vcpath)) {
51
+ MSVC_PATH.push(vcpath)
52
+ }
53
+ }
54
+ }
55
+ let buildpaths = await glob('**/VC/Auxiliary/Build', { absolute: true, cwd: ROOT_PATH })
56
+ if (buildpaths && buildpaths.length > 0) {
57
+ for(let buildpath of buildpaths) {
58
+ if (/.*2019.*/.test(buildpath)) {
59
+ BUILD_PATH.push(buildpath)
60
+ }
75
61
  }
76
- console.log({ BUILD_PATH })
77
- CMAKE_PATH = await glob('**/Microsoft/CMake/CMake/bin', { absolute: true, cwd: ROOT_PATH })
78
- if (CMAKE_PATH && CMAKE_PATH.length > 0) {
79
- CMAKE_PATH = CMAKE_PATH.filter((x) => {
80
- return /.*2019.*/.test(x)
81
- })
62
+ }
63
+
64
+ let cmakepaths = await glob('**/Microsoft/CMake/CMake/bin', { absolute: true, cwd: ROOT_PATH })
65
+ if (cmakepaths && cmakepaths.length > 0) {
66
+ for(let cmakepath of cmakepaths) {
67
+ if (/.*2019.*/.test(cmakepath)) {
68
+ CMAKE_PATH.push(cmakepath)
69
+ }
82
70
  }
83
- console.log({ CMAKE_PATH })
71
+ }
84
72
  //CL_PATH = await glob('**/Hostx64/x64/cl.exe', { absolute: true, cwd: ROOT_PATH })
85
- CL_PATH = await glob('**/Hostx64/x64', { absolute: true, cwd: ROOT_PATH })
86
- if (CL_PATH && CL_PATH.length > 0) {
87
- CL_PATH = CL_PATH.filter((x) => {
88
- return /.*2019.*/.test(x)
89
- })
73
+ let clpaths = await glob('**/Hostx64/x64', { absolute: true, cwd: ROOT_PATH })
74
+ if (clpaths && clpaths.length > 0) {
75
+ for(let clpath of clpaths) {
76
+ if (/.*2019.*/.test(clpath)) {
77
+ CL_PATH.push(clpath)
78
+ }
90
79
  }
91
- console.log({ CL_PATH })
92
- break;
93
80
  }
94
81
  }
95
-
96
-
97
- /*
98
- Example:
99
- {
100
- ROOT_PATH: "C:\Program Files (x86)\Microsoft Visual Studio"
101
- },
102
- {
103
- MSVC_PATH: [
104
- 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC',
105
- 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC'
106
- ]
107
- }
108
- {
109
- BUILD_PATH: [
110
- 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Auxiliary\\Build',
111
- 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Auxiliary\\Build'
112
- ]
113
- }
114
- {
115
- CMAKE_PATH: [
116
- 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\Common7\\IDE\\CommonExtensions\\Microsoft\\CMake\\CMake\\bin',
117
- 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\Common7\\IDE\\CommonExtensions\\Microsoft\\CMake\\CMake\\bin'
118
- ]
119
- }
120
- {
121
- CL_PATH: [
122
- 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\Hostx64\\x64',
123
- 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.42.34433\\bin\\Hostx64\\x64'
124
- ]
125
- }
126
- */
127
-
128
82
  }
129
83
  console.log({ MSVC_PATH, BUILD_PATH, CMAKE_PATH, CL_PATH })
130
84
  return {
@@ -136,78 +90,8 @@ class VS {
136
90
  }
137
91
 
138
92
  }
139
- // async getpaths() {
140
- // const ROOT_PATH = process.env["ProgramFiles(x86)"] || process.env["ProgramFiles"]
141
- //
142
- // const MSVC_2019_PATH = path.resolve(ROOT_PATH, "Microsoft Visual Studio", "2019", "BuildTools/VC/Tools/MSVC")
143
- // const MSVC_2022_PATH = path.resolve(ROOT_PATH, "Microsoft Visual Studio", "2022", "BuildTools/VC/Tools/MSVC")
144
- // const e1 = await this.kernel.bin.exists(MSVC_2019_PATH)
145
- // const e2 = await this.kernel.bin.exists(MSVC_2022_PATH)
146
- // let MSVC_PATH
147
- // if (e1) {
148
- // MSVC_PATH = MSVC_2019_PATH
149
- // } else if (e2) {
150
- // MSVC_PATH = MSVC_2022_PATH
151
- // }
152
- //
153
- // const BUILD_2019_PATH = path.resolve(ROOT_PATH, "Microsoft Visual Studio", "2019", "BuildTools/VC/Auxiliary/Build")
154
- // const BUILD_2022_PATH = path.resolve(ROOT_PATH, "Microsoft Visual Studio", "2022", "BuildTools/VC/Auxiliary/Build")
155
- // const e3 = await this.kernel.bin.exists(BUILD_2019_PATH)
156
- // const e4 = await this.kernel.bin.exists(BUILD_2022_PATH)
157
- // let BUILD_PATH
158
- // if (e3) {
159
- // BUILD_PATH = BUILD_2019_PATH
160
- // } else if (e4) {
161
- // BUILD_PATH = BUILD_2022_PATH
162
- // }
163
- //
164
- // const CMAKE_2019_PATH = path.resolve(ROOT_PATH, "Microsoft Visual Studio", "2019", "BuildTools/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin")
165
- // const CMAKE_2022_PATH = path.resolve(ROOT_PATH, "Microsoft Visual Studio", "2022", "BuildTools/Common7/IDE/CommonExtensions/Microsoft/CMake/CMake/bin")
166
- // const e5 = await this.kernel.bin.exists(CMAKE_2019_PATH)
167
- // const e6 = await this.kernel.bin.exists(CMAKE_2022_PATH)
168
- // let CMAKE_PATH
169
- // if (e5) {
170
- // CMAKE_PATH = CMAKE_2019_PATH
171
- // } else if (e6) {
172
- // CMAKE_PATH = CMAKE_2022_PATH
173
- // }
174
- //
175
- // console.log({
176
- // e1, e2, e3, e4, e5, e6,
177
- // ROOT_PATH,
178
- // MSVC_2019_PATH, MSVC_2022_PATH,
179
- // BUILD_2019_PATH, BUILD_2022_PATH,
180
- // CMAKE_2019_PATH, CMAKE_2022_PATH,
181
- // MSVC_PATH,
182
- // BUILD_PATH,
183
- // CMAKE_PATH
184
- // })
185
- //
186
- // return {
187
- // ROOT_PATH,
188
- // MSVC_PATH,
189
- // BUILD_PATH,
190
- // CMAKE_PATH
191
- // }
192
- //
193
- // }
194
93
  async init() {
195
94
  if (this.kernel.platform === "win32") {
196
- let paths = await this.getpaths()
197
-
198
- const env = {
199
- PATH: [
200
- // "C:\\Windows\\System32",
201
- "C:\\Windows\\System32\\WindowsPowerShell\\v1.0",
202
- ],
203
- BUILD_PATH: paths.BUILD_PATH
204
- }
205
-
206
- if (paths.MSVC_PATH) env.PATH = env.PATH.concat(paths.MSVC_PATH)
207
- if (paths.BUILD_PATH) env.PATH = env.PATH.concat(paths.BUILD_PATH)
208
- if (paths.CMAKE_PATH) env.PATH = env.PATH.concat(paths.CMAKE_PATH)
209
- if (paths.CL_PATH) env.PATH = env.PATH.concat(paths.CL_PATH)
210
-
211
95
  /*
212
96
  {
213
97
  BUILD_PATH: [
@@ -216,52 +100,19 @@ class VS {
216
100
  ]
217
101
  }
218
102
  */
219
-
220
- if (paths.BUILD_PATH) {
221
- let build_paths = paths.BUILD_PATH
103
+ this._env = await this.getpaths()
104
+ if (this._envs.BUILD_PATH.length > 0) {
222
105
  // look for vcvarsall
223
- // try to use 2019 first
224
- for(let p of build_paths) {
225
- if (/.*2019.*/.test(p)) {
226
- const e = await this.kernel.bin.exists(p)
227
- console.log(">1 e", {e, p})
228
- if (e) {
229
- let vcvars_path = path.resolve(p, "vcvarsall.bat")
230
- const e2 = await this.kernel.bin.exists(vcvars_path)
231
- console.log(">1 e2", e2)
232
- if (e2) {
233
- env.VCVARSALL_PATH = vcvars_path
234
- break
235
- }
236
- }
106
+ for(let p of this._envs.BUILD_PATH) {
107
+ let vcvars_path = path.resolve(p, "vcvarsall.bat")
108
+ const e = await this.kernel.bin.exists(vcvars_path)
109
+ console.log("> vcvarsall.bat path exists?", { vcvars_path, e })
110
+ if (e) {
111
+ this._env.VCVARSALL_PATH = vcvars_path
112
+ break
237
113
  }
238
114
  }
239
-
240
- // only if 2019 doesn't exist try others
241
- if (!env.VCVARSALL_PATH) {
242
- for(let p of build_paths) {
243
- const e = await this.kernel.bin.exists(p)
244
- console.log(">2 e", { e, p})
245
- if (e) {
246
- let vcvars_path = path.resolve(p, "vcvarsall.bat")
247
- const e2 = await this.kernel.bin.exists(vcvars_path)
248
- console.log(">2 e2", e2)
249
- if (e2) {
250
- env.VCVARSALL_PATH = vcvars_path
251
- break
252
- }
253
- }
254
- }
255
- }
256
- console.log(">>> env", env)
257
115
  }
258
-
259
- // const clpaths = await glob('**/bin/Hostx64/x64/cl.exe', { cwd: paths.MSVC_PATH })
260
- // if (clpaths && clpaths.length > 0) {
261
- // let win_cl_path = path.resolve(paths.MSVC_PATH, path.dirname(clpaths[0]))
262
- // env.PATH.push(win_cl_path)
263
- // }
264
- this._env = env
265
116
  }
266
117
  }
267
118
  env () {
@@ -273,7 +124,7 @@ class VS {
273
124
  if (this.kernel.platform === "win32") {
274
125
  let paths = await this.getpaths()
275
126
  console.log("VS INSTALLED CHECK", paths)
276
- return paths.MSVC_PATH && paths.MSVC_PATH.length > 0 && paths.BUILD_PATH && paths.BUILD_PATH.length > 0 && paths.CMAKE_PATH && paths.CMAKE_PATH.length > 0
127
+ return paths.MSVC_PATH && paths.MSVC_PATH.length > 0 && paths.BUILD_PATH && paths.BUILD_PATH.length > 0 && paths.CMAKE_PATH && paths.CMAKE_PATH.length > 0 && paths.VCVARSALL_PATH && paths.VCVARSALL_PATH.length > 0
277
128
  }
278
129
  }
279
130
 
package/kernel/shell.js CHANGED
@@ -155,6 +155,10 @@ class Shell {
155
155
  ].join(':');
156
156
  }
157
157
 
158
+ if (this.platform === "linux") {
159
+ this.env.NVCC_PREPEND_FLAGS = "-ccbin {{which('g++')}}"
160
+ }
161
+
158
162
  this.env[PATH_KEY] = this.env[PATH_KEY] + path.delimiter + path.resolve(this.kernel.homedir, 'bin')
159
163
 
160
164
 
@@ -662,6 +666,7 @@ class Shell {
662
666
  if (this.platform === "win32") {
663
667
  try {
664
668
  let vcvars_path = this.kernel.bin.vs_path_env.VCVARSALL_PATH
669
+ console.log(`[shell] vcvars_path = ${vcvars_path}`)
665
670
  if (vcvars_path) {
666
671
  const architecture = os.arch().toLowerCase(); // 'x64', 'ia32' (32-bit), etc.
667
672
  const armArchitecture = process.arch.toLowerCase(); // For ARM-based architectures (on Windows), process.arch might be 'arm64', 'arm', etc.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pinokiod",
3
- "version": "3.3.40",
3
+ "version": "3.3.43",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {