Skip to content

Conversation

@bmwiedemann
Copy link
Member

To allow for custom build tweaks such as -j1 and
--vm-custom-opt=-cpu qemu64 written as separate lines in the _buildparams file.

This includes regexp whitelist validation to minimize risk to OBS operations.

The pattern for jobs deliberately does not have a * or + to not allow DoS or integer overflows.

The pattern for CPU allows to enable or disable individual CPUID flags. IMHO this should be safe.

To allow for custom build tweaks such as `-j1` and
`--vm-custom-opt=-cpu qemu64` written as separate lines in `_buildparams`
to minimize risk to OBS operations.

The pattern for jobs deliberately does not have a * or +
to not allow DoS or integer overflows.
PBuild runs build without chdir into the source-dir
@adrianschroeter
Copy link
Member

After some discussion, a possible way to implement this could be via buildflags. eg.

#!BuildFlags: cputype:$KNOWN_GOOD_CPU_TYPE

the known good cpu type may cause issues when eg. an AMD cpu gets enforced on a Intel hardware? But at least cpu types like "qemu64" on x86_64 could be supported here.

Alternative/Additionally we may support

#!BuildFlags: cpuflag:$FLAG

FLAG can be for example "-avx" to disable avx support.

This way we can have architecture specific definitions, because these can be sourounded via %ifarch statements.

@mlschroe
Copy link
Member

To be honest, I don't like this at all. Which packages would need this at all? If this is a very small list, can't that be fixed in the packages in a different and more sane way?

@bmwiedemann
Copy link
Member Author

bmwiedemann commented Jul 11, 2025

There is a small list:

  • colord (AVX2)
  • calibre (SSE-4.1)
  • emacs (very sensitive to CPU changes)
  • (not counting the dozen packages that used -march=native that we already patched)

These are still left after quite some time.

I agree that this patch is somewhat dirty and we probably need something nicer - that is why I had opened https://jira.suse.com/browse/OBS-362

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.

3 participants