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

sanity_checks: Also disable builds by CPU family #1597

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

blue42u
Copy link
Contributor

@blue42u blue42u commented Jul 27, 2024

In some cases the OS is not enough to determine if a build will succeed or fail, the CPU architecture may also change the result. This PR extends tools/sanity_checks.py to additionally consult the host_machine.cpu_family() (as determined by Meson), if either the system or CPU family is marked false the build is expected to fail, unless the composite {system}-{cpu_family} key is true. By example:

"wrap_name": {
  // Build expected to fail on Linux on any CPU, e.g. Linux + aarch64
  "build_on": {"linux": false},

  // Build expected to fail on x86_64 on any OS, e.g. Windows + x86_64
  "build_on": {"x86_64": false},

  // Build expected to fail on Linux on any CPU, and on x86_64 on any OS
  "build_on": {"linux": false, "x86_64": false},

  // Build expected to fail on Linux on any CPU, and on x86_64 on any OS,
  // except build expected to pass on Linux + x86_64
  "build_on": {"linux": false, "x86_64": false, "linux-x86_64": true},
}

In some cases the OS is not enough to determine if a build will succeed
or fail, the CPU architecture (family) may also change the result.
This commit extends the sanity_checks to consult the host CPU family
(as determined by Meson), if either the OS or family is mapped to
`false` in ci_config.json an error is expected. The composite key
`{system}-{cpu_family}` can be used to expect success (or failure) for
particular combinations otherwise marked for failure (or success).
@blue42u blue42u mentioned this pull request Jul 27, 2024
@blue42u blue42u marked this pull request as ready for review July 27, 2024 07:21
@jpakkane
Copy link
Member

jpakkane commented Jul 27, 2024

Can you post a different example real world project that would need this or is libfpm the only one?

@blue42u
Copy link
Contributor Author

blue42u commented Jul 29, 2024

There are definitely other libraries with architecture requirements, e.g. libunwind or the syscalls Rust crate. Basically any library that uses straight assembly is going to have some restriction here.

That said, of the ones I have interest in developing a wrap for, libpfm is the only one that would fail WrapDB CI without this patch AFAICT. That isn't a very strong argument for this specific feature, I'm open to advice/alternative solutions.

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.

2 participants