4runr-os 2.1.32 → 2.1.33
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/scripts/setup.js +51 -9
package/package.json
CHANGED
package/scripts/setup.js
CHANGED
|
@@ -111,21 +111,63 @@ if (isWindows && rustInstalled && rustNeedsGNU) {
|
|
|
111
111
|
'C:\\mingw64\\bin',
|
|
112
112
|
'C:\\msys64\\mingw64\\bin',
|
|
113
113
|
'C:\\Program Files\\mingw-w64\\x86_64-8.1.0-posix-seh-rt_v6-rev0\\mingw64\\bin',
|
|
114
|
-
path.join(process.env.ProgramFiles || 'C:\\Program Files', 'mingw-w64', 'x86_64-*-*-*-*-*', 'mingw64', 'bin'),
|
|
115
114
|
];
|
|
116
115
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
116
|
+
// Check if MSYS2 exists and might have MinGW
|
|
117
|
+
const msys2MingwPath = 'C:\\msys64\\mingw64\\bin';
|
|
118
|
+
const msys2Bash = 'C:\\msys64\\usr\\bin\\bash.exe';
|
|
119
|
+
|
|
120
|
+
// First check if MSYS2 exists - if so, check/install MinGW automatically
|
|
121
|
+
if (fs.existsSync(msys2Bash)) {
|
|
122
|
+
console.log(' ✅ MSYS2 found - checking for MinGW...');
|
|
123
|
+
if (fs.existsSync(path.join(msys2MingwPath, 'dlltool.exe'))) {
|
|
120
124
|
mingwInstalled = true;
|
|
121
|
-
mingwPath =
|
|
122
|
-
console.log('✅ MinGW found
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
125
|
+
mingwPath = msys2MingwPath;
|
|
126
|
+
console.log(' ✅ MinGW found in MSYS2');
|
|
127
|
+
} else {
|
|
128
|
+
// MSYS2 exists but MinGW not installed - install it automatically
|
|
129
|
+
console.log(' 🔨 Installing MinGW toolchain in MSYS2 (this may take a few minutes)...');
|
|
130
|
+
try {
|
|
131
|
+
execSync(`"${msys2Bash}" -lc "pacman -S mingw-w64-x86_64-toolchain --noconfirm"`, {
|
|
132
|
+
stdio: 'inherit',
|
|
133
|
+
timeout: 300000 // 5 minutes
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
if (fs.existsSync(path.join(msys2MingwPath, 'dlltool.exe'))) {
|
|
137
|
+
mingwInstalled = true;
|
|
138
|
+
mingwPath = msys2MingwPath;
|
|
139
|
+
console.log(' ✅ MinGW toolchain installed successfully');
|
|
140
|
+
} else {
|
|
141
|
+
console.warn(' ⚠️ Installation completed but MinGW not found');
|
|
142
|
+
console.warn(' Please restart terminal and run 4runr-setup again');
|
|
143
|
+
}
|
|
144
|
+
} catch (installError) {
|
|
145
|
+
console.warn(' ⚠️ Failed to install MinGW automatically');
|
|
146
|
+
console.warn(' Please run manually in MSYS2 terminal: pacman -S mingw-w64-x86_64-toolchain --noconfirm');
|
|
147
|
+
}
|
|
126
148
|
}
|
|
127
149
|
}
|
|
128
150
|
|
|
151
|
+
// Check other common paths if MSYS2 didn't work
|
|
152
|
+
if (!mingwInstalled) {
|
|
153
|
+
for (const testPath of commonPaths) {
|
|
154
|
+
if (fs.existsSync(testPath)) {
|
|
155
|
+
const dlltoolPath = path.join(testPath, 'dlltool.exe');
|
|
156
|
+
if (fs.existsSync(dlltoolPath)) {
|
|
157
|
+
mingwInstalled = true;
|
|
158
|
+
mingwPath = testPath;
|
|
159
|
+
console.log(' ✅ MinGW found at:', mingwPath);
|
|
160
|
+
break;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
if (mingwInstalled && mingwPath) {
|
|
167
|
+
console.log(' Adding to PATH for this session...');
|
|
168
|
+
process.env.PATH = process.env.PATH ? `${mingwPath};${process.env.PATH}` : mingwPath;
|
|
169
|
+
}
|
|
170
|
+
|
|
129
171
|
if (!mingwInstalled) {
|
|
130
172
|
console.log(' Installing MinGW-w64...');
|
|
131
173
|
|