diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 878d2c3dc..6b7de1565 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,7 +7,7 @@ on: - 'docs' env: - BUILDER_VERSION: v0.9.44 + BUILDER_VERSION: v0.9.45 BUILDER_SOURCE: releases BUILDER_HOST: https://d19elf31gohf1l.cloudfront.net PACKAGE_NAME: aws-crt-python @@ -186,6 +186,29 @@ jobs: chmod a+x builder ./builder build -p ${{ env.PACKAGE_NAME }} + + freebsd: + runs-on: macos-12 + steps: + # Cannot use builder to checkout as OpenBSD doesn't ship git in the base install + - uses: actions/checkout@v3 + with: + submodules: true + - name: Build ${{ env.PACKAGE_NAME }} + consumers + uses: vmactions/freebsd-vm@v0 + with: + envs: 'AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_DEFAULT_REGION AWS_REGION' + usesh: true + sync: rsync + copyback: false + prepare: | + pkg install -y python3 py39-urllib3 py39-pip cmake + python3 -m pip install awscli + run: | + python3 -c "from urllib.request import urlretrieve; urlretrieve('${{ env.BUILDER_HOST }}/${{ env.BUILDER_SOURCE }}/${{ env.BUILDER_VERSION }}/builder.pyz', 'builder')" + chmod a+x builder + ./builder build -p ${{ env.PACKAGE_NAME }} + # check that tests requiring custom env-vars or AWS credentials are simply skipped tests-ok-without-env-vars: runs-on: ubuntu-20.04 # latest diff --git a/setup.py b/setup.py index 0d91ed34b..36a8cdc44 100644 --- a/setup.py +++ b/setup.py @@ -323,6 +323,11 @@ def awscrt_ext(): if using_system_libcrypto(): libraries += ['crypto'] + # FreeBSD doesn't have execinfo as a part of libc like other Unix variant. + # Passing linker flag to link execinfo properly + if sys.platform.startswith('freebsd'): + extra_link_args += ['-lexecinfo'] + # hide the symbols from libcrypto.a # this prevents weird crashes if an application also ends up using # libcrypto.so from the system's OpenSSL installation. diff --git a/test/test_checksums.py b/test/test_checksums.py index dd9d02865..0f4e982d7 100644 --- a/test/test_checksums.py +++ b/test/test_checksums.py @@ -5,6 +5,7 @@ from test import NativeResourceTest from awscrt import checksums import unittest +import sys class TestChecksums(NativeResourceTest): @@ -41,6 +42,9 @@ def test_crc32_large_buffer(self): def test_crc32_huge_buffer(self): # stress the internal logic that handles buffers larger than C's INT_MAX + if sys.platform.startswith('freebsd'): + # Skip this test for freebsd, as it simply crashes instead of raising exception in this case + raise unittest.SkipTest('Skip this test for freebsd') try: INT_MAX = 2**32 - 1 huge_buffer = bytes(INT_MAX + 5) @@ -80,11 +84,13 @@ def test_crc32c_large_buffer(self): self.assertEqual(0xfb5b991d, val) def test_crc32c_huge_buffer(self): - # stress the internal logic that handles buffers larger than C's INT_MAX + if sys.platform.startswith('freebsd'): + # Skip this test for freebsd, as it simply crashes instead of raising exception in this case + raise unittest.SkipTest('Skip this test for freebsd') try: INT_MAX = 2**32 - 1 huge_buffer = bytes(INT_MAX + 5) - except (MemoryError, OverflowError): + except BaseException: raise unittest.SkipTest('Machine cant allocate giant buffer for giant buffer test') val = checksums.crc32c(huge_buffer) self.assertEqual(0x572a7c8a, val)