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

Enable actual build tests in Windows/Appveyor CI #83

Closed
ianfixes opened this issue Mar 2, 2019 · 11 comments · May be fixed by #109
Closed

Enable actual build tests in Windows/Appveyor CI #83

ianfixes opened this issue Mar 2, 2019 · 11 comments · May be fixed by #109
Labels
BasiliskII Affects BasiliskII executable CI Continuous Integration enhancement New feature or request Windows Affects Windows build
Milestone

Comments

@ianfixes
Copy link
Member

ianfixes commented Mar 2, 2019

Appveyor is running a null test right now as proof of concept. Replace with a build test

Build matrix

macOS 64-bit ---
Linux 32-bit JIT
MinGW 32-bit JIT

How To Build

These builds need to be installed SDL2 framework/library.

MinGW32/MSYS

$ cd macemu/BasiliskII/src/Windows
$ ../Unix/autogen.sh
$ make

also:
https://www.emaculation.com/doku.php/compiling_sheepshaver_basilisk

@ianfixes ianfixes added enhancement New feature or request CI Continuous Integration Windows Affects Windows build labels Mar 2, 2019
@ianfixes ianfixes added this to the Stabilization milestone Mar 12, 2019
@ianfixes ianfixes added the BasiliskII Affects BasiliskII executable label Mar 28, 2019
@rakslice
Copy link
Contributor

rakslice commented Oct 15, 2020

I took a glance at the Windows builds linked from https://github.com/emaculation/macemu previously and was confused about the state of the build jobs because they say 'MSYS' above the links but the build jobs are using Cygwin, not MSYS.

I guess that this build setup with Cygwin is something that would have worked with the older codebase, and once upon a time this was the main way of building, but it doesn't work at the moment. (See below.)

If you look at Appveyor's list of installed software in build VMs, in the "MinGW, MSYS, Cygwin" category
there are really four kinds of things there, in order:

  • MSYS 1 with a 32-bit MinGW
  • Some standalone MinGW-w64 that they stopped putting in the latest VM images
  • Cygwin
  • MSYS2

So MSYS would be either the first one or the last one.

Background:

/usr/include/w32api/WinSock2.h:995:34: error: conflicting declaration of C function 'int select(int, _types_fd_set*, _types_fd_set*, _types_fd_set*, PTIMEVAL)'
   WINSOCK_API_LINKAGE int WSAAPI select(int nfds,fd_set *readfds,fd_set *writefds,fd_set *exceptfds,const PTIMEVAL timeout);
                                  ^~~~~~
In file included from /usr/include/sys/types.h:52:0,
                 from /usr/include/pthread.h:11,
                 from /usr/lib/gcc/i686-pc-cygwin/7.4.0/include/c++/i686-pc-cygwin/bits/gthr-default.h:35,
                 from /usr/lib/gcc/i686-pc-cygwin/7.4.0/include/c++/i686-pc-cygwin/bits/gthr.h:148,
                 from /usr/lib/gcc/i686-pc-cygwin/7.4.0/include/c++/ext/atomicity.h:35,
                 from /usr/lib/gcc/i686-pc-cygwin/7.4.0/include/c++/memory:73,
                 from ./user_strings_windows.h:26,
                 from ./sysdeps.h:33,
                 from ../main.cpp:21:
/usr/include/sys/select.h:62:5: note: previous declaration 'int select(int, _types_fd_set*, _types_fd_set*, _types_fd_set*, timeval*)'
 int select __P ((int __n, fd_set *__readfds, fd_set *__writefds,
     ^~~~~~
make: *** [Makefile:148: obj/main.o] Error 1
Command exited with code 2

This is a typical kind of problem you get when you build code intended for MinGW for the regular Cygwin POSIX environment instead: The APIs from Windows headers run into the APIs from the POSIX-style headers. On Windows, normally the only select() is the one you use for network sockets, here coming from WinSock2.h, but of course Cygwin as a full POSIX environment provides its own select() to use with all sorts of handles such as file handles.

There was an option in the Cygwin gcc, -mno-cygwin, that would tell it to build for native Windows APIs and not for Cygwin, and that the macemu Windows Makefiles used to use. I suspect it was removed from the macemu Makefiles because the regular MinGW tools stopped recognizing it to even ignore.

@rakslice
Copy link
Contributor

rakslice commented Oct 15, 2020

I already have an Appveyor build job for macemu using MSYS2 that I'm using to build branches off of kanjitalk755's repo. I don't have an appveyor.yml for it, I've just configured it through the Appveyor web interface. I'll see if I can put one together.

@rakslice
Copy link
Contributor

rakslice commented Oct 15, 2020

Why, in appveyor.yml, is your build a test instead of a build?

@rakslice
Copy link
Contributor

Er, also https://github.com/emaculation/macemu says "32-bit" but your appveyor.yml says "CYG_ARCH: x86_64".

@rakslice
Copy link
Contributor

rakslice commented Oct 16, 2020

Wait, is the Windows code in the master branch here actually in a buildable state at all?

g++ -I../include -I. -I../CrossPlatform -I../uae_cpu -I../slirp -DHAVE_CONFIG_H  -DDIRECT_ADDRESSING -DUNALIGNED_PROFITABLE -DREGPARAM="__attribute__((regparm(3)))" -DX86_ASSEMBLY -DOPTIMIZED_FLAGS -DSAHF_SETO_PROFITABLE -DUSE_JIT -DUSE_JIT_FPU -DFPU_IEEE -O2 -I/mingw32/include/SDL2 -Dmain=SDL_main -c ../main.cpp -o obj/main.o
g++ -I../include -I. -I../CrossPlatform -I../uae_cpu -I../slirp -DHAVE_CONFIG_H  -DDIRECT_ADDRESSING -DUNALIGNED_PROFITABLE -DREGPARAM="__attribute__((regparm(3)))" -DX86_ASSEMBLY -DOPTIMIZED_FLAGS -DSAHF_SETO_PROFITABLE -DUSE_JIT -DUSE_JIT_FPU -DFPU_IEEE -O2 -I/mingw32/include/SDL2 -Dmain=SDL_main -c main_windows.cpp -o obj/main_windows.o
g++ -I../include -I. -I../CrossPlatform -I../uae_cpu -I../slirp -DHAVE_CONFIG_H  -DDIRECT_ADDRESSING -DUNALIGNED_PROFITABLE -DREGPARAM="__attribute__((regparm(3)))" -DX86_ASSEMBLY -DOPTIMIZED_FLAGS -DSAHF_SETO_PROFITABLE -DUSE_JIT -DUSE_JIT_FPU -DFPU_IEEE -O2 -I/mingw32/include/SDL2 -Dmain=SDL_main -c ../prefs.cpp -o obj/prefs.o
g++ -I../include -I. -I../CrossPlatform -I../uae_cpu -I../slirp -DHAVE_CONFIG_H  -DDIRECT_ADDRESSING -DUNALIGNED_PROFITABLE -DREGPARAM="__attribute__((regparm(3)))" -DX86_ASSEMBLY -DOPTIMIZED_FLAGS -DSAHF_SETO_PROFITABLE -DUSE_JIT -DUSE_JIT_FPU -DFPU_IEEE -O2 -I/mingw32/include/SDL2 -Dmain=SDL_main -c ../prefs_items.cpp -o obj/prefs_items.o
In file included from C:/msys64/mingw32/i686-w64-mingw32/include/minwindef.h:163,
                 from C:/msys64/mingw32/i686-w64-mingw32/include/windef.h:9,
                 from C:/msys64/mingw32/i686-w64-mingw32/include/windows.h:69,
                 from sysdeps.h:50,
                 from main_windows.cpp:21:
main_windows.cpp:66:36: error: cannot initialize array of 'wchar_t' from a string literal with type array of 'char'
   66 | const TCHAR ROM_FILE_NAME[] = TEXT("ROM");
      |                                    ^~~~~
main_windows.cpp: In function 'int SDL_main(int, char**)':
main_windows.cpp:367:38: error: cannot convert 'const wchar_t*' to 'LPCSTR' {aka 'const char*'}
  367 |  HANDLE rom_fh = CreateFile(rom_path ? rom_path.get() : ROM_FILE_NAME,
      |                             ~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                                      |
      |                                      const wchar_t*
In file included from C:/msys64/mingw32/i686-w64-mingw32/include/winbase.h:18,
                 from C:/msys64/mingw32/i686-w64-mingw32/include/windows.h:70,
                 from sysdeps.h:50,
                 from main_windows.cpp:21:
C:/msys64/mingw32/i686-w64-mingw32/include/fileapi.h:53:48: note:   initializing argument 1 of 'void* CreateFileA(LPCSTR, DWORD, DWORD, LPSECURITY_ATTRIBUTES, DWORD, DWORD, HANDLE)'
   53 |   WINBASEAPI HANDLE WINAPI CreateFileA (LPCSTR lpFileName, DWORD dwDesiredAccess, DWORD dwShareMode, LPSECURITY_ATTRIBUTES lpSecurityAttributes, DWORD dwCreationDisposition, DWORD dwFlagsAndAttributes, HANDLE hTemplateFile);
      |                                         ~~~~~~~^~~~~~~~~~
make: *** [Makefile:148: obj/main_windows.o] Error 1

@ianfixes
Copy link
Member Author

I can't speak to whether this branch is buildable, for how long it hasn't been buildable.

I put this project on GitHub (forking from the original and doing my best to merge in the latest from actively developed forks like @kanjitalk755 has) in an attempt to bring its development into the GitHub age -- with all the continuous integration and pull request reviewing that we expect in 2020.

Not having access to a windows machine (aside from Appveyor's remote option), I'm really not sure how to push the config forward and I will gladly accept any working build scripts that you have on this platform! What you're seeing here is my own trial and error that ultimately resulted in me reaching the limits of my expertise there.

@rakslice
Copy link
Contributor

See PR #136 and #137

@rakslice
Copy link
Contributor

One way to get a 'Windows machine': Microsoft provides VM images with 90-day unactivated trial copies of the Windows for IE/Edge browser testing, but these that will run software other than the browser provided that it works without installing additional OS components that require activation. The license permits non-commercial testing use and does not specify browser use particularly.

If you don't already have a virtualization software installed that you prefer I recommend VirtualBox, but if you're on a Linux distro that doesn't package VirtualBox and does package a KVM frontend like virt-manager, you may want to figure out how to use that instead. https://github.com/lentinj/ie-vm (These are referred to as 'modern.ie' VMs because before the era of Edge they used to be distributed from Microsoft's modern.ie site)

@rakslice
Copy link
Contributor

One of the items on my to-do list is to set up a Vagrant config for Windows to simplify the process of testing in it if you don't normally deal with it.

@ianfixes
Copy link
Member Author

The Appveyor folks have a good solution for this which I had tried earlier: https://www.appveyor.com/docs/how-to/rdp-to-build-worker/

I'm just not an expert in installing any of the dependencies or MinGW builds (I come from a Linux background) so that's where I got stuck with remote desktop

@ianfixes
Copy link
Member Author

I think this can be closed, as we are now testing a build in Appveyor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
BasiliskII Affects BasiliskII executable CI Continuous Integration enhancement New feature or request Windows Affects Windows build
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants