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

Bring the version command output in line with other rust tools #12449

Merged
merged 1 commit into from
Jun 10, 2022

Conversation

Veykril
Copy link
Member

@Veykril Veykril commented Jun 2, 2022

Inspired by how cargo handles it
Fixes #12280
image

Comment on lines 12 to 10
if option_env!("CFG_RELEASE").is_none() {
println!("cargo:rustc-env=POKE_RA_DEVS");
}
Copy link
Member Author

Choose a reason for hiding this comment

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

Of note here is, poking only happens if the server is built without a release version set (so local builds will poke as before)

@@ -72,7 +72,8 @@ fn dist_client(
}

fn dist_server(sh: &Shell, release_channel: &str, target: &Target) -> anyhow::Result<()> {
let _e = sh.push_env("RUST_ANALYZER_CHANNEL", release_channel);
let _e = sh.push_env("CFG_RELEASE_CHANNEL", release_channel);
let _e = sh.push_env("CFG_RELEASE", "0.0.0");
Copy link
Member Author

Choose a reason for hiding this comment

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

We don't currently have a notion of server version when doing our own builds so I left this as 0.0.0 (if left unset we would poke people again). We could of course also set this to any string we want, not necessarily a version. It would probably make sense to make this differ from the usual 1.56.0-stable like versions of the rust toolchain since this build is independent from that.

@Veykril Veykril marked this pull request as ready for review June 2, 2022 16:36
@Veykril
Copy link
Member Author

Veykril commented Jun 2, 2022

Not sure how rustbuild works though so @cuviper, you should probably have a look at this as well since you opened the issue.

This also needs an adjustment for the submodule building the rust repo I imagine since this changes the env vars.

@cuviper
Copy link
Member

cuviper commented Jun 3, 2022

Looks good to me! Those CFG_RELEASE* envs are set by rustbuild for all ToolBuild steps, so I think that will be fine. I think this information will also be useful for RA maintainers to see where bug reports are coming from. (cc #12432)

Not sure what you mean about the submodule -- build scripts should run in your source dir, so I think git will see the right thing.

@Veykril
Copy link
Member Author

Veykril commented Jun 10, 2022

@bors r+

1 similar comment
@Veykril
Copy link
Member Author

Veykril commented Jun 10, 2022

@bors r+

@bors
Copy link
Collaborator

bors commented Jun 10, 2022

📌 Commit a2a3ea8 has been approved by Veykril

@bors
Copy link
Collaborator

bors commented Jun 10, 2022

⌛ Testing commit a2a3ea8 with merge ba32991...

@bors
Copy link
Collaborator

bors commented Jun 10, 2022

☀️ Test successful - checks-actions
Approved by: Veykril
Pushing ba32991 to master...

@bors bors merged commit ba32991 into rust-lang:master Jun 10, 2022
@Veykril Veykril deleted the version branch June 11, 2022 11:35
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.

Version output is inconsistent with other tools
3 participants