sandboxbox 2.4.6 → 2.4.7
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/.vexify.db +0 -0
- package/package.json +1 -1
- package/utils/commands/container.js +0 -5
- package/utils/podman.js +36 -9
package/.vexify.db
ADDED
|
Binary file
|
package/package.json
CHANGED
|
@@ -84,7 +84,6 @@ export function runCommand(projectDir, cmd = 'bash') {
|
|
|
84
84
|
const maxRetries = process.platform === 'linux' ? 3 : 12; // More retries for Windows/macOS
|
|
85
85
|
|
|
86
86
|
while (retries < maxRetries) {
|
|
87
|
-
console.log(color('cyan', ` Debug: Attempt ${retries + 1}/${maxRetries} - running container command...`));
|
|
88
87
|
try {
|
|
89
88
|
execSync(`"${podmanPath}" run --rm -it ${mounts.join(' ')} -w /workspace sandboxbox:latest ${cmd}`, {
|
|
90
89
|
stdio: 'inherit',
|
|
@@ -98,10 +97,6 @@ export function runCommand(projectDir, cmd = 'bash') {
|
|
|
98
97
|
return true;
|
|
99
98
|
} catch (error) {
|
|
100
99
|
retries++;
|
|
101
|
-
// Debug: Log the actual error message
|
|
102
|
-
console.log(color('cyan', ` Debug: Error message: "${error.message}"`));
|
|
103
|
-
console.log(color('cyan', ` Debug: Checking retry patterns...`));
|
|
104
|
-
|
|
105
100
|
if (retries < maxRetries && (error.message.includes('Cannot connect to Podman') || error.message.includes('connectex') || error.message.includes('No connection could be made') || error.message.includes('actively refused') || error.message.includes('Command failed'))) {
|
|
106
101
|
console.log(color('yellow', ` Backend not ready yet (${retries}/${maxRetries}), waiting 15 seconds...`));
|
|
107
102
|
const start = Date.now();
|
package/utils/podman.js
CHANGED
|
@@ -96,26 +96,53 @@ function setupMachineBackground(podmanPath) {
|
|
|
96
96
|
|
|
97
97
|
// Windows-specific: Use completely hidden process execution
|
|
98
98
|
const spawnOptions = process.platform === 'win32' ? {
|
|
99
|
-
stdio: ['
|
|
99
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
100
100
|
shell: true,
|
|
101
101
|
detached: true,
|
|
102
102
|
windowsHide: true, // Hide the console window on Windows
|
|
103
103
|
cwd: process.cwd() // Ensure working directory is set
|
|
104
104
|
} : {
|
|
105
|
-
stdio: ['
|
|
105
|
+
stdio: ['pipe', 'pipe', 'pipe'],
|
|
106
106
|
shell: true,
|
|
107
107
|
detached: true
|
|
108
108
|
};
|
|
109
109
|
|
|
110
110
|
const initProcess = spawn(initCmd, spawnOptions);
|
|
111
|
-
initProcess.unref();
|
|
112
111
|
|
|
113
|
-
//
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
112
|
+
// Handle init process completion/errors
|
|
113
|
+
initProcess.on('error', (error) => {
|
|
114
|
+
console.log(color('red', ` Init process error: ${error.message}`));
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
initProcess.on('exit', (code) => {
|
|
118
|
+
if (code === 0) {
|
|
119
|
+
console.log(color('green', ' Machine initialization completed, starting in 10 seconds...'));
|
|
120
|
+
|
|
121
|
+
// Start machine after init completes
|
|
122
|
+
setTimeout(() => {
|
|
123
|
+
const startCmd = `"${podmanPath}" machine start`;
|
|
124
|
+
const startProcess = spawn(startCmd, spawnOptions);
|
|
125
|
+
|
|
126
|
+
startProcess.on('error', (error) => {
|
|
127
|
+
console.log(color('red', ` Start process error: ${error.message}`));
|
|
128
|
+
});
|
|
129
|
+
|
|
130
|
+
startProcess.on('exit', (startCode) => {
|
|
131
|
+
if (startCode === 0) {
|
|
132
|
+
console.log(color('green', ' Podman machine started successfully!'));
|
|
133
|
+
} else {
|
|
134
|
+
console.log(color('red', ` Machine start failed with code: ${startCode}`));
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
startProcess.unref();
|
|
139
|
+
}, 10000); // Wait 10 seconds before starting
|
|
140
|
+
} else {
|
|
141
|
+
console.log(color('red', ` Machine initialization failed with code: ${code}`));
|
|
142
|
+
}
|
|
143
|
+
});
|
|
144
|
+
|
|
145
|
+
initProcess.unref();
|
|
119
146
|
|
|
120
147
|
console.log(color('yellow', ' Setup initiated in background (may take 2-3 minutes)'));
|
|
121
148
|
console.log(color('cyan', ' Container operations will work when setup completes\n'));
|