-
Notifications
You must be signed in to change notification settings - Fork 12
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Auto download Wasmer libs for module use #22
Comments
You got the description of downloading Wasmer libraries correct. Also note that windows supports both mingw and mvsc which corresponds to .a and .lib. |
Fails here: https://github.com/V-Sekai/godot/actions/runs/4867601731/jobs/8680337146 Trying to get more screenshots |
Pushed a fix in aa4b49e (Godot 3.x) and e6bb0ee (Godot 4.x). The issue was that the Wasmer library wasn't being downloaded for the Also addresses using a @fire Lemme know if this will suffice and I'll close this issue. Edit: For posterity's sake, here's the workflow being discussed. |
Ignore this. GDNative and GDExtension use |
Doing a test now. Made a pr for #23 Waiting for https://github.com/V-Sekai/godot/actions/runs/4880026588/jobs/8707264367 |
Modified:
In wasm.h to have a check for mingw. |
> git diff
diff --git a/modules/wasm/SCsub b/modules/wasm/SCsub
index 0f8a3342402..918495c0a99 100644
--- a/modules/wasm/SCsub
+++ b/modules/wasm/SCsub
@@ -17,6 +17,7 @@ elif env["platform"] in ["osx", "macos"]:
env.Append(LINKFLAGS=["-framework", "Security"])
elif env["platform"] == "windows":
module_env["LIBWASMERSUFFIX"] = ".a" if env.get("use_mingw") else ".dll.lib"
+ env.Append(LIBS=["userenv"])
# Explicit static libraries
wasmer_library = env.File(
diff --git a/modules/wasm/utils.py b/modules/wasm/utils.py
index 725da531c20..dcc2d089011 100644
--- a/modules/wasm/utils.py
+++ b/modules/wasm/utils.py
@@ -47,4 +47,7 @@ def download_wasmer(env, force=False, version=VERSION_DEFAULT):
elif env["platform"] in ["linux", "linuxbsd"]:
download_tarfile(BASE_URL.format(version, "linux-amd64"), "wasmer")
elif env["platform"] == "windows":
- download_tarfile(BASE_URL.format(version, "windows-amd64"), "wasmer")
+ if env.get("use_mingw"):
+ download_tarfile(BASE_URL.format(version, "windows-gnu64"), "wasmer")
+ else:
+ download_tarfile(BASE_URL.format(version, "windows-amd64"), "wasmer") I was able to launch on windows with the wasm.h changes. |
Created #26 to capture failing MinGW build. |
@fire Huge thanks for all of the feedback you've provided! I think I've addressed everything you mentioned. All outstanding tasks have been rolled into their own issues seeing as we've gone on a bit of a tangent here. Let me know if anything's been missed. |
I'm a bit tired, so I'll let you know when I do an update. I believe you can use a hot patch on the wasmer includes. Like literally apply a diff. |
We can close this one though. |
No rush at all! Yeah I'm sure there are plenty of workarounds but figured I'd open a PR in case others faced the same issue. Closing this. |
Should download Wasmer libs (if required) when Godot Wasm used as a module i.e. in SCsub. Spawned from this comment. This may be a good opportunity to abstract the Wasmer lib download functionality already present in SConstruct.
The text was updated successfully, but these errors were encountered: