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

github CI workflow for module on linux #4

Closed
wants to merge 25 commits into from
Closed

github CI workflow for module on linux #4

wants to merge 25 commits into from

Conversation

icing
Copy link
Owner

@icing icing commented Jan 15, 2025

  • Adjust config and server commands as in mod_h2 and mod_md projects.
  • Add python install requirements.

icing added 3 commits January 15, 2025 12:09
Adjust config and server commands as in mod_h2 and mod_md projects.
Add python install requirements.
@icing
Copy link
Owner Author

icing commented Jan 15, 2025

@cpu trying to get a CI workflow going, but rustls-ffi wants aws-lc-sys v0.21.1 which cargo fails to compile due to several compiler warnings. Is that something you are familiar with and know how to fix?

@cpu
Copy link
Contributor

cpu commented Jan 15, 2025

trying to get a CI workflow going

Thank you! :-)

cargo fails to compile due to several compiler warnings. Is that something you are familiar with and know how to fix?

@icing Odd 🤔 I haven't seen that particular build failure before. I'm tied up today/tomorrow but if you leave this with me I'm happy to debug further.

To unblock this PR in the meantime you might have luck adding CRYPTO_PROVIDER=ring to the make DESTDIR=$HOME/rustls install alongside DESTDIR on L83 of linux.yaml.

Comment on lines +100 to +109
- 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"
Copy link
Contributor

@cpu cpu Jan 16, 2025

Choose a reason for hiding this comment

The 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:

cargo capi install --release --prefix <wherever> --features ${{matrix.features}}.

Copy link
Owner Author

Choose a reason for hiding this comment

The 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 -DCMAKE_INSTALL_PREFIX=path, performs a --install without complain, but does not install anything.

Copy link
Contributor

Choose a reason for hiding this comment

The 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?

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:

  • Was brittle and hard to maintain - especially for things like mutually exclusive features
  • Didn't produce a .pc file for pkg-config
  • Didn't produce a .so for dynamic linking
  • Didn't support Windows

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).

Btw. it took me some time to find out that the generate cmake accepts a -DCMAKE_INSTALL_PREFIX=path, performs a --install without complain, but does not install anything.

Did you find the rustls-ffi README made it seem like this should work? I thought it was fairly clear about the role of cmake but I'm open to suggestions to make it clearer!

Copy link
Owner Author

Choose a reason for hiding this comment

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

Did you find the rustls-ffi README made it seem like this should work? I thought it was fairly clear about the role of cmake but I'm open to suggestions to make it clearer!

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.

Copy link
Contributor

Choose a reason for hiding this comment

The 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?

Thinking on this more it does seem reasonable to leave behind a Makefile that does the right cargo-c invocations under the hood.

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

Copy link
Contributor

@cpu cpu Jan 16, 2025

Choose a reason for hiding this comment

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

Don't know enough about cmake (and prefer not to), to suggest how to address that.

😆 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)

@icing
Copy link
Owner Author

icing commented Jan 16, 2025

I commented out the aws-lc-rs crypto provider since I still get the same compile failures when cargo builds it than before. While it works on your github workflow. Very strange.

It would be nice to test with that crypto provider as well.

@icing
Copy link
Owner Author

icing commented Jan 16, 2025

I'll merge this PR into master, so when you feel like playing around with it, it will be easier to make a PR with any improvements you might want to add.

@cpu
Copy link
Contributor

cpu commented Jan 16, 2025

I'll merge this PR into master, so when you feel like playing around with it

Sounds great, thank you again 🙇 I promise to spend some time looking into the aws-lc-rs build issue very soon.

@icing
Copy link
Owner Author

icing commented Jan 16, 2025

Merged as 5f65a43

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.

2 participants