Skip to content

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
@cpu cpu force-pushed the cpu-pkg-config-ci-cov branch from 56f432e to 8736fcd Compare April 4, 2024 01:06
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!

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 force-pushed the cpu-pkg-config-ci-cov branch from 8736fcd to 56b8d5d Compare April 19, 2024 13:39
@cpu cpu merged commit 437e305 into rustls:main Apr 19, 2024
@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

2 participants