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

BUG: proper cross-compiling support for Arm #240

Open
2 tasks done
nathanjhood opened this issue Dec 19, 2024 · 2 comments
Open
2 tasks done

BUG: proper cross-compiling support for Arm #240

nathanjhood opened this issue Dec 19, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@nathanjhood
Copy link
Member

Bug report

Thank you for reporting an issue with StoneyDSP.

If you are looking for help, please try these first:

Before opening a bug report, please verify the following:

  • I confirm this is a bug with StoneyDSP, not with my own application or with JUCE.
  • I confirm I have searched the Docs, GitHub Discussions, and Discord.

Describe the bug?

A clear and concise description of what the bug is.

Detailed steps on how to reproduce the bug?

The CI started failing just now for MacOS builds; a little deep deive into what has happened:

  • I "fixed" the CMake Presets once I realised that I'd mistakenly used strings in the inheritance fields, instead of a string array
  • once I amended the above, the "correct" behaviour kicked in, which populated all osx-based CMake Presets with CMAKE_OSX_ARCHITECTURES=x86_64;arm64 and VCPKG_OSX_ARCHITECTURES=x86_64;arm64 - this behaviour is just something I copied from JUCE and need to understand better...
  • when the above two vars are correctly set, as they are now thanks to the above changes, the build step (looks like the linker, specifically) gets really confused about architectures, and fails when attempting to link an ARM-based installation of Catch2 to an x64-based plugin
  • inspecting the linker args shows that both -arch x64 and -arch arm64 are being passed to the linker; no doubt, due to those vars above now being "correctly" defined...

What is the expected behaviour?

Link step should succeed and CI should pass.

Screenshots?

If applicable, add screenshots to help explain your problem.

Operating system(s), version(s), architectures?

MacOS x86_64 and ARM64

Additional context?

ideas

  • easy solution - populate the *_OSX_ARCH vars with only a single arch per configure-preset
  • medium solution - add another step to acquire the deps for both arch's on Mac, and hope the build is ok with it
  • advanced solution - add hidden presets for x64 or arm64 as host arch, and x64 or arm64 as target arch, and build full cross-compiler support
@nathanjhood nathanjhood added the bug Something isn't working label Dec 19, 2024
@nathanjhood
Copy link
Member Author

Here is the offending code from CMakePresets.json:

    // ...
      "cacheVariables": {
        "CMAKE_OSX_ARCHITECTURES": {
          "value": "x86_64;arm64",
          "type": "STRING"
        },
        "VCPKG_OSX_ARCHITECTURES": {
          "value": "x86_64;arm64",
          "type": "STRING"
        }
      },
      "environment": {
        "CMAKE_OSX_ARCHITECTURES": "x86_64;arm64",
        "VCPKG_OSX_ARCHITECTURES": "x86_64;arm64"
      }
    // ...

Some notes:

All the above is for posterity. Testing removing the *_OSX_ARCHITECTURES vars temporarily...

@nathanjhood
Copy link
Member Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant