-
Notifications
You must be signed in to change notification settings - Fork 21
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
Address dev
branch toolchain issues.
#149
Merged
zacshowa
merged 13 commits into
casper-ecosystem:dev
from
zacshowa:address-toolchain-issues
Apr 19, 2024
Merged
Changes from 7 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
8d8debd
Add rust-toolchain.toml to pin the project to the same rust version a…
ba46893
pin clap dependencies to allow project to be compiled with Rust 1.73
ea97e12
Remove build field from package section of Cargo.toml
c11b33d
Update `build.rs` script and version string in `main.rs` to add the s…
61327a6
change build.rs to use `println!()` to communicate with rustc. this s…
f31e2b9
remove unused import and communicate with cargo via historical method…
5a50ef8
run cargo fmt
787ecc7
Change CI file to fix `wasm32-unknown-unknown` issue
4fc1c45
Reduce the rigidity of clap dependencies in Cargo.toml
c272d05
Added a newline for readability in build.rs
e09085a
remove deprecated `actions-rs` in client CI.
9e22082
Add clippy component to toolchainn for CI
a52b6b1
add wasm32-unknown-unknown target to rustup in CI
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 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 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 |
---|---|---|
@@ -1,7 +1,20 @@ | ||
use vergen::{Config, ShaKind}; | ||
use std::process::Command; | ||
|
||
const GIT_HASH_ENV_VAR: &str = "GIT_SHA_SHORT"; | ||
fn main() { | ||
let mut config = Config::default(); | ||
*config.git_mut().sha_kind_mut() = ShaKind::Short; | ||
let _ = vergen::vergen(config); | ||
//Build command to retrieve the short git commit hash | ||
let git_process_output = Command::new("git") | ||
.arg("rev-parse") | ||
.arg("--short") | ||
.arg("HEAD") | ||
.output() | ||
.expect("Failed to retrieve short git commit hash"); | ||
|
||
//Parse the raw output into a string, we still need to remove the newline character | ||
let git_hash_raw = | ||
String::from_utf8(git_process_output.stdout).expect("Failed to convert git hash to string"); | ||
//Remove the newline character from the short git commit hash | ||
let git_hash = git_hash_raw.trim_end_matches('\n'); | ||
|
||
println!("cargo:rustc-env={}={}", GIT_HASH_ENV_VAR, git_hash); | ||
} |
This file contains 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,2 @@ | ||
[toolchain] | ||
channel = "1.73.0" |
This file contains 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.
I guess you can remove [build-dependencies] now.
Are you really really sure you have to fix clap ?
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.
At least I observed issues where
clap_lex
(and likely other clap packages) specified a minimum Rust version (the is already on 1.74).You can see that clap 4.4.18 fixes it at 1.70, whereas 4.5.0 already requires 1.74.
We could consider something less strict like
<4.5.0
instead of=...
though?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.
I agree that the more liberal we can be with the versioning the better. I don't know what the SOP is for moving the toolchain version forward on the node. That is, when should we be moving the versioning forward vs leaving it the same.
Seeing as we currently don't use any of these cutting edge
clap
features, I don't see any reason to increment the toolchain version as we don't have a need to do so on the client.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.
As it turns out the best I can do on this is pinning
clap
to~4.4
and puttingclap_complete
at<4.5.0
.Setting
clap
at<4.5
, for some esoteric reason, results in issues withclap_lex
specifying Rust version 1.74