-
Notifications
You must be signed in to change notification settings - Fork 244
Add a 32-bit autotools CI job #489
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,16 +6,28 @@ on: | |
| - cron: '3 20 * * SUN' | ||
| permissions: {} | ||
| jobs: | ||
| # The -m32 variants build and test as 32-bit. ssize_t and long are 32 bits | ||
| # wide on i686, which exposes signedness and range problems that the 64-bit | ||
| # builds cannot see. The flag goes in CC rather than CFLAGS so that the | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Minor, but the comment undersells the strongest argument for this choice. It frames Also worth citing the concrete motivation, which 🤖 Comment by Claude (Claude Code) on behalf of Will. |
||
| # libtap build, which has its own Makefile, and the test scripts that | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "the test scripts that compile code themselves pick it up too" is only true for The plural sends a reader looking for a mechanism that doesn't exist, and hides the one that does. 🤖 Comment by Claude (Claude Code) on behalf of Will. |
||
| # compile code themselves pick it up too. CFLAGS must stay out of the job | ||
| # environment: when it is set, even empty, make exports the configured | ||
| # CFLAGS to libtap, and libtap does not build on macOS with _POSIX_C_SOURCE. | ||
| test-autoconf: | ||
| strategy: | ||
| matrix: | ||
| os: [ubuntu-latest, macos-latest] | ||
| cc: [gcc, clang] | ||
| posix: ['', -D_POSIX_C_SOURCE=200112L] | ||
| name: Autotools build on ${{matrix.os}} using ${{matrix.cc}} ${{matrix.posix}} | ||
| arch: ['', -m32] | ||
| exclude: | ||
| - os: macos-latest | ||
| arch: -m32 | ||
| name: Autotools build on ${{matrix.os}} using ${{matrix.cc}} ${{matrix.posix}} ${{matrix.arch}} | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Two small things from appending The rendered names get a double space when More worth checking: all 8 pre-existing job names changed as a result. If any are configured as required status checks under branch protection, they'll need updating or merges will block on names that no longer exist. 🤖 Comment by Claude (Claude Code) on behalf of Will. |
||
| runs-on: ${{ matrix.os }} | ||
| env: | ||
| CC: ${{ matrix.cc }} | ||
| CC: ${{ matrix.cc }} ${{ matrix.arch }} | ||
| CXXFLAGS: ${{ matrix.arch }} | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This entry deserves a sentence in the comment above. It exists solely for Without it, a reader applying the stated For what it's worth, the 🤖 Comment by Claude (Claude Code) on behalf of Will. |
||
| VERBOSE: 1 | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
|
|
@@ -24,6 +36,8 @@ jobs: | |
| persist-credentials: false | ||
| - run: sudo apt install libipc-run3-perl | ||
| if: ${{ matrix.os == 'ubuntu-latest' }} | ||
| - run: sudo apt-get update && sudo apt-get install -y gcc-multilib g++-multilib | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Consider asserting that the artifacts really are 32-bit, near these steps: - run: file src/.libs/libmaxminddb.so | grep -q 'ELF 32-bit'
if: ${{ matrix.arch == '-m32' }}I checked every current way The risk is later drift: if someone edits the (The natural spot is after 🤖 Comment by Claude (Claude Code) on behalf of Will. |
||
| if: ${{ matrix.os == 'ubuntu-latest' && matrix.arch == '-m32' }} | ||
| - run: brew install autoconf automake libtool | ||
| if: ${{ matrix.os == 'macos-latest' }} | ||
| - run: ./bootstrap | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -21,14 +21,16 @@ | |
| my $root = abs_path("$Bin/.."); | ||
| my $include_dir = "$root/include"; | ||
| my $src_dir = "$root/src"; | ||
| my $cc = $ENV{CC} || 'cc'; | ||
|
|
||
| # CC may carry flags, such as CC="gcc -m32". | ||
| my @cc = split ' ', $ENV{CC} || 'cc'; | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
my $cxx = $ENV{CXX} || 'c++';No Worth applying the same (The real target is 🤖 Comment by Claude (Claude Code) on behalf of Will. |
||
|
|
||
| # The checks below rebuild the library with -Werror. Only gcc and clang are | ||
| # known to compile it cleanly with the flags used here, so skip elsewhere | ||
| # instead of failing on a missing compiler or an unrelated warning. | ||
| my ( $cc_version, $cc_stderr ) = ( q{}, q{} ); | ||
| my $cc_status = eval { | ||
| run3( [ $cc, '--version' ], \undef, \$cc_version, \$cc_stderr ); | ||
| run3( [ @cc, '--version' ], \undef, \$cc_version, \$cc_stderr ); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that This is worth fixing because it's the failure mode this PR just fixed: I confirmed that on Suggest skipping only on the condition the message actually describes, and dying otherwise: die "CC is set but contains no command\n" unless @cc;
die "could not run '@cc --version': $@" if !defined $cc_status;🤖 Comment by Claude (Claude Code) on behalf of Will. |
||
| $?; | ||
| }; | ||
| $cc_version .= $cc_stderr; | ||
|
|
@@ -44,7 +46,7 @@ | |
| map { split ' ' } grep { defined } @ENV{ 'CFLAGS', 'LDFLAGS' }; | ||
|
|
||
| my @base = ( | ||
| $cc, | ||
| @cc, | ||
| @instrumentation, | ||
| '-std=c99', | ||
| '-Wall', | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR description still describes the approach that
665789dreplaced. It says the decoder limits test "now keeps-mflags as well" and that "The flags are set for the whole job", but the final diff does neither: the filter att/decoder_limits_t.pl:45is still/^-f/,-m32arrives throughCC, and keepingCFLAGSout of the job env is the whole point of the current design. The verification table also describes runs of the old approach.The commit message on
665789dis accurate — worth copying over the PR body before merge, since that text is what ends up in the merge record.(Commenting here because the PR body has no line to anchor to.)
🤖 Comment by Claude (Claude Code) on behalf of Will.