-
Notifications
You must be signed in to change notification settings - Fork 2
github CI workflow for module on linux #4
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
2cc1b9b
0d5f482
510731b
0c51d4b
76926a1
251e07a
77d1f4d
02168dd
042971b
b74c115
9203e82
b8b529c
fb55259
6d97fb2
0326cef
ceb4519
6bbdf8c
e25ae4d
c581b47
39aca9b
9d764d6
b0e0267
501489f
7515ab3
da8ce6c
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 |
---|---|---|
@@ -0,0 +1,129 @@ | ||
# Copyright 2025 Stefan Eissing (https://dev-icing.de) | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
|
||
name: Linux | ||
|
||
'on': | ||
push: | ||
branches: | ||
- master | ||
- '*/ci' | ||
paths-ignore: | ||
- '**/*.md' | ||
pull_request: | ||
branches: | ||
- master | ||
paths-ignore: | ||
- '**/*.md' | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
cancel-in-progress: true | ||
|
||
permissions: {} | ||
|
||
env: | ||
MARGS: "-j5" | ||
CFLAGS: "-g" | ||
|
||
jobs: | ||
linux: | ||
name: ${{ matrix.build.name }} (rustls-ffi ${{matrix.rustls-version}} ${{ matrix.crypto }} ${{matrix.rust}}) | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 30 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
rust: | ||
- stable | ||
- nightly | ||
crypto: | ||
- ring | ||
# aws-lc-sys v0.21.1 is not building due to compiler warnings | ||
# - aws-lc-rs | ||
rustls-version: | ||
- v0.14.1 | ||
- main | ||
build: | ||
- name: mod_tls | ||
install_packages: | ||
|
||
steps: | ||
- name: 'install prereqs' | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y --no-install-suggests --no-install-recommends \ | ||
libtool autoconf automake pkgconf cmake apache2 apache2-dev openssl \ | ||
curl nghttp2-client libssl-dev \ | ||
${{ matrix.build.install_packages }} | ||
python3 -m venv $HOME/venv | ||
|
||
- uses: actions/checkout@v4 | ||
|
||
- name: Install ${{ matrix.rust }} toolchain | ||
uses: dtolnay/rust-toolchain@master | ||
with: | ||
toolchain: ${{ matrix.rust }} | ||
|
||
- name: 'checkout rustls-ffi' | ||
run: | | ||
cd $HOME/ | ||
git clone --quiet --depth=1 -b ${{ matrix.rustls-version }} --recursive https://github.com/rustls/rustls-ffi.git | ||
|
||
- name: 'build rustls-ffi (Makefile)' | ||
if: matrix.rustls-version != 'main' | ||
run: | | ||
cd $HOME/rustls-ffi | ||
make DESTDIR=$HOME/rustls-ffi/build/rust CRYPTO_PROVIDER=${{ matrix.crypto }} install | ||
|
||
- name: Install cargo-c | ||
if: matrix.rustls-version == 'main' | ||
env: | ||
# Version picked for MSRV compat. | ||
LINK: https://github.com/lu-zero/cargo-c/releases/latest/download/ | ||
CARGO_C_FILE: cargo-c-x86_64-unknown-linux-musl.tar.gz | ||
run: | | ||
curl -L $LINK/$CARGO_C_FILE | tar xz -C ~/.cargo/bin | ||
|
||
- name: 'build rustls-ffi (cmake)' | ||
if: matrix.rustls-version == 'main' | ||
run: | | ||
cd $HOME/rustls-ffi | ||
cmake \ | ||
-DCRYPTO_PROVIDER=${{matrix.crypto}} \ | ||
-DDYN_LINK=on \ | ||
-DCMAKE_BUILD_TYPE=Release \ | ||
-S librustls -B build | ||
cmake --build build --config "Release" | ||
Comment on lines
+100
to
+109
Contributor
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. Using cmake here is making your life harder for no reason. It's for building the client.c and server.c examples and only coincidentally builds the library as a prereq. I would recommend using cargo-c directly like the README describes:
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. Well, how about a Makefile in rustls-ffi that does this and I do not have to worry about how to use cargo capi? Btw. it took me some time to find out that the generate cmake accepts a 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.
I mentioned in a DM, but we plan to publish binary artifacts for common platforms for the next release and that will remove the need for cargo c. You can download a tarball with the .so/.a/.pc all ready to go. We had a Makefile before but it:
Cargo-c fixes all of the above and it's being used by a number of similar Rust projects producing native libraries. To me it seems like the best solution short of cargo itself building in support for producing these types of build artifacts (which doesn't seem likely to happen anytime soon unfortunately).
Did you find the rustls-ffi README made it seem like this should work? I thought it was fairly clear about the role of 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.
Cannot say. Hacker as I am, I just expected a project with a cmake to support the standard features. I could have live with an error. Don't know enough about cmake (and prefer not to), to suggest how to address that. Nothing major. 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.
Thinking on this more it does seem reasonable to leave behind a My objections were about implementing the build/install logic in the Makefile itself and aren't relevant to using the Makefile as a compat shim for invoking cargo-c in a way more familiar to Makefile users. Thanks for the suggestion, I will handle this in rustls/rustls-ffi#525
Contributor
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.
😆 Tell me about it. I learned cmake recently just for rustls-ffi and it's a mess. I'll put some thought into how we can emit an error (or just support installing that way if it's not too tricky). (Edit: rustls/rustls-ffi#526) |
||
|
||
- name: 'install test prereqs' | ||
run: | | ||
[ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate | ||
python3 -m pip install -r test/requirements.txt | ||
|
||
- name: 'configure' | ||
run: | | ||
autoreconf -fi | ||
./configure --enable-werror --with-rustls=$HOME/rustls-ffi/build/rust | ||
|
||
- name: 'build' | ||
run: make V=1 | ||
|
||
- name: pytest | ||
env: | ||
PYTEST_ADDOPTS: "--color=yes" | ||
run: | | ||
[ -x "$HOME/venv/bin/activate" ] && source $HOME/venv/bin/activate | ||
pytest -v |
Uh oh!
There was an error while loading. Please reload this page.