Skip to content

Conversation

@culix-7
Copy link

@culix-7 culix-7 commented Jan 8, 2026

Hello, it appears that on the lastest master branch commit, fabc9a6 , some of the current mac and linux builds are broken in GitHub cloud builders.
But with just a few small edits - it is easy to fix them and make them pass again.

I created a test PR in my own fork of the repo so I could run the GitHub runners and fix.
You can see here that several of the builds fail - https://github.com/culix-7/Mesen2/actions/runs/20806315078

I have made several edits in this PR to fix the build. You can see with this that all of the builds now pass! - https://github.com/culix-7/Mesen2/actions/runs/20828681806

I realize that reading makefiles can be messy, and this might be a large number of changes. I have tried to clean up the commits to make them clear and easy to follow.

Essentially:

  • Move the linux and mac prebuild steps for the UI project out of the Visual Studio project file and into a UI/prebuild_linux_mac.sh file. Hopefully this makes it easier to view and edit for the future.
  • Fix a few path calculations in the prebuild step
  • Add some install dependencies that were missing
  • Update the mac OS 13 runner to mac OS 14. 13 has been officially turned off by GitHub as of December 2025 - [macOS] The macOS 13 Ventura based runner images will begin deprecation on September 22nd and will be fully unsupported by December 4th for GitHub and ADO actions/runner-images#13046
  • Add some new targets in the makefile to run tests.
    • verify-all-env: checks all of the UNAME_S, MACHINE, and platform/os flags that we use during building.
    • Anyone can call make verify-all-env on the command line to test this and verify that the makefile logic does the right thing.
    • Hopefully this makes it a bit easier to edit and test the makefile in the future
  • Add a new verify-env target to test just one platform.
    • I added this as a 'sanity check' step to the mac and linux builds, to make sure we can find the right paths etc. before we spend time building
  • After all that - cleaned up some of the makefile logic so it calculates the right architecture and uses all of the right paths during building

With that - everything passes! :D

You can see a passing run here - https://github.com/culix-7/Mesen2/actions/runs/20828681806

I hope that helps.

..

Before:

mesen_build_steps_before

After:

mesen_build_steps_after

@culix-7 culix-7 force-pushed the test-build-master branch from 052d5bf to 961571b Compare January 8, 2026 05:42
@culix-7 culix-7 marked this pull request as draft January 8, 2026 06:14
@culix-7 culix-7 force-pushed the test-build-master branch from a445a2b to 36d0ef4 Compare January 8, 2026 19:12
@culix-7 culix-7 changed the title test: does current master branch build Fix linux + mac builds Jan 8, 2026
@culix-7 culix-7 marked this pull request as ready for review January 8, 2026 19:33
@culix-7 culix-7 changed the title Fix linux + mac builds 1. Fix linux + mac builds Jan 9, 2026
it's easier to build and view in a separate script

no functional changes
macOS 13 images have been officially turned off by GitHub

actions/runner-images#13046
flag should work by itself; is not expecting a value
the current version works fine on a local command line, but not in the cloud when parsed through 'make'
We don't want any PRs trying to sign themselves as an official, merged Mesen build
but they would all fail anyway because PRs don't have access to the signing keys (only the main repo has that, after PRs are merged)
more flexible if the path changes
some mac builds are passing with the new find command,
but others are failing bc of the `UNAME` value

```
(clang, macos-14, arm64) works:
>Found app at: bin/osx-arm64/Release/osx-arm64/publish/Mesen.app

(clang_aot, macos-14, arm64) works:
>Found app at: bin/osx-arm64/Release/osx-arm64/publish/Mesen.app

(clang, macos-14, x64) failed:
>find: bin/osx-x64: No such file or directory

(clang_aot, macos-14, x64) failed:
>find: bin/osx-x64: No such file or directory
```


add a make test so we can see what is happening and fix/enforce it

currently:

```
Checking Makefile architecture detection logic...
------------------------------------------------
Input: Linux-x86_64    | Expected Platform: linux-x64    | Expected Arch Flag: -m64
Input: Linux-aarch64   | Expected Platform: linux-arm64  | Expected Arch Flag:
Input: Darwin-x86_64   | Expected Platform: osx-x64      | Expected Arch Flag: -m64
Input: Darwin-arm64    | Expected Platform: osx-arm64    | Expected Arch Flag: -m64
Input: Darwin-aarch64  | Expected Platform: osx-arm64    | Expected Arch Flag: -m64
------------------------------------------------
```

Right now this just prints them.
need to refactor the makefile a bit to actually test it
that will be in the next commit
use ?= for setting uname and machine, so we can test our own makefile

now it gives:

```
$ make test-all-configs
Validating makefile architecture detection:
----------------------------------------------------------------------------------------------------------
INPUT           | EXPECTED (PLAT/FLAGS)     | ACTUAL (PLAT/FLAGS)       | RESULT
----------------------------------------------------------------------------------------------------------
Linux-x86_64    | linux-x64     -m64        | linux-x64     -m64        | PASS
Linux-aarch64   | linux-arm64               | linux-arm64               | PASS
Darwin-x86_64   | osx-x64       -m64        | osx-x64       -m64        | PASS
Darwin-arm64    | osx-arm64     -m64        | osx-arm64     -m64        | PASS
Darwin-aarch64  | osx-arm64     -m64        | osx-arm64     -m64        | PASS
----------------------------------------------------------------------------------------------------------
```
manual test: I can prove this works by changing any of the `MESENPLATFORM :=` lines

e.g.

`MESENPLATFORM := $(MESENOS)-bad!`

gives

```
----------------------------------------------------------------------------------------------------------
INPUT           | EXPECTED (PLAT/FLAGS)     | ACTUAL (PLAT/FLAGS)       | RESULT
----------------------------------------------------------------------------------------------------------
Linux-x86_64    | linux-x64     -m64        | linux-bad!    -m64        | FAIL
```
1. verify-all-env: you can run this in your shell
to test and check that the current Makefile logic works or not

```
----------------------------------------------------------------------------------------------------------
INPUT           | EXPECTED (PLAT/FLAGS)             | ACTUAL (PLAT/FLAGS)             | RESULT
----------------------------------------------------------------------------------------------------------
Linux-x86_64    | linux-x64     -m64        | linux-x64     -m64        | PASS
Linux-aarch64   | linux-arm64               | linux-arm64               | PASS
Darwin-x86_64   | osx-x64       -m64        | osx-x64       -m64        | PASS
Darwin-arm64    | osx-arm64     -m64        | osx-arm64     -m64        | PASS
Darwin-aarch64  | osx-arm64     -m64        | osx-arm64     -m64        | PASS
----------------------------------------------------------------------------------------------------------
```

I can manually test and verify: if I change a `MESENPLATFORM` line, it breaks
and prints `FAIL` instead

```
Linux-x86_64    | linux-x64     -m64        | linux-x64-bad! -m64        | FAIL
```

2. verify-env: we will hook this up in the build.yml shortly
so we can prove that we are doing the right thing in the build
the tests now correctly detect this failure happening on macos

```
----------------------------------------------------------------------------------------------------------
INPUT           | EXPECTED (PLAT/FLAGS)             | ACTUAL (PLAT/FLAGS)             | RESULT
----------------------------------------------------------------------------------------------------------
Linux-x86_64    | linux-x64     -m64        | linux-x64     -m64        | PASS
Linux-aarch64   | linux-arm64               | linux-arm64               | PASS
Darwin-x86_64   | osx-x64       -m64        | osx-x64       -m64        | PASS
Darwin-arm64    | osx-arm64     -m64        | osx-arm64     -m64        | PASS
Linux-x86_64    | linux-arm64               | linux-x64     -m64        | FAIL
make[1]: *** [makefile:309: test-env-row] Error 1
Darwin-arm64    | osx-x64       -m64        | osx-arm64     -m64        | FAIL
make[1]: *** [makefile:309: test-env-row] Error 1
Linux-x86_64    | linux-arm64               | linux-x64     -m64        | FAIL
make[1]: *** [makefile:309: test-env-row] Error 1
----------------------------------------------------------------------------------------------------------
```
with this change, the tests now pass

```
----------------------------------------------------------------------------------------------------------
INPUT           | EXPECTED (PLAT/FLAGS)             | ACTUAL (PLAT/FLAGS)             | RESULT
----------------------------------------------------------------------------------------------------------
Linux-x86_64    | linux-x64     -m64        | linux-x64     -m64        | PASS
Linux-aarch64   | linux-arm64               | linux-arm64               | PASS
Darwin-x86_64   | osx-x64       -m64        | osx-x64       -m64        | PASS
Darwin-arm64    | osx-arm64     -m64        | osx-arm64     -m64        | PASS
Linux-aarch64   | linux-arm64               | linux-arm64               | PASS
Darwin-x86_64   | osx-x64       -m64        | osx-x64       -m64        | PASS
Linux-aarch64   | linux-arm64               | linux-arm64               | PASS
----------------------------------------------------------------------------------------------------------
Verification Complete. All tests PASSED.
```
keep all of the args for each test in the same order,
so it is easier to visually see:

UNAME MARCHINE E_PLAT ARCH

makefiles are already ugly enough.
do what we can to keep it clean


verify-env still passes:

```
 make verify-all-env
Validating Makefile Architecture Detection Logic:
----------------------------------------------------------------------------------------------------------
INPUT           | EXPECTED (PLAT/FLAGS)             | ACTUAL (PLAT/FLAGS)             | RESULT
----------------------------------------------------------------------------------------------------------
Linux-x86_64    | linux-x64     -m64        | linux-x64     -m64        | PASS
Linux-aarch64   | linux-arm64               | linux-arm64               | PASS
Darwin-x86_64   | osx-x64       -m64        | osx-x64       -m64        | PASS
Darwin-arm64    | osx-arm64     -m64        | osx-arm64     -m64        | PASS
Linux-aarch64   | linux-arm64               | linux-arm64               | PASS
Darwin-x86_64   | osx-x64       -m64        | osx-x64       -m64        | PASS
Linux-aarch64   | linux-arm64               | linux-arm64               | PASS
----------------------------------------------------------------------------------------------------------
``
don't try to do fancy sub-folder guessing.
if we get an architecture env wrong or make a mistake,
it fails to zip.

just search in the main directory and let the 'find' command handle it
currently both
macos (clang_aot, macos-14, x64)
macos (clang,     macos-14, x64)

try to use the same artifact name.
this causes a failure.

add the compiler type so they are distinct
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.

1 participant