@xaidenlabs/uso 1.1.91 → 1.1.93
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/package.json +1 -1
- package/src/commands/doctor.js +46 -6
- package/src/platforms/wsl.js +3 -12
package/package.json
CHANGED
package/src/commands/doctor.js
CHANGED
|
@@ -224,12 +224,52 @@ const doctor = async () => {
|
|
|
224
224
|
);
|
|
225
225
|
}
|
|
226
226
|
|
|
227
|
-
|
|
228
|
-
if (
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
227
|
+
const missing = [];
|
|
228
|
+
if (!checkGit()) missing.push({name: 'Git', component: 'git'});
|
|
229
|
+
if (platform === "win32" && !checkWsl()) missing.push({name: 'WSL', component: 'wsl'});
|
|
230
|
+
if (!checkRust()) missing.push({name: 'Rust', component: 'rust'});
|
|
231
|
+
if (!checkSolana()) missing.push({name: 'Solana CLI', component: 'solana'});
|
|
232
|
+
if (!checkAnchor()) missing.push({name: 'Anchor', component: 'anchor'});
|
|
233
|
+
if (!checkCppTools()) missing.push({name: 'C++ Build Tools', component: 'cpptools'});
|
|
234
|
+
|
|
235
|
+
if (missing.length > 0) {
|
|
236
|
+
console.log("");
|
|
237
|
+
log.info("⚠️ Some components are missing.");
|
|
238
|
+
const { init } = require("./init");
|
|
239
|
+
const readline = require("readline");
|
|
240
|
+
const rl = readline.createInterface({
|
|
241
|
+
input: process.stdin,
|
|
242
|
+
output: process.stdout,
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
const ask = (q) => new Promise((resolve) => rl.question(q, resolve));
|
|
246
|
+
|
|
247
|
+
for (const item of missing) {
|
|
248
|
+
const ans = await ask(`🤔 Do you want to install ${item.name}? (y/N): `);
|
|
249
|
+
if (ans.trim().toLowerCase() === 'y') {
|
|
250
|
+
if (item.component === 'git') {
|
|
251
|
+
log.warn("👉 Git cannot be installed automatically yet. Please install it manually.");
|
|
252
|
+
} else if (item.component === 'cpptools') {
|
|
253
|
+
log.warn("👉 Please install C++ Build Tools manually from: https://visualstudio.microsoft.com/visual-cpp-build-tools/");
|
|
254
|
+
} else if (item.component === 'wsl' || platform === "win32") {
|
|
255
|
+
// On Windows, the init command automatically provisions the entire WSL environment with all components
|
|
256
|
+
log.info(`🚀 Starting installation...`);
|
|
257
|
+
await init();
|
|
258
|
+
// If we run full init on Windows, it installs everything, so we can break the loop
|
|
259
|
+
break;
|
|
260
|
+
} else {
|
|
261
|
+
log.info(`🚀 Installing ${item.name}...`);
|
|
262
|
+
await init(item.component);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
rl.close();
|
|
267
|
+
console.log("");
|
|
268
|
+
log.success("🩺 Doctor completed. Please run 'uso doctor' again to verify.");
|
|
269
|
+
} else {
|
|
270
|
+
console.log("");
|
|
271
|
+
log.success("🎉 Everything looks good! You're ready to build.");
|
|
272
|
+
}
|
|
233
273
|
};
|
|
234
274
|
|
|
235
275
|
module.exports = {
|
package/src/platforms/wsl.js
CHANGED
|
@@ -318,18 +318,9 @@ else
|
|
|
318
318
|
fi
|
|
319
319
|
source $HOME/.cargo/env 2>/dev/null || true
|
|
320
320
|
|
|
321
|
-
# --- Solana SBPF Toolchain
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
if run_with_progress "🎯 Installing Solana SBPF target..." 35 55 rustup target add sbpf-solana-solana; then
|
|
325
|
-
echo "✅ SBPF target installed."
|
|
326
|
-
else
|
|
327
|
-
FAILURES="$FAILURES sbpf-target"
|
|
328
|
-
echo "❌ SBPF target installation failed."
|
|
329
|
-
fi
|
|
330
|
-
else
|
|
331
|
-
echo "✅ SBPF target already installed."
|
|
332
|
-
fi
|
|
321
|
+
# --- Solana SBPF Toolchain ---
|
|
322
|
+
# The SBPF target is managed by Solana's custom rustc inside the Solana CLI.
|
|
323
|
+
echo "✅ SBPF target is managed by Solana CLI."
|
|
333
324
|
|
|
334
325
|
# Install cargo-build-sbf
|
|
335
326
|
if ! command -v cargo-build-sbf &> /dev/null; then
|