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 GitHub workflows for extra coverage #1223

Merged
merged 2 commits into from
May 14, 2024
Merged

Add GitHub workflows for extra coverage #1223

merged 2 commits into from
May 14, 2024

Conversation

ac000
Copy link
Member

@ac000 ac000 commented Apr 19, 2024

This adds a workflow for building Unit under Fedora Rawhide and Alpine
Edge with both GCC and Clang.

These are the development branches from which releases are cut.

This usually consists of the latest versions of software and will
hopefully catch new compiler issues and API breakages in the various
languages we support.

With Alpine and Clang that also gives us musl libc + clang coverage.

On Alpine we don't build the wasm and wasm-wasi-component modules,
mainly as this would require messing around with all the rust stuff and
building wasmtime from source (as there's no musl libc based packages)
and the wasm module is pretty small, any new compiler issues would
hopefully show up in the rest.

We do build the wasm module with gcc and clang on Fedora. But not
wasm-wasi-component in the interests of time. Can be added at a later
date if deemed necessary.

We don't build the Perl language module on Fedora with clang due to the
Fedora (and probably Red Hat) Perl CFLAGS having incompatible with clang
flags.

We probably could work around it if we really wanted to, but not sure
it's worth it and on Red Hat/Fedora, GCC is the system compiler.

On Alpine we also don't build the nodejs and go language modules as
there's nothing that actually gets compiled there and the main reason
for building on Alpine is to get musl libc + clang coverage.

We're also not bothering with njs for now... can be revisited at a
later date.

Also no pytests, these should be well covered via other workflows for
example by running on latest Alpine releases.

@ac000 ac000 force-pushed the workflows branch 30 times, most recently from 31a94ff to 4b1838a Compare April 21, 2024 22:29
@ac000 ac000 changed the title Add GitHub workflows for extra coverage Add GitHub workflows for extra coverage and whitespace issues Apr 23, 2024
@ac000
Copy link
Member Author

ac000 commented Apr 23, 2024

These new checks finish in under half the time of the existing CI, so shouldn't have an adverse effect on the testing time...

@ac000
Copy link
Member Author

ac000 commented Apr 24, 2024

Added a Closes: tag...

1:  087c9b4a ! 1:  60a942be Add GitHub workflows for extra coverage
    @@ Commit message
         Also no pytests, these should be well covered via other workflows for
         example by running on latest Alpine releases.
     
    +    Closes: https://github.com/nginx/unit/issues/949
         Signed-off-by: Andrew Clayton <[email protected]>
     
      ## .github/workflows/ci-dev-distro-compiler.yaml (new) ##
2:  2651374f = 2:  759ddbfb Add a GitHub workflow to check for whitespace issues

@ac000
Copy link
Member Author

ac000 commented Apr 25, 2024

Update to wasmtime 20.0.0

$ git range-diff 759ddbfb...a0968a79
1:  60a942be ! 1:  035dd2cd Add GitHub workflows for extra coverage
    @@ .github/workflows/ci-dev-distro-compiler.yaml (new)
     +
     +      - name: Install wasmtime
     +        run: |
    -+          wget -O- https://github.com/bytecodealliance/wasmtime/releases/download/v19.0.2/wasmtime-v19.0.2-x86_64-linux-c-api.tar.xz | tar -xJf -
    ++          wget -O- https://github.com/bytecodealliance/wasmtime/releases/download/v20.0.0/wasmtime-v20.0.0-x86_64-linux-c-api.tar.xz | tar -xJf -
     +
     +      - name: configure unit-wasm
    -+        run: ./configure wasm --include-path=wasmtime-v19.0.2-x86_64-linux-c-api/include --lib-path=wasmtime-v19.0.2-x86_64-linux-c-api/lib --rpath
    ++        run: ./configure wasm --include-path=wasmtime-v20.0.0-x86_64-linux-c-api/include --lib-path=wasmtime-v20.0.0-x86_64-linux-c-api/lib --rpath
     +
     +      - name: make unit-wasm
     +        run: make wasm
2:  759ddbfb = 2:  a0968a79 Add a GitHub workflow to check for whitespace issues

@ac000
Copy link
Member Author

ac000 commented May 1, 2024

  • On Fedora don't install weak dependencies
  • Fix some indentation
$ git range-diff a0968a79...c318cf3e
1:  035dd2cd ! 1:  cca7ab09 Add GitHub workflows for extra coverage
    @@ .github/workflows/ci-dev-distro-compiler.yaml (new)
     +      - name: Install tools/deps
     +        run: |
     +          dnf -y update
    -+          dnf -y install which wget git gcc make pcre2-devel openssl-devel \
    ++          dnf -y install --setopt=install_weak_deps=False \
    ++              which wget git gcc make pcre2-devel openssl-devel \
     +              python-unversioned-command python3 python3-devel \
     +              php-devel php-embedded perl-devel perl-ExtUtils-Embed \
     +              ruby-devel java-devel nodejs-devel nodejs-npm golang
     +          if [ "${{ matrix.compiler }}" = "clang" ]; then
    -+            dnf -y install clang
    ++            dnf -y install --setopt=install_weak_deps=False clang
     +          fi
     +          npm install -g node-gyp
     +
    @@ .github/workflows/ci-dev-distro-compiler.yaml (new)
     +          if [ "${{ matrix.compiler }}" = "clang" ]; then
     +            ./configure --openssl --cc=clang
     +          else
    -+             ./configure --openssl
    ++            ./configure --openssl
     +          fi
     +
     +      - name: make unit
    @@ .github/workflows/ci-dev-distro-compiler.yaml (new)
     +          if [ "${{ matrix.compiler }}" = "clang" ]; then
     +            ./configure --openssl --cc=clang
     +          else
    -+             ./configure --openssl
    ++            ./configure --openssl
     +          fi
     +
     +      - name: make unit
2:  a0968a79 = 2:  c318cf3e Add a GitHub workflow to check for whitespace issues

@ac000 ac000 changed the title Add GitHub workflows for extra coverage and whitespace issues Add GitHub workflows for extra coverage May 2, 2024
@ac000
Copy link
Member Author

ac000 commented May 2, 2024

Split the white space check into its own PR.

@ac000
Copy link
Member Author

ac000 commented May 7, 2024

  • Remove Prerl/clang build fix. This is now merged via 5d1ce5c

  • Small clarification to the commit message

 git range-diff cca7ab09...fc0e24c1
1:  cca7ab09 ! 1:  fc0e24c1 Add GitHub workflows for extra coverage
    @@ Commit message
         Add GitHub workflows for extra coverage
     
         This adds a workflow for building Unit under Fedora Rawhide and Alpine
    -    Edge.
    +    Edge with both GCC and Clang.
     
         These are the development branches from which releases are cut.
     
    @@ .github/workflows/ci-dev-distro-compiler.yaml (new)
     +        run: ./configure perl
     +
     +      - name: make unit-perl
    -+        run: |
    -+          if [ "${{ matrix.compiler }}" = "clang" ]; then
    -+            make -j 4 perl EXTRA_CFLAGS=-Qunused-arguments
    -+          else
    -+            make -j 4 perl
    -+          fi
    ++        run: make -j 4 perl
     +
     +      - name: configure unit-ruby
     +        run: ./configure ruby

@ac000
Copy link
Member Author

ac000 commented May 7, 2024

Ok, this is now ready for merging.

To recap. This is building Unit under Fedora Rawhide and Alpine Edge with both GCC and Clang. This is mainly to get coverage with the latest toolchain developments but also for upcoming versions of the various language stuff.

This already found a build issue with the Perl language module and Clang.

So, last chance to speak up or forever hold yer whisht! ;)

@ac000 ac000 linked an issue May 14, 2024 that may be closed by this pull request
Copy link
Collaborator

@callahad callahad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

You can always see the original names/addresses used by passing
--no-mailmap to the various git commands.

See gitmailmap(5)

Reviewed-by: Ava Hahn <[email protected]>
Signed-off-by: Andrew Clayton <[email protected]>
@ac000
Copy link
Member Author

ac000 commented May 14, 2024

Rebased with master

$ git range-diff fc0e24c1...babb154a
 -:  -------- >  1:  237a26aa wasm-wc: Bump the rustls crate from 0.21.10 to 0.21.11
 -:  -------- >  2:  3fbca6ca Fix some trailing whitespace and long lines in the README
 -:  -------- >  3:  e5bc299d configuration: Constify numerous pointers
 -:  -------- >  4:  8f861cf4 Constify a bunch of static local variables
 -:  -------- >  5:  33c978cc php: Constify some local static variables
 -:  -------- >  6:  31cec908 configuration: Constify more pointers
 -:  -------- >  7:  b26c119f Tighten up some string arrays
 -:  -------- >  8:  db3cf3e4 tools: Add unitctl CLI
 -:  -------- >  9:  2c4502f8 tools: Add unitctl section to the README
 -:  -------- > 10:  ff2e0f42 Add a GitHub workflow to check for whitespace issues
 -:  -------- > 11:  5b01bd65 auto/wasm: No need to explicitly set -fno-strict-aliasing now
 -:  -------- > 12:  e2a09c77 Convert 0-sized arrays to true flexible array members
 -:  -------- > 13:  5d1ce5c4 auto, perl: Fix building the Perl language module with clang
 -:  -------- > 14:  6e8f7bbb tools/unitctl: Initial Docker Procedures
 -:  -------- > 15:  818d4ad7 tools/unitctl: API Plumbing for docker deployments
 -:  -------- > 16:  f6989dd6 tools/unitctl: Add Docker deployment functionality
 -:  -------- > 17:  1d237990 tools/unitctl: Add new functionality to README.md and fmt code
 -:  -------- > 18:  4e4d1dd2 tools/unitctl: temporarily ignore issues with autogenerated readme
 -:  -------- > 19:  e61d9e7a tools/unitctl: Readme fixes
 -:  -------- > 20:  787980db tools/unitctl: Improve quality of life on osx
 -:  -------- > 21:  cb03d31e tools/unitctl: Update host_path() to account for OSX special behaviour
 -:  -------- > 22:  6ad1fa34 tools/unitctl: clean up control socket impls
 -:  -------- > 23:  cc9eb8e7 tools/unitctl: enable passing IP addresses to the 'instances new' command
 -:  -------- > 24:  da43f443 java: Update third-party components
 -:  -------- > 25:  05a82294 http: Use consistent target in nxt_h1p_peer_header_send()
 -:  -------- > 26:  87077ec4 http: Ensure REQUEST_URI immutability
 -:  -------- > 27:  eed21785 tests: Change request_uri tests for changed behaviour
 -:  -------- > 28:  00009765 tests: REQUEST_URI variable test with rewrite
 -:  -------- > 29:  6d0880c9 Add unitctl build and release CI
 -:  -------- > 30:  149555db trigger unitctl CI on version tags of existing format
 -:  -------- > 31:  a98acded ci: Add unit testing to unitctl CI workflow
 1:  fc0e24c1 = 32:  babb154a Add GitHub workflows for extra coverage

This adds a workflow for building Unit under Fedora Rawhide and Alpine
Edge with both GCC and Clang.

These are the development branches from which releases are cut.

This usually consists of the latest versions of software and will
hopefully catch new compiler issues and API breakages in the various
languages we support.

With Alpine and Clang that also gives us musl libc + clang coverage.

On Alpine we don't build the wasm and wasm-wasi-component modules,
mainly as this would require messing around with all the rust stuff and
building wasmtime from source (as there's no musl libc based packages)
and the wasm module is pretty small, any new compiler issues would
hopefully show up in the rest.

We _do_ build the wasm module with gcc and clang on Fedora. But not
wasm-wasi-component in the interests of time. Can be added at a later
date if deemed necessary.

We don't build the Perl language module on Fedora with clang due to the
Fedora (and probably Red Hat) Perl CFLAGS having incompatible with clang
flags.

We probably could work around it if we really wanted to, but not sure
it's worth it and on Red Hat/Fedora, GCC _is_ the system compiler.

On Alpine we also don't build the nodejs and go language modules as
there's nothing that actually gets compiled there and the _main_ reason
for building on Alpine is to get musl libc + clang coverage.

We're also not bothering with njs for now... can be revisited at a
later date.

Also no pytests, these should be well covered via other workflows for
example by running on latest Alpine releases.

Closes: nginx#949
Signed-off-by: Andrew Clayton <[email protected]>
@ac000
Copy link
Member Author

ac000 commented May 14, 2024

Rebased with mailmap branch

$ git range-diff babb154a...30b39bd0
-:  -------- > 1:  44709bea .mailmap: Add an entry for Ava's GitHub address
1:  babb154a = 2:  30b39bd0 Add GitHub workflows for extra coverage

@ac000 ac000 merged commit 30b39bd into nginx:master May 14, 2024
23 checks passed
@ac000 ac000 deleted the workflows branch May 14, 2024 23:05
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.

Alpine Linux + Clang builder
4 participants