pinokiod 3.3.22 → 3.3.25
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 +62 -6
- package/kernel/shell.js +2 -6
- package/package.json +1 -1
- package/server/views/editor.ejs +15 -6
package/kernel/bin/vs.js
CHANGED
|
@@ -50,6 +50,39 @@ class VS {
|
|
|
50
50
|
break;
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
/*
|
|
56
|
+
Example:
|
|
57
|
+
{
|
|
58
|
+
ROOT_PATH: "C:\Program Files (x86)\Microsoft Visual Studio"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
MSVC_PATH: [
|
|
62
|
+
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC',
|
|
63
|
+
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC'
|
|
64
|
+
]
|
|
65
|
+
}
|
|
66
|
+
{
|
|
67
|
+
BUILD_PATH: [
|
|
68
|
+
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Auxiliary\\Build',
|
|
69
|
+
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Auxiliary\\Build'
|
|
70
|
+
]
|
|
71
|
+
}
|
|
72
|
+
{
|
|
73
|
+
CMAKE_PATH: [
|
|
74
|
+
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\Common7\\IDE\\CommonExtensions\\Microsoft\\CMake\\CMake\\bin',
|
|
75
|
+
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\Common7\\IDE\\CommonExtensions\\Microsoft\\CMake\\CMake\\bin'
|
|
76
|
+
]
|
|
77
|
+
}
|
|
78
|
+
{
|
|
79
|
+
CL_PATH: [
|
|
80
|
+
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Tools\\MSVC\\14.29.30133\\bin\\Hostx64\\x64',
|
|
81
|
+
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Tools\\MSVC\\14.42.34433\\bin\\Hostx64\\x64'
|
|
82
|
+
]
|
|
83
|
+
}
|
|
84
|
+
*/
|
|
85
|
+
|
|
53
86
|
}
|
|
54
87
|
console.log({ MSVC_PATH, BUILD_PATH, CMAKE_PATH, CL_PATH })
|
|
55
88
|
return {
|
|
@@ -117,7 +150,6 @@ class VS {
|
|
|
117
150
|
//
|
|
118
151
|
// }
|
|
119
152
|
async init() {
|
|
120
|
-
console.log("############################################ vs")
|
|
121
153
|
if (this.kernel.platform === "win32") {
|
|
122
154
|
let paths = await this.getpaths()
|
|
123
155
|
|
|
@@ -134,14 +166,38 @@ class VS {
|
|
|
134
166
|
if (paths.CMAKE_PATH) env.PATH = env.PATH.concat(paths.CMAKE_PATH)
|
|
135
167
|
if (paths.CL_PATH) env.PATH = env.PATH.concat(paths.CL_PATH)
|
|
136
168
|
|
|
169
|
+
/*
|
|
170
|
+
{
|
|
171
|
+
BUILD_PATH: [
|
|
172
|
+
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2022\\BuildTools\\VC\\Auxiliary\\Build',
|
|
173
|
+
'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\BuildTools\\VC\\Auxiliary\\Build'
|
|
174
|
+
]
|
|
175
|
+
}
|
|
176
|
+
*/
|
|
177
|
+
|
|
137
178
|
let build_paths = paths.BUILD_PATH
|
|
138
179
|
// look for vcvarsall
|
|
180
|
+
// try to use 2019 first
|
|
139
181
|
for(let p of build_paths) {
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
182
|
+
if (/.*2019.*/.test(p)) {
|
|
183
|
+
const e = await this.kernel.bin.exists(p)
|
|
184
|
+
if (e) {
|
|
185
|
+
let vcvars_path = path.resolve(p, "vcvarsall.bat")
|
|
186
|
+
env.VCVARSALL_PATH = vcvars_path
|
|
187
|
+
break
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// only if 2019 doesn't exist try others
|
|
193
|
+
if (!env.VCVARSALL_PATH) {
|
|
194
|
+
for(let p of build_paths) {
|
|
195
|
+
const e = await this.kernel.bin.exists(p)
|
|
196
|
+
if (e) {
|
|
197
|
+
let vcvars_path = path.resolve(p, "vcvarsall.bat")
|
|
198
|
+
env.VCVARSALL_PATH = vcvars_path
|
|
199
|
+
break
|
|
200
|
+
}
|
|
145
201
|
}
|
|
146
202
|
}
|
|
147
203
|
|
package/kernel/shell.js
CHANGED
|
@@ -662,11 +662,9 @@ class Shell {
|
|
|
662
662
|
if (this.platform === "win32") {
|
|
663
663
|
try {
|
|
664
664
|
let vcvars_path = this.kernel.bin.vs_path_env.VCVARSALL_PATH
|
|
665
|
-
console.log({ vcvars_path })
|
|
666
665
|
if (vcvars_path) {
|
|
667
666
|
const architecture = os.arch().toLowerCase(); // 'x64', 'ia32' (32-bit), etc.
|
|
668
667
|
const armArchitecture = process.arch.toLowerCase(); // For ARM-based architectures (on Windows), process.arch might be 'arm64', 'arm', etc.
|
|
669
|
-
console.log({ architecture, armArchitecture })
|
|
670
668
|
|
|
671
669
|
// Map architectures to vcvarsall.bat argument
|
|
672
670
|
let arg
|
|
@@ -688,15 +686,13 @@ class Shell {
|
|
|
688
686
|
}
|
|
689
687
|
|
|
690
688
|
if (arg) {
|
|
691
|
-
console.log({ arg, vcvars_path })
|
|
692
689
|
conda_activation.push(`"${vcvars_path}" ${arg} > nul 2>&1`)
|
|
693
690
|
}
|
|
694
|
-
console.log('vc vars setup successful')
|
|
695
691
|
} else {
|
|
696
|
-
console.log('vc vars env doesnt exist')
|
|
692
|
+
// console.log('vc vars env doesnt exist')
|
|
697
693
|
}
|
|
698
694
|
} catch (e) {
|
|
699
|
-
console.log('vc vars setup', e)
|
|
695
|
+
// console.log('vc vars setup', e)
|
|
700
696
|
}
|
|
701
697
|
|
|
702
698
|
// const vs_path_env = this.kernel.bin.vs_path_env
|
package/package.json
CHANGED
package/server/views/editor.ejs
CHANGED
|
@@ -46,8 +46,20 @@ body.frozen {
|
|
|
46
46
|
.xterm {
|
|
47
47
|
height: 100%;
|
|
48
48
|
}
|
|
49
|
+
.containers main {
|
|
50
|
+
height: 100%;
|
|
51
|
+
width: 100%;
|
|
52
|
+
}
|
|
53
|
+
.containers.running main {
|
|
54
|
+
height: 50%;
|
|
55
|
+
width: 100%;
|
|
56
|
+
}
|
|
57
|
+
.containers {
|
|
58
|
+
display: block;
|
|
59
|
+
}
|
|
49
60
|
.containers .terminal-container {
|
|
50
|
-
height:
|
|
61
|
+
height: 50%;
|
|
62
|
+
width: 100%;
|
|
51
63
|
}
|
|
52
64
|
#table > table {
|
|
53
65
|
border-left: 2px solid black;
|
|
@@ -212,7 +224,6 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
212
224
|
document.querySelector(".run .starting").classList.add("hidden")
|
|
213
225
|
}
|
|
214
226
|
stop() {
|
|
215
|
-
debugger;
|
|
216
227
|
this.socket.run({
|
|
217
228
|
method: "kernel.api.stop",
|
|
218
229
|
params: {
|
|
@@ -226,7 +237,6 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
226
237
|
return new Promise((resolve, reject) => {
|
|
227
238
|
let cwd = "<%=execUrl%>"
|
|
228
239
|
//let cwd = "~" + location.pathname
|
|
229
|
-
debugger
|
|
230
240
|
this.socket.close()
|
|
231
241
|
this.socket.run({
|
|
232
242
|
method: "fs.write",
|
|
@@ -249,7 +259,7 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
249
259
|
await this.socket.close()
|
|
250
260
|
// document.querySelector(".terminal-container").classList.add("hidden")
|
|
251
261
|
let query = Object.fromEntries(new URLSearchParams(location.search))
|
|
252
|
-
document.querySelector(".containers").classList.add("running")
|
|
262
|
+
// document.querySelector(".containers").classList.add("running")
|
|
253
263
|
|
|
254
264
|
|
|
255
265
|
this.socket.run({
|
|
@@ -476,7 +486,6 @@ document.addEventListener("DOMContentLoaded", async () => {
|
|
|
476
486
|
text: `${packet.data}`,
|
|
477
487
|
})
|
|
478
488
|
} else if (packet.type === "error") {
|
|
479
|
-
debugger
|
|
480
489
|
// n.Noty({
|
|
481
490
|
// text: `${packet.data}`,
|
|
482
491
|
// type: "error"
|
|
@@ -878,7 +887,7 @@ const reloadMemory = async () => {
|
|
|
878
887
|
</div>
|
|
879
888
|
</div>
|
|
880
889
|
<% } else { %>
|
|
881
|
-
<div class='containers
|
|
890
|
+
<div class='containers'>
|
|
882
891
|
<main>
|
|
883
892
|
<!--
|
|
884
893
|
<pre id='response'></pre>
|