Skip to content

Commit

Permalink
Add OpenBSD CI job
Browse files Browse the repository at this point in the history
  • Loading branch information
samsinsane committed Dec 7, 2024
1 parent 928397f commit 54fd3fc
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 7 deletions.
38 changes: 38 additions & 0 deletions .github/workflows/ci-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,44 @@ jobs:
with:
name: premake-freebsd-${{ matrix.platform }}
path: bin/${{ matrix.config }}/
openbsd:
runs-on: ubuntu-latest
strategy:
matrix:
config: [debug, release]
platform: [x64]
cc: [clang]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Start OpenBSD VM
uses: vmactions/openbsd-vm@v1
with:
usesh: true
sync: sshfs
prepare: |
pkg_add gmake
- name: Build
shell: openbsd {0}
run: |
cd $GITHUB_WORKSPACE
PLATFORM=${{ matrix.platform }} CONFIG=${{ matrix.config }} PREMAKE_OPTS="--cc=${{ matrix.cc }}" ./Bootstrap.sh
- name: Test
shell: openbsd {0}
run: |
cd $GITHUB_WORKSPACE
bin/${{ matrix.config }}/premake5 test --test-all
- name: Docs check
shell: openbsd {0}
run: |
cd $GITHUB_WORKSPACE
bin/${{ matrix.config }}/premake5 docs-check
- name: Upload Artifacts
if: matrix.config == 'release' && matrix.cc == 'clang'
uses: actions/upload-artifact@v4
with:
name: premake-openbsd-${{ matrix.platform }}
path: bin/${{ matrix.config }}/

# This job will be required for PRs to be merged.
# This should depend on (via needs) all jobs that need to be successful for the PR to be merged.
Expand Down
2 changes: 2 additions & 0 deletions contrib/curl/lib/config-linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,9 @@
#define HAVE_GETHOSTBYNAME 1

/* Define to 1 if you have the gethostbyname_r function. */
#if !defined(__OpenBSD__)
#define HAVE_GETHOSTBYNAME_R 1
#endif

/* gethostbyname_r() takes 3 args */
/* #undef HAVE_GETHOSTBYNAME_R_3 */
Expand Down
7 changes: 0 additions & 7 deletions src/host/os_getversion.c
Original file line number Diff line number Diff line change
Expand Up @@ -293,15 +293,8 @@ int getversion(struct OsVersionInfo* info)
return 0;
}

#if __GLIBC__
// When using glibc, info->description gets set to u.sysname,
// but it isn't passed out of this function, so we need to copy
// the string.
info->description = strdup(u.sysname);
info->isalloc = 1;
#else
info->description = u.sysname;
#endif

if ((ver = strtok(u.release, ".-")) != NULL)
{
Expand Down
11 changes: 11 additions & 0 deletions tests/base/test_os.lua
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,17 @@
test.istrue(os.findlib("user32"))
elseif os.istarget("haiku") then
test.istrue(os.findlib("root"))
elseif os.istarget("bsd") and os.getversion().description == "OpenBSD" then
-- OpenBSD doesn't have a 'libm.so' symlink like other systems,
-- it only has the versioned files, 'libm.so.X.Y' which will
-- change between versions of OpenBSD. os.findlib currently won't
-- find these versioned files without the version info.

-- libm should be '/usr/lib/libm.so.X.Y' find the exact filename
-- and use that.
local libms = os.matchfiles("/usr/lib/libm.so.*")
test.isfalse(0 == #libms)
test.istrue(os.findlib(path.getname(libms[1])))
else
test.istrue(os.findlib("m"))
end
Expand Down

0 comments on commit 54fd3fc

Please sign in to comment.