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
depends: Explicitly download and vendor Rust dependencies #3096
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
echo "{\"files\":{$( | ||
find . -type f | # Get list of file paths | ||
grep -v $1 | # Exclude Makefile hashes | ||
grep -v .stamp_ | # Exclude Makefile stamps | ||
sed 's|^./||' | # Remove leading ./ | ||
sort | # Sort (for uniformity) | ||
xargs $2 | # Get SHA256 hashes (assumes standard 'H(A) A' format) | ||
awk -v OFS='":"' '{print $2, $1}' | # 'H(A) A' -> 'A":"H(A)' | ||
sed 's|^|"|' | # 'A":"H(A)' -> '"A":"H(A)' | ||
sed 's|$|"|' | # '"A":"H(A)' -> '"A":"H(A)"' | ||
tr '\n' ',' | # Concatenate lines with commas | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think backslash-escaping within backticks is nonportable (POSIX allows the backslash sequence to be expanded early). http://pubs.opengroup.org/onlinepubs/9699919799/xrat/V4_xcu_chap02.html#tag_23_02_06_03 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. See also https://stackoverflow.com/questions/43838007/posix-shell-escaping-line-continuations-in-backquote-command-substitutions (the question isn't quite the same but the answer is relevant). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I used backticks originally because of the Makefile dollar-symbol issue. I'll change it now. |
||
sed 's|,$||' # Remove any trailing comma (to fit JSON spec) | ||
)},\"package\":\"$3\"}" > .cargo-checksum.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package=crate_libc | ||
$(package)_crate_name=libc | ||
$(package)_version=0.2.21 | ||
$(package)_download_path=https://static.crates.io/crates/$($(package)_crate_name) | ||
$(package)_file_name=$($(package)_crate_name)-$($(package)_version).crate | ||
$(package)_sha256_hash=88ee81885f9f04bff991e306fea7c1c60a5f0f9e409e99f6b40e3311a3363135 | ||
$(package)_crate_versioned_name=$($(package)_crate_name) | ||
|
||
define $(package)_preprocess_cmds | ||
$(call generate_crate_checksum,$(package)) | ||
endef | ||
|
||
define $(package)_stage_cmds | ||
$(call vendor_crate_source,$(package)) | ||
endef |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
[source.crates-io] | ||
replace-with = "vendored-sources" | ||
|
||
[source.vendored-sources] | ||
directory = "CRATE_REGISTRY" |
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.
Spotted a bug post-merge: this is supposed to match only leading "./", but actually matches any leading character followed by "/" as the second character.
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.
Similarly, the previous line should be
grep -v '[.]stamp_' |
.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.
Opened #3131.