-
Notifications
You must be signed in to change notification settings - Fork 846
feat(lance-io): select TLS provider to keep aws-lc-rs out of non-AWS builds #8445
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
Open
valkum
wants to merge
2
commits into
lance-format:main
Choose a base branch
from
valkum:feat/lance-io-tls-provider
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,63 @@ | ||
| #!/bin/bash | ||
| # | ||
| # Lance promises that non-AWS cloud builds can be built without aws-lc-rs. | ||
| # Consumers building slim images for a single backend (e.g. GCS-only) rely on | ||
| # this: aws-lc-rs compiles C/assembly through its cmake build dependency, | ||
| # which bloats builds, complicates cross-compilation, and forces a second | ||
| # crypto provider on deployments that standardize on ring. This script | ||
| # enforces the promise by resolving each non-AWS backend under the | ||
| # provider-neutral TLS feature (tls-no-provider) and failing if aws-lc-rs or | ||
| # cmake appears. | ||
| # | ||
| # It checks the FUNCTIONAL configuration (backend + tls-no-provider), not the | ||
| # bare backend: opendal's HTTP transport is opt-in, so a bare backend has no | ||
| # TLS stack and would pass this check vacuously while failing at runtime. To | ||
| # guard against that, each combination must also still resolve a reqwest HTTP | ||
| # transport (opendal-http-transport-reqwest); a missing transport is an error. | ||
| # | ||
| # The usual way this regresses is a dependency bump changing a TLS default, | ||
| # not a local change: opendal's default reqwest transport pins aws-lc-rs, and | ||
| # its reqwest-rustls-* feature aliases re-enable it, so lance-io wires the | ||
| # granular http-transport-reqwest-rustls-no-provider feature instead. | ||
| # | ||
| # If this check fails, fix the feature wiring rather than exempting the crate. | ||
| # Feature combos that include the AWS SDK are not checked: it links aws-lc-rs | ||
| # itself via aws-smithy-http-client. | ||
|
|
||
| set -euo pipefail | ||
|
|
||
| cd "$(dirname "$0")/.." | ||
|
|
||
| FORBIDDEN=(aws-lc-rs aws-lc-sys aws-lc-fips-sys cmake) | ||
| REQUIRED=(opendal-http-transport-reqwest) | ||
|
|
||
| check() { | ||
| local desc="$1" | ||
| shift | ||
|
|
||
| local deps | ||
| deps=$(cargo tree --locked -e normal,build --prefix none --format '{p}' "$@" | awk '{print $1}' | sort -u) | ||
|
|
||
| local failed=0 | ||
| for crate in "${FORBIDDEN[@]}"; do | ||
| if grep -qx "$crate" <<<"$deps"; then | ||
| echo "error: forbidden dependency '$crate' found in $desc, pulled in via:" | ||
| cargo tree --locked -e normal,build "$@" -i "$crate" | ||
| failed=1 | ||
| fi | ||
| done | ||
| for crate in "${REQUIRED[@]}"; do | ||
| if ! grep -qx "$crate" <<<"$deps"; then | ||
| echo "error: $desc is missing HTTP transport '$crate'; the forbidden-dependency check would pass vacuously. Wire a provider-neutral TLS transport." | ||
| failed=1 | ||
| fi | ||
| done | ||
| if [[ $failed -ne 0 ]]; then | ||
| exit 1 | ||
| fi | ||
| echo "ok: $desc is free of {${FORBIDDEN[*]}} and has an HTTP transport" | ||
| } | ||
|
|
||
| check "lance-io (gcp, tls-no-provider)" --manifest-path rust/lance-io/Cargo.toml --no-default-features --features gcp,tls-no-provider | ||
| check "lance-io (azure, tls-no-provider)" --manifest-path rust/lance-io/Cargo.toml --no-default-features --features azure,tls-no-provider | ||
| check "lance-io (oss, tls-no-provider)" --manifest-path rust/lance-io/Cargo.toml --no-default-features --features oss,tls-no-provider | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The stated non-AWS invariant is still false for a supported backend. I ran
cargo tree --locked -p lance-io --no-default-features --features huggingface,tls-no-provider -e normal,build -i aws-lc-rs; it resolvesopendal-service-huggingface -> hf-xet -> xet-client/default -> reqwest/rustls -> aws-lc-rs, along withaws-lc-sysandcmake. Because this list omits Hugging Face, the guard reports success while that feature violates the compile-footprint contract. Either make the provider-neutral configuration work for Hugging Face too, or explicitly narrow and document the promise and make the checked set match it.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There currently is no way of making the
huggingfacefeatureaws-lc-rsfree. Users of thehuggingfacefeature are exempt from this addition untilopendal-service-huggingfaceallows setting something liketls-no-provider.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That upstream constraint is a reasonable reason to choose the exemption path rather than removing AWS-LC from Hugging Face now. The current PR still states that this script enforces the promise for “each non-AWS backend,” though, and neither the script nor feature documentation records this exception.
The finding therefore remains only as a contract mismatch: explicitly narrow the promise and document Hugging Face as exempt until the upstream service supports a provider-neutral transport, then make the checked backend set match that documented scope.