Skip to content

Fix macOS compatibility for build.sh and tox environments - #95

Open
rebtoor wants to merge 1 commit into
openstack-k8s-operators:mainfrom
rebtoor:fix/macos-compat
Open

Fix macOS compatibility for build.sh and tox environments#95
rebtoor wants to merge 1 commit into
openstack-k8s-operators:mainfrom
rebtoor:fix/macos-compat

Conversation

@rebtoor

@rebtoor rebtoor commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Replace Linux-only nproc with OS-aware detection (sysctl -n hw.logicalcpu on Darwin, nproc on Linux)
  • Fix pybuild-deps cache directory creation for tox -e update-sources and tox -e update-lockfiles by using a persistent {toxworkdir}/cache path and pre-creating the directory tree
  • Skip tox -e build on non-Linux platforms (requires buildah)

macOS tox compatibility after this change

tox env macOS Linux
linters works works
update-sources works works
update-lockfiles works works
test works works
build skipped (requires buildah) works

Test plan

  • tox -e linters passes on macOS
  • tox -e test passes on macOS (44/44 tests)
  • tox -e update-lockfiles completes on macOS
  • tox -e build cleanly skips on macOS with platform darwin does not match linux

Made with Cursor

Replace the Linux-only nproc call with OS-aware detection using
sysctl on Darwin and nproc on Linux.

Ensure the pybuild-deps cache directory is created before lockfile
generation by using a persistent toxworkdir-based cache path and
pre-creating the directory tree in commands_pre.

Skip the build tox environment on non-Linux platforms since it
requires buildah.

Assisted-By: Claude (Anthropic)
Co-authored-by: Cursor <cursoragent@cursor.com>
@openshift-ci

openshift-ci Bot commented Aug 18, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign dprince for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

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