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

Impossible to build OpenMSX #1573

Closed
Steveneska opened this issue Dec 22, 2023 · 21 comments
Closed

Impossible to build OpenMSX #1573

Steveneska opened this issue Dec 22, 2023 · 21 comments

Comments

@Steveneska
Copy link

Following the OpenMSX Compilation Guide available here, it is impossible to build OpenMSX on Windows using both MSYS2 or Visual Studio for different reasons: some dependency packages are not available online at the specified download address anymore, impossible to find Python even though it is installed and added to PATH... Could we get a clear step by step instruction guide on how to build OpenMSX?

@MBilderbeek
Copy link
Member

Hi,

Can you be more specific on what is going wrong?

The thing is, none of the developers are Windows users. But we got the Windows build to work on GitHub Actions. So, if you are able to perform the steps from that, you should be able to do it. And with these steps and your experiences, we can improve the documentation.
So, please be very concrete about what you're running into and what it is that is different from the steps on the GitHub Actions. See https://github.com/openMSX/openMSX/blob/master/.github/actions/build/action.yml
There is both a MinGW build and a Visual Studio based build done in there.

@Vampier
Copy link
Contributor

Vampier commented Dec 23, 2023 via email

@Steveneska
Copy link
Author

@MBilderbeek Sorry, I should have shared my environment details earlier. I'm running Visual Studio 2023 / MSYS2 20231026 on Windows 11 Build 22631.2861. I did Google a bit the issue and found that I needed to install Qt as well to build on Windows with Visual Studio? I haven't installed Qt yet though, just cleaned up my PC a couple of days ago. Looking into the Github actions now.

@Vampier that would be much appreciated. Thank you.

@MBilderbeek
Copy link
Member

I assumed that you were talking about openMSX, not another application like Catapult or the separate debugger. In that case, you do not need Qt.

Are you building the latest git code?

@Steveneska
Copy link
Author

Yes, I was trying to build OpenMSX only from the latest Git codebase.

@MBilderbeek
Copy link
Member

Good, then no Qt needed at all. Just tell us what exactly you are running into and we can try to help. As we are building for windows automatically, I still think that method must be working also for you.

@Steveneska
Copy link
Author

Steveneska commented Dec 28, 2023

@MBilderbeek Looking at the Github Actions, I have no issue downloading Windows dependencies and building them but running msbuild /m /p:Configuration=Release /p:Platform=x64 build\msvc\openmsx.sln /m will throw this error:
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: Custom build for '..\..\src\openmsx.hh' exited with code 9009

Looking at the file in question:

<CustomBuild Condition ="'@(_CustomBuild)' != ''"
      Sources                     ="@(_CustomBuild)"
      BuildSuffix                 ="$(_BuildSuffix)"

      MinimalRebuildFromTracking  ="false"
      AcceptableNonZeroExitCodes  ="%(_CustomBuild.AcceptableNonZeroExitCodes)"
      StdOutEncoding = "%(_CustomBuild.StdOutEncoding)"
      StdErrEncoding = "%(_CustomBuild.StdErrEncoding)"
    >
    </CustomBuild>

@Steveneska
Copy link
Author

Using MinGW to build OpenMSX failed when downloading the package pkg-config-0.29.2.tar.gz with error: urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006 error

Downloading the package manually and placing it in the proper directory fixed this issue but later in the process I get:

make -C derived/x86_64-mingw-w64-opt-3rd/3rdparty/build/pkg-config-0.29.2
make[3]: Entering directory '/c/Users/Steven/source/repos/openmsx/derived/x86_64-mingw-w64-opt-3rd/3rdparty/build/pkg-config-0.29.2'
Makefile:312: *** missing separator.  Stop.
make[3]: Leaving directory '/c/Users/Steven/source/repos/openmsx/derived/x86_64-mingw-w64-opt-3rd/3rdparty/build/pkg-config-0.29.2'
make[2]: *** [build/3rdparty.mk:156: derived/x86_64-mingw-w64-opt-3rd/3rdparty/timestamps/build-pkg-config-0.29.2] Error 2
make[2]: Leaving directory '/c/Users/Steven/source/repos/openmsx'
make[1]: *** [build/main.mk:624: run-3rdparty] Error 2
make[1]: Leaving directory '/c/Users/Steven/source/repos/openmsx'
make: *** [build/main.mk:614: 3rdparty] Error 2

@MBilderbeek
Copy link
Member

@MBilderbeek Looking at the Github Actions, I have no issue downloading Windows dependencies and building them but running msbuild /m /p:Configuration=Release /p:Platform=x64 build\msvc\openmsx.sln /m will throw this error: C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(254,5): error MSB8066: Custom build for '..\..\src\openmsx.hh' exited with code 9009

Looking at the file in question:

<CustomBuild Condition ="'@(_CustomBuild)' != ''"
      Sources                     ="@(_CustomBuild)"
      BuildSuffix                 ="$(_BuildSuffix)"

      MinimalRebuildFromTracking  ="false"
      AcceptableNonZeroExitCodes  ="%(_CustomBuild.AcceptableNonZeroExitCodes)"
      StdOutEncoding = "%(_CustomBuild.StdOutEncoding)"
      StdErrEncoding = "%(_CustomBuild.StdErrEncoding)"
    >
    </CustomBuild>

What can I say? It works on GitHub Actions, so I'm not sure what's going wrong. That error code seems to be a 'file not found' but I can't see which command was running and which file was not found. I'm not running Windows myself, so I can't try it (hence my pointing to GitHub Actions).

@MBilderbeek
Copy link
Member

Using MinGW to build OpenMSX failed when downloading the package pkg-config-0.29.2.tar.gz with error: urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1006 error

Downloading the package manually and placing it in the proper directory fixed this issue but later in the process I get:

make -C derived/x86_64-mingw-w64-opt-3rd/3rdparty/build/pkg-config-0.29.2
make[3]: Entering directory '/c/Users/Steven/source/repos/openmsx/derived/x86_64-mingw-w64-opt-3rd/3rdparty/build/pkg-config-0.29.2'
Makefile:312: *** missing separator.  Stop.
make[3]: Leaving directory '/c/Users/Steven/source/repos/openmsx/derived/x86_64-mingw-w64-opt-3rd/3rdparty/build/pkg-config-0.29.2'
make[2]: *** [build/3rdparty.mk:156: derived/x86_64-mingw-w64-opt-3rd/3rdparty/timestamps/build-pkg-config-0.29.2] Error 2
make[2]: Leaving directory '/c/Users/Steven/source/repos/openmsx'
make[1]: *** [build/main.mk:624: run-3rdparty] Error 2
make[1]: Leaving directory '/c/Users/Steven/source/repos/openmsx'
make: *** [build/main.mk:614: 3rdparty] Error 2

Also strange. The same file is downloaded from Linux just fine. We cross-compile on Linux to Windows on GitHub Actions.

@Steveneska
Copy link
Author

Yes, when building from WSL (Windows Subsystem for Linux), I had no issue downloading dependencies. The reason I don't run WSL anymore (or at least right now) is because it disables overclocking and hurt performance in some games I run on my PC.

I used the Github Actions to build with MSBuild but still got the same errors. Could be that OpenMSX uses a previous version of VC++ that I'm missing in my VS install? I will investigate further to find out.

@MBilderbeek
Copy link
Member

You can see which version is used on the GitHub Actions runners overview: https://github.com/actions/runner-images/blob/main/images/windows/Windows2022-Readme.md Looks like it's Visual Studio Enterprise 2022 (we use windows-latest).

@MBilderbeek
Copy link
Member

Any news?

@Steveneska
Copy link
Author

I haven't looked into it lately. Will try to build again later tonight and update my comment.

@MBilderbeek
Copy link
Member

Any results?

@Steveneska
Copy link
Author

Steveneska commented Apr 19, 2024

Sorry for the late reply, I finally got around testing it. Using the latest code base I don't have any issue building dependencies with python build\thirdparty_download.py windows but MSBuild still throws its temper with Python.

EDIT 1: After some investigation the solution about "Python not found" was to disable its application execution aliases in Settings. Now still running into another Python related issue.

EDIT 2: IT IS BUILDING! The issue preventing the build was that the MSVC related files referenced the Python executable as "python3" in command line instead of "python" (there is no python3.exe on Windows). Maybe using "py" instead to be version agnostic would fix this?

So just to recap running msbuild /m /p:Configuration=Release /p:Platform=x64 build\3rdparty\3rdparty.sln /m and msbuild /m /p:Configuration=Release /p:Platform=x64 build\msvc\openmsx.sln /m works in the Developper Command Prompt on Windows now.

@MBilderbeek
Copy link
Member

Apparently on the GitHub runners there is python3.exe....

@Steveneska
Copy link
Author

Yeah I don't know what that might be. The official Python installer on Windows creates a Python3 folder with a Python.exe file in it but no Python3.exe to be found

@MBilderbeek
Copy link
Member

If you have any suggestions on how to improve the documentation (or other parts of openMSX), feel free to submit a pull request.

@MBilderbeek
Copy link
Member

Considering this closed. But documentation improvement suggestions are still most welcome. (Especially in the form of a Pull Request.)

@Steveneska
Copy link
Author

Been a bit busy lately but I will definitely add to the documentation as soon as possible

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

No branches or pull requests

3 participants