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

chore(bindings): release #4388

Merged
merged 4 commits into from
Feb 1, 2024
Merged

chore(bindings): release #4388

merged 4 commits into from
Feb 1, 2024

Conversation

toidiu
Copy link
Contributor

@toidiu toidiu commented Jan 30, 2024

Please DONT merge until #4393 has been merged

Description of changes:

The diff going out as part of the release: v1.4.2...v1.4.3

Testing:

I ran cargo publish --dry-run --allow-dirty and caught a bunch of build-dependency issues. More on there in the comments: #4388 (comment)

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

@github-actions github-actions bot added the s2n-core team label Jan 30, 2024
tokio = { version = "1", features = ["net", "time"] }

[build-dependencies]
home = "=0.5.5" # a transitive dependency of aws-lc-sys. newer versions require rust 1.70
regex = "=1.9.6" # a transitive dependency of aws-lc-sys. newer versions require rust 1.65, see https://github.com/aws/s2n-tls/issues/4242
Copy link
Contributor

Choose a reason for hiding this comment

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

This doesn't feel like the right approach to me. Pinning transitive(!) dependencies like this is forcing the costs of lower MSRV on all downstream consumers, rather than letting them deal with it as they see fit (e.g., patching these crates to a lower version, keeping an older crates.io index as-of that version, etc.) -- and for consumers that are happy to use latest Rust, this forces them to use stale or many versions of your dependencies.

Copy link
Contributor

Choose a reason for hiding this comment

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

(It obviously doesn't need to block this PR, since it seems like a pre-existing decision, just wanted to leave a comment)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I started investigating this on other platforms and I dont see an issue when building this on linux. Converting this to draft while I finish investigating

Copy link
Contributor Author

Choose a reason for hiding this comment

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

aws-lc-rs was behaving differently on Mac vs Linux because of bindgen build logic on those platforms. aws-lc has a PR to to pin bindgen deps and test it in CI.


The behavior I was seeing:
Mac:

  • new git clone: fails ‘cargo build’
  • new git clone: fails ‘cargo publish --dry-run’

Linux:

  • new git clone: success ‘cargo build’
  • new git clone: success ‘cargo publish --dry-run’

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This doesn't feel like the right approach to me. Pinning transitive(!) dependencies like this is forcing the costs of lower MSRV on all downstream consumers

Its not ideal but in order to guarantee that the project can be built and run with the MSRV we advertise, we need to restrict these. I think that the pain we live with until we can update to a higher MSRV. Hopefully that day is not too far in the future.

Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't the right approach. It needs to be done in dev-dependencies. Applications will, unfortunately, need to do the same if they want to build on older rustc versions.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Spoke offline, seems that even though build-deps is what these dependencies are being used for, we want to pin them at the dev-deps since those dont get passed onto the application.

Copy link
Contributor Author

@toidiu toidiu Jan 31, 2024

Choose a reason for hiding this comment

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

updated in c01822e

Copy link
Contributor

Choose a reason for hiding this comment

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

This isn't the right approach. It needs to be done in dev-dependencies. Applications will, unfortunately, need to do the same if they want to build on older rustc versions.

I see, so the goal of this is purely for your own CI to check that you're still satisfying msrv? I think typically folks do that by checking in a minimum version compatible lockfile rather than needing to manually do things like this.

Copy link
Contributor Author

@toidiu toidiu Feb 1, 2024

Choose a reason for hiding this comment

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

checking in a minimum version compatible lockfile

What is this method? Do you have a link to a sample proj or link to a tool?

@toidiu toidiu marked this pull request as draft January 30, 2024 23:22
@toidiu toidiu marked this pull request as ready for review January 31, 2024 18:50
@toidiu toidiu force-pushed the ak-bindings-release branch from 1e14a14 to c01822e Compare January 31, 2024 20:35
Comment on lines 45 to +47
jobserver = "=0.1.26" # newer versions require rust 1.66, see https://github.com/aws/s2n-tls/issues/4241
home = "=0.5.5" # newer versions require rust 1.70, see https://github.com/aws/s2n-tls/issues/4395
regex = "=1.9.6" # newer versions require rust 1.65, see https://github.com/aws/s2n-tls/issues/4242
Copy link
Contributor

Choose a reason for hiding this comment

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

You should only need to do this once for the whole workspace. I would just do it in the generate crate.

Copy link
Contributor Author

@toidiu toidiu Jan 31, 2024

Choose a reason for hiding this comment

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

Let me test and verify.

generate already has those restrictions and it still fails https://github.com/aws/s2n-tls/blob/main/bindings/rust/generate/Cargo.toml#L13

At the minimum I need the pinning in s2n-tls-sys. I am testing by pulling down a fresh copy of s2n-tls and running the ./generate.sh script on my Mac.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tested with a fresh clone of s2n-tls and leaned up in: ffb7edb

@toidiu toidiu merged commit 7dd88f3 into aws:main Feb 1, 2024
31 checks passed
@toidiu toidiu deleted the ak-bindings-release branch February 1, 2024 23:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants