File tree 1 file changed +26
-11
lines changed
1 file changed +26
-11
lines changed Original file line number Diff line number Diff line change 1
1
// @ts -check
2
2
3
+ import * as fs from "node:fs" ;
4
+
3
5
/**
4
6
* @typedef {{
5
7
* binDir: string,
@@ -27,15 +29,28 @@ try {
27
29
throw new Error ( `Platform ${ target } is not supported!` ) ;
28
30
}
29
31
32
+ const binPaths = mod . binPaths ;
33
+ // Compiler use symbolic links in the development process
34
+ if ( fs . lstatSync ( binPaths . rescript_exe ) . isSymbolicLink ( ) ) {
35
+ for ( const [ key , binPath ] of Object . entries ( binPaths ) ) {
36
+ try {
37
+ binPaths [ /** @type {keyof BinaryPaths } */ ( key ) ] = fs . realpathSync ( binPath ) ;
38
+ } catch {
39
+ // Cannot populate the realpath of a binary, some tests may fails.
40
+ //
41
+ // But we don't report error here,
42
+ // so pass even some binaries are not built yet.
43
+ }
44
+ }
45
+ }
46
+
47
+ export const platformDir = mod . binDir ;
30
48
export const {
31
- binDir : platformDir ,
32
- binPaths : {
33
- bsb_helper_exe,
34
- bsc_exe,
35
- ninja_exe,
36
- rescript_editor_analysis_exe,
37
- rescript_tools_exe,
38
- rescript_exe,
39
- rewatch_exe,
40
- } ,
41
- } = mod ;
49
+ bsb_helper_exe,
50
+ bsc_exe,
51
+ ninja_exe,
52
+ rescript_editor_analysis_exe,
53
+ rescript_tools_exe,
54
+ rescript_exe,
55
+ rewatch_exe,
56
+ } = binPaths ;
You can’t perform that action at this time.
0 commit comments