Skip to content
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

Linking userenv is failing #27

Closed
fire opened this issue May 5, 2023 · 19 comments
Closed

Linking userenv is failing #27

fire opened this issue May 5, 2023 · 19 comments
Labels
bug Something isn't working

Comments

@fire
Copy link

fire commented May 5, 2023

I have no idea why. https://github.com/V-Sekai/godot/actions/runs/4897415488/jobs/8745444818

userenv is failing.

https://user-images.githubusercontent.com/32321/236567536-dd3a5a1c-d9e0-4c7d-81cf-4cd23b9dde88.png

image

@fire

This comment was marked as off-topic.

@ashtonmeuser
Copy link
Owner

I'll dig out my dusty old Windows machine and investigate this. Haven't even taken a look but if you've got the time, try using the libraries used in SConstruct.

@fire
Copy link
Author

fire commented May 6, 2023

'userenv.windows.template_release.x86_64.lib' is not a valid library name from Microsoft

@ashtonmeuser
Copy link
Owner

Sounds like it's using the library suffix inherited from Godot when it shouldn't be. Can we define it explicitly with env.File()?

The only reason this lib was included is this comment. What happens if we just drop it for MSVC builds?

@fire
Copy link
Author

fire commented May 6, 2023

I won't be able to use godot-wasm then because our builds use llvm-mingw.

Oh you mean like block msvc, worth a try?

Like

if env.msvc:
  pass

@ashtonmeuser
Copy link
Owner

Sorry still out and about so just spitballing here. I'll take a closer look shortly. I'm definitely not saying we drop your use case! We'll figure it out!

@fire
Copy link
Author

fire commented May 6, 2023

I think your suggestion worked, when https://github.com/V-Sekai/godot/actions/runs/4899298148/jobs/8749165531 finishes I 'll try to pr.

image

@fire

This comment was marked as off-topic.

@ashtonmeuser
Copy link
Owner

Amazing! Thanks for doing the legwork here. Feel free to open a similar PR against master for that long overdue contributor credit. Otherwise, I'll cherrypick.

@fire
Copy link
Author

fire commented May 6, 2023

Closing because issue is resolved.

@ashtonmeuser
Copy link
Owner

Likely related to godotengine/godot#23687. The same issue doesn't affect GDNative/GDExtension addons because I'm overwriting env["LIBSUFFIX"] in SConstruct. Hesitant to do the same thing in SCsub as it would be applied to the engine's env. Looking into this further.

@ashtonmeuser ashtonmeuser changed the title userenv is failing on wasm import Linking userenv is failing May 7, 2023
@ashtonmeuser
Copy link
Owner

This seems like a deficiency of Godot and possibly Scons. Godot changing LIBSUFFIX seems pretty heavy handed and basically precludes modules from using Windows SDK libs.

That said, I've got an idea for a workaround involving Scons AddPreAction. This is run after compilation but before linking. Should be able to parse the auto-generated _LIBFLAGS and edit Windows SDK lib names.

@ashtonmeuser
Copy link
Owner

ashtonmeuser commented May 7, 2023

I went with the Ugly Fuck It Solution™ and added the Windows SDK libs directly to LINKFLAGS for MSVC builds which is explicitly recommended against by SCons. This seems to be a begrudgingly-accepted solution here: godotengine/godot#23687. I'm sure there's a really clever workaround here but this'll do. This is well into the territory of a kludgy Godot idiosyncrasy.

@fire Give it a shot! I've also created #33 to eventually remove dependence on your Godot fork (which has been super helpful ❤️) and provide the engine with Godot Wasm baked in as a module.

@fire
Copy link
Author

fire commented May 7, 2023

Testing now. Wait an hour :'(

@ashtonmeuser
Copy link
Owner

I'd love to know why Godot 4 builds so much slower.

@fire
Copy link
Author

fire commented May 8, 2023

Cache doesn't work well when the build never succeeds because it starts from the last cache. (which is empty)

@fire
Copy link
Author

fire commented May 8, 2023

Hype! The game template passed. Pending game editor.

@fire
Copy link
Author

fire commented May 8, 2023

Passed. 🎉

@fire fire closed this as completed May 8, 2023
@ashtonmeuser
Copy link
Owner

Cache doesn't work well when the build never succeeds because it starts from the last cache.

Great point! Woooooooooooo I see green 🎉🎉🎉 Next builds should be a little faster! Thanks so much for all your help with this!

@ashtonmeuser ashtonmeuser added the bug Something isn't working label May 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants