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

fix(aws-lc-sys): add links attribute to Cargo.toml #277

Merged
merged 3 commits into from
Nov 16, 2023

Conversation

camshaft
Copy link
Collaborator

Description of changes:

The aws-lc-sys crate does not currently set the links attribute in the Cargo.toml. This prevents other crates from reading the include path and using it in other C libraries.

This change adds the links attribute and adds an integration test to ensure this functionality is preserved.

Call-outs:

I did not refactor the aws-lc-fips-sys crate. There's quite a bit of copy/paste between the build scripts and could probably use a refactor.

Testing:

I've added an integration test crate (aws-lc-sys-testing) showing that the change is now working and will be preserved in the future.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.

@camshaft camshaft requested a review from a team as a code owner November 15, 2023 17:18
@codecov-commenter
Copy link

codecov-commenter commented Nov 15, 2023

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (535eaec) 95.46% compared to head (e9c305b) 95.42%.
Report is 1 commits behind head on main.

Files Patch % Lines
aws-lc-sys-testing/src/main.rs 50.00% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #277      +/-   ##
==========================================
- Coverage   95.46%   95.42%   -0.04%     
==========================================
  Files          50       51       +1     
  Lines        6701     6733      +32     
==========================================
+ Hits         6397     6425      +28     
- Misses        304      308       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@skmcgrail
Copy link
Member

skmcgrail commented Nov 15, 2023

I did not refactor the aws-lc-fips-sys crate. There's quite a bit of copy/paste between the build scripts and could probably use a refactor.

Not incorrect, but the solution would require us to at least publish one additional crate (build) dependency which I think we were trying to avoid until we have better automation in place for the crate publishing process.

@camshaft
Copy link
Collaborator Author

camshaft commented Nov 15, 2023

but the solution would require us to at least publish one additional crate (build) dependency

I don't think that's the only solution. It could be solved with symlinks, path attribute or include!. All of those could be used to pull the aws-lc-sys code in to the fips crate. But, yes, you would need some automation in place to ensure that source is copied before publishing.

@skmcgrail
Copy link
Member

skmcgrail commented Nov 15, 2023

but the solution would require us to at least publish one additional crate (build) dependency

I don't think that's the only solution. It could be solved with symlinks, path attribute or include!. All of those could be used to pull the aws-lc-sys code in to the fips crate. But, yes, you would need some automation in place to ensure that source is copied before publishing.

Can path-attributes reference files outside the crate root, same question for include!? I think a file system symlink would be a non-starter. One primary concern is requiring some build process to even make the sys crates use-able. When they were located in aws-lc we had the complexity of having template files and having to generate the crate each time to make it usable. The sys crates were ephemeral and we didn't have the ability to track changes to them. The benefit we have today is that you only need to initialize the repository git submodules, and then the sys crates are use-able as-is. I think you could still have such a world where you commit the generated solution to the repository, but I think it makes developing changes to the build scripts painful (in my opinion at least).

Anyways we don't need to solve that here, I can make a corresponding PR for the aws-lc-fips-sys crate to go along with this.

@justsmth justsmth merged commit 27d447f into aws:main Nov 16, 2023
@camshaft camshaft deleted the sys-links branch November 16, 2023 20:08
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.

4 participants