Skip to content

Support pyodide xbuildenv install-emscripten on Windows#322

Open
Andrej730 wants to merge 2 commits intopyodide:mainfrom
Andrej730:xbuildenv-emscripten-windows
Open

Support pyodide xbuildenv install-emscripten on Windows#322
Andrej730 wants to merge 2 commits intopyodide:mainfrom
Andrej730:xbuildenv-emscripten-windows

Conversation

@Andrej730
Copy link
Copy Markdown
Contributor

Hi! Added support for running pyodide xbuildenv install-emscripten command on Windows.

@Andrej730 Andrej730 force-pushed the xbuildenv-emscripten-windows branch from 9a13886 to a5bf3dd Compare April 3, 2026 09:38
@ryanking13 ryanking13 self-requested a review April 3, 2026 10:32
Copy link
Copy Markdown
Member

@agriyakhetarpal agriyakhetarpal left a comment

Choose a reason for hiding this comment

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

Neat! We don't have CI for Windows running here, so would you be keen to add it to the matrix and check if everything is good?

The Windows machine I have is pretty old, so all I can do is trust what the CI says.

@ryanking13
Copy link
Copy Markdown
Member

Thanks! I will review this more carefully when I have time, but overall it looks okay.

One question: which compilers are you using in Windows to build the Python package for Pyodide? We only proxy gcc not the Visual Studio toolchains, so I was wondering if you are using mingw, or something else.

@agriyakhetarpal
Copy link
Copy Markdown
Member

One question: which compilers are you using in Windows to build the Python package for Pyodide? We only proxy gcc not the Visual Studio toolchains, so I was wondering if you are using mingw, or something else.

@ryanking13 I assume it's not related to the Emscripten installation being done here because we fetch precompiled binaries of the SDK, but in general, I'd agree, MSVC is another pile of mess with its massive and tangled collection of differences from gcc and it might take a good amount of work to support it 😅

@Andrej730
Copy link
Copy Markdown
Contributor Author

Fixed the failing tests, should be good now.

Neat! We don't have CI for Windows running here, so would you be keen to add it to the matrix and check if everything is good?

The Windows machine I have is pretty old, so all I can do is trust what the CI says.

I'll try to find some time to set it up, tried to run pytest on Windows - lots of red messages, we'll need to address them first before setting up CI.

One question: which compilers are you using in Windows to build the Python package for Pyodide? We only proxy gcc not the Visual Studio toolchains, so I was wondering if you are using mingw, or something else.

I mainly was doing just tests with building pyodide packages on Windows, I wasn't building anything production-ready on Windows yet. But the intention is to, ideally, establish a way to build pyodide package on Windows without mingw/cygwin/wsl subsystem.

Was hacking something with pyodide-build yesterday and it seems the best shot at this is to use cmdclass={'build_ext': UnixBuildExt}, in package's setup.py and override msvc compiler with unix (see below)
Given that Python's build would be able to discover .bat files from pyodide-build and recognize them as "gcc toolchain tools", then in theory it should just work.
MSVC is indeed a lot of mess and making pyodide-build work with it directly seems like too much 😅

class UnixBuildExt(build_ext):
    def finalize_options(self):
        super().finalize_options()
        if sys.platform == 'win32':
            # Override compiler type before it's instantiated
            self.compiler = 'unix'

@ryanking13
Copy link
Copy Markdown
Member

But the intention is to, ideally, establish a way to build pyodide package on Windows without mingw/cygwin/wsl subsystem.

Yes, that would be ideal. It would be great if we can add windows support without changing things too much and without having complex compatibility layers.

@ryanking13 ryanking13 closed this Apr 6, 2026
@ryanking13 ryanking13 reopened this Apr 6, 2026
@ryanking13
Copy link
Copy Markdown
Member

(Closed by mistake)

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.

3 participants