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

Add OpenBSD support #141

Merged
merged 5 commits into from
May 31, 2024
Merged

Conversation

postmodern
Copy link
Contributor

  • Add OpenBSD to the CI matrix.
  • Workaround OpenBSD's tar not supporting the -J option by using xzcat $file | tar xf - -C $dest.

@postmodern
Copy link
Contributor Author

I'm not sure pkg_add ruby%3.1 is the correct syntax. Only example I could find is this one: https://github.com/search?q=pkg_add+ruby%253.1&type=code

All other examples show pkg_add ruby-3.1.2, etc.

@postmodern
Copy link
Contributor Author

https://github.com/kolargol/openvpn/blob/58ff7985cbb4c75153650435393dc8886be07378/openvpn.yml#L14
Appears that pkg_add python%2.7 is pretty common, so it should work.

@flavorjones
Copy link
Owner

@postmodern Thank you for submitting this! I just kicked off CI.

@flavorjones
Copy link
Owner

flavorjones commented May 3, 2024

The macos failures are related to the macos-14 defaults that github started using, I'll fix those in a separate PR.

Edit: that PR is #142.

@flavorjones
Copy link
Owner

I've rebased onto origin/main to pick up #142 fixes.

@flavorjones
Copy link
Owner

Adding more packages and using gmake in a commit I just appended.

@flavorjones
Copy link
Owner

flavorjones commented May 3, 2024

Added a commit that I think will fix the cmake tests ... still failing on some pkg-config edge cases we need to look into.

Edit: removed that commit from the PR because it didn't work.

@flavorjones flavorjones force-pushed the openbsd-support branch 2 times, most recently from 8c2abef to 288062f Compare May 3, 2024 18:57
@flavorjones
Copy link
Owner

Really struggling here ... and the long feedback loops (because timeout tests are taking 2.5 minutes for each retry) are not making it easy. I'm going to try to reduce timeouts so that I can then have faster feedback loops to try to fix the remaining failing tests.

@flavorjones flavorjones force-pushed the openbsd-support branch 3 times, most recently from c7115b1 to ee0daea Compare May 3, 2024 19:21
@flavorjones
Copy link
Owner

@postmodern OK, I'm timing out on this for now.

Things going on in this PR in CI:

  • two failures related to pkg-config behavior (which might be actual failures since the OpenBSD pkg-config package is non-gnu?)
  • failures in the CMake suite related to finding the compilers (see also my comment at [cmake] Automatically add required cross-compilation variables #130 (comment))
  • the network timeouts are really bad for some tests -- on the order of 2.5 minutes for each of 3 retries -- and I'm not sure why. This is making solving the above problems harder for me. I tried setting kernel parameter net.inet.tcp.keepinittime but that didn't do anything. I'm starting to wonder if Ruby's OpenURI class support for timeouts doesn't work on OpenBSD.

@postmodern
Copy link
Contributor Author

Adding more packages and using gmake in a commit I just appended.

It might be a good idea to test against bsdmake, which is a bit more limited than GNU make.

failures in the CMake suite related to finding the compilers

Are we sure cc is even available by default? Maybe we need to pkg_add clang or pkg_add gcc?

the network timeouts are really bad for some tests -- on the order of 2.5 minutes for each of 3 retries -- and I'm not sure why.

I also get random 1 retrie(s) left for tar.gz (Failed to open TCP connection to localhost:36985 (Connection refused - connect(2) for "localhost" port 36985)) errors when running rake test locally on Fedora Linux.

@flavorjones
Copy link
Owner

flavorjones commented May 5, 2024

It might be a good idea to test against bsdmake

The issue I was addressing is that the libraries we're using as test subjects (e.g., libyaml) are not compatible with BSD's make, so we need to work around that.

Are we sure cc is even available by default

I chatted with Stan in #130 and I'm going to try to write a PR that uses RbConfig to determine the compilers, and this whole problem with the CMake detection may go away. I'll try to get to that this week.

I also get random 1 retrie(s) left for tar.gz ...

Yes, the test suite intentionally exercises the methods with simulated network failures. The problem is that on most platforms, the timeouts are fast and on openbsd for some reason they're very slow (2.5 minutes each x 3 retries).

flavorjones added a commit that referenced this pull request May 29, 2024
and use it for configuring CMake.

Related to #141 and #130.
flavorjones added a commit that referenced this pull request May 29, 2024
and use it for configuring CMake.

Related to #141 and #130.
flavorjones added a commit that referenced this pull request May 29, 2024
and use it for configuring CMake.

Related to #141 and #130.
@flavorjones
Copy link
Owner

I've rebased this branch onto the branch from #144 which I think will fix the CMake test failures.

postmodern and others added 4 commits May 30, 2024 10:14
* OpenBSD's `tar` does not support the `-J` flag, thus we must use
  `xzcat $file | tar xf - -C $dest` to first uncompress the `.tar.xz`
  file and pipe it into `tar` to then extract it.
also add more packages: cmake, git, pkgconf, gnupg
@flavorjones
Copy link
Owner

Rebased once more, should be easier to see failures now.

@flavorjones
Copy link
Owner

Added a commit: mkmf_config no longer relies on features that openBSD's pkg-config doesn't support.

openbsd's pkg-config doesn't support `--print-variables`, but we don't
need it since everybody's pkg-config seems to just return a blank
string if the variable doesn't exist.
@flavorjones flavorjones merged commit 5dd29f8 into flavorjones:main May 31, 2024
36 checks passed
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