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

Use MSVC for the Windows toolchain instead of MinGW #456

Merged
merged 5 commits into from
Jul 23, 2024

Conversation

alexcrichton
Copy link
Collaborator

Explicitly use MSVC to avoid the runtime dependencies that the default toolchain CMake is using is bringing in.

Closes #454

.github/workflows/main.yml Outdated Show resolved Hide resolved
# msys/mingw might bring.
#
# As of 2024-07-22 this sha is the "v1" tag.
- uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was debating between the need for this action versus the risk: it looks like ~17k other projects depend on this, it has more than a few contributors, and the action is relatively simple — if it solves the problem then let's go for it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah I was wrestling with the same. I spend 30 min or so googling around to see if there were other common solutions to this but everything pointed to a github action one way or another so I opted to do that with a specific sha to at least be insulated against changes.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

personally, I would fork any dep like this (in case the repo gets deleted, repurposed, ...)

alexcrichton and others added 3 commits July 22, 2024 11:41
Explicitly use MSVC to avoid the runtime dependencies that the default
toolchain CMake is using is bringing in.

Closes WebAssembly#454
Looks like MSVC defaults to "Debug" instead of an empty string to so the
default logic which works for other compilers isn't kicking in here.
@alexcrichton
Copy link
Collaborator Author

Got a successful CI run, but I'm going to rerun CI to confirm that caching makes it so the next run isn't 2 hours. Afterwards I'll download this on a windows machine and test that things work as expected.

@pavelsavara
Copy link

I was able to compile dotnet/mono using the artifact from this PR on my local windows

@alexcrichton
Copy link
Collaborator Author

The "cached build" took 2+ hours so I'm going to try to dig in to why ccache isn't working.

@alexcrichton
Copy link
Collaborator Author

Hm on a new commit it worked with a ~20m build time, similar to today. Given that I think this is ok, so I'm going to merge.

@alexcrichton alexcrichton merged commit 6387b4f into WebAssembly:main Jul 23, 2024
7 checks passed
@alexcrichton alexcrichton deleted the use-msvc-on-windows branch July 23, 2024 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

wasi-sdk-23 requires libgcc_s_seh-1.dll again
4 participants