-
Notifications
You must be signed in to change notification settings - Fork 824
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
Fix "create-exe" for windows-x86_64 target #3299
Conversation
d2af38e
to
ddf4b33
Compare
On Windows, this function gets used to download zig cc releases from GitHub, but GitHub uses .zip for Windows releases and .tar.gz for everything else. So this function has to accomodate that.
This is currently stuck on
|
Windows build to test: |
We run this test only on linux and macos, on Windows it might or might not work.
Sebastien suggested this to resolve issues on windows 32 bit, but it didn't help anything
@syrusakbary At this point the error is fixed for every system except the All I can do at this point is to report a bug to zig and ask for help. |
Seems like it will go through now. |
bors r+ |
3299: Fix "create-exe" for windows-x86_64 target r=fschutt a=fschutt Co-authored-by: Felix Schütt <[email protected]> Co-authored-by: Felix Schütt <[email protected]>
This PR was included in a batch that successfully built, but then failed to merge into master (it was a non-fast-forward update). It will be automatically retried. |
libwasmer_parent.pop(); | ||
cmd.arg(libwasmer_parent.join("winsdk/ADVAPI32.lib")); | ||
cmd.arg(libwasmer_parent.join("winsdk/BCRYPT.lib")); | ||
cmd.arg(libwasmer_parent.join("winsdk/KERNEL32.lib")); | ||
cmd.arg(libwasmer_parent.join("winsdk/USERENV.lib")); | ||
cmd.arg(libwasmer_parent.join("winsdk/WS2_32.lib")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we have a list of these files?
It might be a good idea to pull them into a constant at the top of the file, that way we can set up tests to make sure all the *.lib
files are always included with Wasmer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, it's just the libraries that I found out that libwasmer.a depends on.
There is no way to find out the libraries, except for using Google to lookup which DLL the missing functions belong to.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh no, what I meant was instead of copy-pasting the cmd.arg(libwasmer_parent.join(...))
line for every library, we should store them in a constant and use a loop.
const VENDORED_LIBRARIES: &[&str] = &[
"ADVAPI32.lib",
"BCRYPT.lib",
...
];
That way we can add a test to the wasmer
CLI that makes sure all the libraries are embedded in the installer. It'd be annoying if the list of libraries we tell the compiler to link against and the list of libraries bundled with wasmer
got out of sync. We probably wouldn't notice until weeks later when our first user wants to do networking and finds we forgot to give them WS2_32.lib
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've made a loop with fs::read_dir
now, so we don't need to hardcode any paths, it will just link to every object in the /winsdk
folder.
.arg(&output_path) | ||
.output() | ||
.context("Could not execute `zig`")? | ||
println!("{:?}", cmd); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can delete this one, too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically we can, but I left it in on purpose so I can see which zig command gets output.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use log::debug!()
, then? End users probably don't want to see the full command-line we are using to generate EXEs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, I migrated to log::debug
No description provided.