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

ci: add Linux pkg-config/.so test coverage #412

Merged
merged 1 commit into from Apr 19, 2024

Conversation

cpu
Copy link
Member

@cpu cpu commented Apr 4, 2024

This is follow-up to #274 that adds test coverage for using rustls with pkg-config and dynamic linking. A new Makefile.pkg-config is added that can be used on UNIX machines with pkg-config. It is a slimmed down copy of Makefile that:

  • Removes the development targets (format, etc).
  • Removes details specific to static linking.
  • Uses cargo cinstall for the install target.
  • Adds the correct CFLAGS/LDFLAGS that pkg-config tells us are necessary based on the .pc file that cargo-c writes.
  • Runs the integration tests with the dynamically linked client/server examples.

A new CI workflow (pkg-config.yaml) is added that only runs on ubuntu-latest (with both clang and gcc) that:

  • Installs stable rust.
  • Installs cargo-c.
  • Installs the lib to a tmp dir using cargo-c.
  • Builds the client/server examples using pkg-config to dynamically link rustls.
  • Verify the binaries aren't statically linking rustls.
  • Run the client/server integration tests.

The existing cargo-c coverage is removed from the test.yaml workflow since it's now duplicative with this new workflow.

@cpu cpu self-assigned this Apr 4, 2024
Copy link
Collaborator

@jsha jsha left a comment

Choose a reason for hiding this comment

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

Very nice!

Makefile.pkg-config Show resolved Hide resolved
Makefile.pkg-config Show resolved Hide resolved
A new `Makefile.pkg-config` is added that can be used on UNIX machines
with `pkg-config`. It is a slimmed down copy of `Makefile` that:

* Removes the development targets (`format`, etc).
* Removes details specific to static linking.
* Uses `cargo cinstall` for the install target.
* Adds the correct `CFLAGS`/`LDFLAGS` that `pkg-config` tells us are
  necessary based on the `.pc` file that `cargo-c` writes.
* Runs the integration tests with the dynamically linked client/server
  examples.

A new CI workflow (`pkg-config.yaml`) is added that only runs on
ubuntu-latest (with both `clang` and `gcc`) that:

* Installs stable rust.
* Installs `cargo-c`.
* Installs the lib to a tmp dir using `cargo-c`.
* Builds the client/server examples using `pkg-config` to dynamically
  link `rustls`.
* Verify the binaries aren't statically linking `rustls`.
* Run the client/server integration tests.

The existing `cargo-c` coverage is removed from the `test.yaml` workflow
since it's now duplicative with this new workflow.
@cpu cpu merged commit 437e305 into rustls:main Apr 19, 2024
23 checks passed
@cpu cpu deleted the cpu-pkg-config-ci-cov branch April 19, 2024 13:47
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.

None yet

2 participants