-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Add the RLS as a submodule and build a package out of it #40584
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
Merged
Merged
Changes from 4 commits
Commits
Show all changes
5 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
Submodule cargo
updated
38 files
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
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 |
---|---|---|
|
@@ -40,7 +40,7 @@ fn pkgname(build: &Build, component: &str) -> String { | |
if component == "cargo" { | ||
format!("{}-{}", component, build.cargo_package_vers()) | ||
} else { | ||
assert!(component.starts_with("rust")); | ||
assert!(component.starts_with("rust") || component == "rls"); | ||
format!("{}-{}", component, build.rust_package_vers()) | ||
} | ||
} | ||
|
@@ -315,15 +315,12 @@ pub fn rust_src_location(build: &Build) -> PathBuf { | |
|
||
/// Creates a tarball of save-analysis metadata, if available. | ||
pub fn analysis(build: &Build, compiler: &Compiler, target: &str) { | ||
if !build.config.rust_save_analysis { | ||
return | ||
} | ||
|
||
assert!(build.config.extended); | ||
println!("Dist analysis"); | ||
|
||
if compiler.host != build.config.build { | ||
println!("\tskipping, not a build host"); | ||
return | ||
return; | ||
} | ||
|
||
// Package save-analysis from stage1 if not doing a full bootstrap, as the | ||
|
@@ -393,6 +390,7 @@ pub fn rust_src(build: &Build) { | |
"man", | ||
"src", | ||
"cargo", | ||
"rls", | ||
]; | ||
|
||
let filter_fn = move |path: &Path| { | ||
|
@@ -539,7 +537,7 @@ pub fn cargo(build: &Build, stage: u32, target: &str) { | |
|
||
let src = build.src.join("cargo"); | ||
let etc = src.join("src/etc"); | ||
let release_num = build.cargo_release_num(); | ||
let release_num = build.release_num("cargo"); | ||
let name = pkgname(build, "cargo"); | ||
let version = build.cargo_info.version(build, &release_num); | ||
|
||
|
@@ -593,6 +591,44 @@ pub fn cargo(build: &Build, stage: u32, target: &str) { | |
build.run(&mut cmd); | ||
} | ||
|
||
pub fn rls(build: &Build, stage: u32, target: &str) { | ||
assert!(build.config.extended); | ||
println!("Dist RLS stage{} ({})", stage, target); | ||
let compiler = Compiler::new(stage, &build.config.build); | ||
|
||
let src = build.src.join("rls"); | ||
let release_num = build.release_num("rls"); | ||
let name = format!("rls-{}", build.package_vers(&release_num)); | ||
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. This should use the |
||
|
||
let tmp = tmpdir(build); | ||
let image = tmp.join("rls-image"); | ||
drop(fs::remove_dir_all(&image)); | ||
t!(fs::create_dir_all(&image)); | ||
|
||
// Prepare the image directory | ||
let rls = build.cargo_out(&compiler, Mode::Tool, target) | ||
.join(exe("rls", target)); | ||
install(&rls, &image.join("bin"), 0o755); | ||
let doc = image.join("share/doc/rls"); | ||
install(&src.join("README.md"), &doc, 0o644); | ||
install(&src.join("LICENSE-MIT"), &doc, 0o644); | ||
install(&src.join("LICENSE-APACHE"), &doc, 0o644); | ||
|
||
// Generate the installer tarball | ||
let mut cmd = Command::new("sh"); | ||
cmd.arg(sanitize_sh(&build.src.join("src/rust-installer/gen-installer.sh"))) | ||
.arg("--product-name=Rust") | ||
.arg("--rel-manifest-dir=rustlib") | ||
.arg("--success-message=RLS-ready-to-serve.") | ||
.arg(format!("--image-dir={}", sanitize_sh(&image))) | ||
.arg(format!("--work-dir={}", sanitize_sh(&tmpdir(build)))) | ||
.arg(format!("--output-dir={}", sanitize_sh(&distdir(build)))) | ||
.arg(format!("--package-name={}-{}", name, target)) | ||
.arg("--component-name=rls") | ||
.arg("--legacy-manifest-dirs=rustlib,cargo"); | ||
build.run(&mut cmd); | ||
} | ||
|
||
/// Creates a combined installer for the specified target in the provided stage. | ||
pub fn extended(build: &Build, stage: u32, target: &str) { | ||
println!("Dist extended stage{} ({})", stage, target); | ||
|
@@ -604,6 +640,12 @@ pub fn extended(build: &Build, stage: u32, target: &str) { | |
let cargo_installer = dist.join(format!("{}-{}.tar.gz", | ||
pkgname(build, "cargo"), | ||
target)); | ||
let rls_installer = dist.join(format!("{}-{}.tar.gz", | ||
pkgname(build, "rls"), | ||
target)); | ||
let analysis_installer = dist.join(format!("{}-{}.tar.gz", | ||
pkgname(build, "rust-analysis"), | ||
target)); | ||
let docs_installer = dist.join(format!("{}-{}.tar.gz", | ||
pkgname(build, "rust-docs"), | ||
target)); | ||
|
@@ -631,9 +673,11 @@ pub fn extended(build: &Build, stage: u32, target: &str) { | |
// upgrades rustc was upgraded before rust-std. To avoid rustc clobbering | ||
// the std files during uninstall. To do this ensure that rustc comes | ||
// before rust-std in the list below. | ||
let mut input_tarballs = format!("{},{},{},{}", | ||
let mut input_tarballs = format!("{},{},{},{},{},{}", | ||
sanitize_sh(&rustc_installer), | ||
sanitize_sh(&cargo_installer), | ||
sanitize_sh(&rls_installer), | ||
sanitize_sh(&analysis_installer), | ||
sanitize_sh(&docs_installer), | ||
sanitize_sh(&std_installer)); | ||
if target.contains("pc-windows-gnu") { | ||
|
@@ -946,7 +990,7 @@ pub fn hash_and_sign(build: &Build) { | |
cmd.arg(distdir(build)); | ||
cmd.arg(today.trim()); | ||
cmd.arg(build.rust_package_vers()); | ||
cmd.arg(build.package_vers(&build.cargo_release_num())); | ||
cmd.arg(build.package_vers(&build.release_num("cargo"))); | ||
cmd.arg(addr); | ||
|
||
t!(fs::create_dir_all(distdir(build))); | ||
|
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
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
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.
This'll actually need to be handled specially, the rls is versioned differently than the rest of the distribution, so this'll need a special clause like Cargo