saltstack / salt-bootstrap

Generic Salt Bootstrap Script
Other
928 stars 549 forks source link

OpenBSD git installation fails to compile pyzmq #1802

Closed delucks closed 3 months ago

delucks commented 2 years ago

Description of Issue/Question

When bootstrapping a git-based installation on OpenBSD, the wheels for each of salt's dependencies are built by pip. Building the pyzmq wheel does not succeed due to a missing header.

Setup

Steps to Reproduce Issue

Run sh bootstrap-salt.sh -D -r -P git v3001.8 to install Salt using pip from git tag 3001.8 with the environment set up as above. Any git tag reproduces this issue, including the latest release of Salt.

  Building wheel for pyzmq (PEP 517): started
  Building wheel for pyzmq (PEP 517): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: /usr/local/bin/python3.8 /usr/local/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmpwx0atuqg
       cwd: /tmp/pip-req-build-tiw0kpcj
  Complete output (26 lines):
  running bdist_wheel
  running build
  running build_py
  running build_ext
  running configure
  /tmp/pip-build-env-su4bxijf/overlay/lib/python3.8/site-packages/setuptools/_distutils/dist.py:275: UserWarning: Unknown distribution option: 'cffi_modules'
    warnings.warn(msg)
  Using bundled libzmq
  already have bundled/zeromq
  already have platform.hpp
  checking for timer_create
  /tmp/timer_createh9t89zhi.c:2:5: warning: implicit declaration of function 'timer_create' is invalid in C99 [-Wimplicit-function-declaration]
      timer_create();
      ^
  1 warning generated.
  ok
  ************************************************
  ************************************************
  ************************************************
  building 'zmq.libzmq' extension
  In file included from bundled/zeromq/src/address.cpp:38:
  bundled/zeromq/src/tipc_address.hpp:43:10: fatal error: 'linux/tipc.h' file not found
  #include <linux/tipc.h>
           ^~~~~~~~~~~~~~
  1 error generated.
  error: command '/usr/bin/c++' failed with exit code 1
  ----------------------------------------
  ERROR: Failed building wheel for pyzmq
Successfully built PyYAML
Failed to build pyzmq
ERROR: Could not build wheels for pyzmq which use PEP 517 and cannot be installed directly
 * ERROR: Failed to run install_openbsd_git()!!!

The important line here is bundled/zeromq/src/tipc_address.hpp:43:10: fatal error: 'linux/tipc.h' file not found. This indicates that a Linux-specific header isn't found; from my research, this is a build-time dependency for pyzmq that isn't available to install on OpenBSD.

Thankfully, OpenBSD distributes this library in the package manager (and the stable version of salt already depends on it). Installing the py3-zmq package skips the build step for this wheel and allows the installation to continue successfully. This issue can be resolved by installing this package when performing a post-Neon git based installation on OpenBSD.

Versions and Systems

Note that this version of bootstrap-salt.sh has the one-line change from #1801 applied.

test# sh bootstrap-salt.sh -v                                                                    
bootstrap-salt.sh -- Version 2021.09.17
test# sysctl hw | grep -e machine -e model -e product -e physmem -e ncpu
hw.machine=amd64
hw.model=AMD Ryzen 7 5800X 8-Core Processor
hw.ncpu=1
hw.product=VirtualBox
hw.physmem=4278124544
dmurphy18 commented 3 months ago

@delucks Closing this since BSD operating systems are no longer officially supported by Salt. With the reduced team and Krion leaving, no one to work on it.