@@ -47,16 +47,17 @@ let is_grain_module = mod_name => {
4747};
4848
4949let wasi_polyfill_module = () => {
50- "GRAIN$MODULE$./"
51- ++ Filename . remove_extension( Option . get( Config . wasi_polyfill ^ )) ;
50+ Filename . remove_extension( Option . get( Config . wasi_polyfill_path () ))
51+ ++ ".gr.wasm" ;
5252};
5353
5454let is_wasi_module = mod_name => {
5555 mod_name == "wasi_snapshot_preview1" ;
5656};
5757
58- let is_wasi_polyfill_module = mod_path =>
59- mod_path == resolve(wasi_polyfill_module() );
58+ let is_wasi_polyfill_module = mod_path => {
59+ mod_path == wasi_polyfill_module() ;
60+ };
6061
6162let new_base_dir = Filename . dirname;
6263
@@ -99,15 +100,14 @@ let rec build_dependency_graph = (~base_dir, mod_path) => {
99100 // Perform any WASI polyfilling. Note that we skip this step if we are compiling the polyfill module itself.
100101 // If we are importing a foreign from WASI, then add a dependency to the polyfill instead.
101102 let imported_module = wasi_polyfill_module() ;
102- let resolved_import = resolve(imported_module);
103- if (! Hashtbl . mem(modules, resolved_import)) {
104- Hashtbl . add(modules, resolved_import, load_module(resolved_import));
103+ if (! Hashtbl . mem(modules, imported_module)) {
104+ Hashtbl . add(modules, imported_module, load_module(imported_module));
105105 build_dependency_graph(
106- new_base_dir(resolved_import ),
107- resolved_import ,
106+ new_base_dir(imported_module ),
107+ imported_module ,
108108 );
109109 };
110- G . add_edge(dependency_graph, mod_path, resolved_import );
110+ G . add_edge(dependency_graph, mod_path, imported_module );
111111 };
112112 };
113113};
@@ -416,7 +416,7 @@ let link_all = (linked_mod, dependencies, signature) => {
416416 let wasi_polyfill = wasi_polyfill_module() ;
417417 let new_name =
418418 Hashtbl . find_opt(
419- Hashtbl . find(exported_names, resolve( wasi_polyfill) ),
419+ Hashtbl . find(exported_names, wasi_polyfill),
420420 imported_name,
421421 );
422422 let new_name =
0 commit comments