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

RLS on beta #44204

Merged
merged 3 commits into from
Sep 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
339 changes: 339 additions & 0 deletions src/Cargo.lock

Large diffs are not rendered by default.

20 changes: 20 additions & 0 deletions src/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,26 @@ members = [
"tools/rust-installer",
"tools/cargo",
"tools/rustdoc",
"tools/rls",
# FIXME(https://github.com/rust-lang/cargo/issues/4089): move these to exclude
"tools/rls/test_data/borrow_error",
"tools/rls/test_data/completion",
"tools/rls/test_data/find_all_refs",
"tools/rls/test_data/find_all_refs_no_cfg_test",
"tools/rls/test_data/goto_def",
"tools/rls/test_data/highlight",
"tools/rls/test_data/hover",
"tools/rls/test_data/rename",
"tools/rls/test_data/reformat",
"tools/rls/test_data/bin_lib_no_cfg_test",
"tools/rls/test_data/multiple_bins",
"tools/rls/test_data/bin_lib",
"tools/rls/test_data/reformat_with_range",
"tools/rls/test_data/find_impls",
"tools/rls/test_data/infer_bin",
"tools/rls/test_data/infer_custom_bin",
"tools/rls/test_data/infer_lib",
"tools/rls/test_data/omit_init_build",
]

# Curiously, compiletest will segfault if compiled with opt-level=3 on 64-bit
Expand Down
50 changes: 49 additions & 1 deletion src/bootstrap/dist.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1126,6 +1126,7 @@ impl Step for Extended {
compiler: builder.compiler(stage, target),
});
let cargo_installer = builder.ensure(Cargo { stage, target });
let rls_installer = builder.ensure(Rls { stage, target });
let mingw_installer = builder.ensure(Mingw { host: target });
let analysis_installer = builder.ensure(Analysis {
compiler: builder.compiler(stage, self.host),
Expand Down Expand Up @@ -1155,7 +1156,7 @@ impl Step for Extended {
// 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 tarballs = vec![rustc_installer, cargo_installer,
let mut tarballs = vec![rustc_installer, cargo_installer, rls_installer,
analysis_installer, docs_installer, std_installer];
if target.contains("pc-windows-gnu") {
tarballs.push(mingw_installer.unwrap());
Expand Down Expand Up @@ -1202,6 +1203,8 @@ impl Step for Extended {
t!(fs::create_dir_all(pkg.join("cargo")));
t!(fs::create_dir_all(pkg.join("rust-docs")));
t!(fs::create_dir_all(pkg.join("rust-std")));
t!(fs::create_dir_all(pkg.join("rls")));
t!(fs::create_dir_all(pkg.join("rust-analysis")));

cp_r(&work.join(&format!("{}-{}", pkgname(build, "rustc"), target)),
&pkg.join("rustc"));
Expand All @@ -1211,11 +1214,17 @@ impl Step for Extended {
&pkg.join("rust-docs"));
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-std"), target)),
&pkg.join("rust-std"));
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rls"), target)),
&pkg.join("rls"));
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-analysis"), target)),
&pkg.join("rust-analysis"));

install(&etc.join("pkg/postinstall"), &pkg.join("rustc"), 0o755);
install(&etc.join("pkg/postinstall"), &pkg.join("cargo"), 0o755);
install(&etc.join("pkg/postinstall"), &pkg.join("rust-docs"), 0o755);
install(&etc.join("pkg/postinstall"), &pkg.join("rust-std"), 0o755);
install(&etc.join("pkg/postinstall"), &pkg.join("rls"), 0o755);
install(&etc.join("pkg/postinstall"), &pkg.join("rust-analysis"), 0o755);

let pkgbuild = |component: &str| {
let mut cmd = Command::new("pkgbuild");
Expand All @@ -1229,6 +1238,8 @@ impl Step for Extended {
pkgbuild("cargo");
pkgbuild("rust-docs");
pkgbuild("rust-std");
pkgbuild("rls");
pkgbuild("rust-analysis");

// create an 'uninstall' package
install(&etc.join("pkg/postinstall"), &pkg.join("uninstall"), 0o755);
Expand All @@ -1252,6 +1263,8 @@ impl Step for Extended {
let _ = fs::remove_dir_all(&exe);
t!(fs::create_dir_all(exe.join("rustc")));
t!(fs::create_dir_all(exe.join("cargo")));
t!(fs::create_dir_all(exe.join("rls")));
t!(fs::create_dir_all(exe.join("rust-analysis")));
t!(fs::create_dir_all(exe.join("rust-docs")));
t!(fs::create_dir_all(exe.join("rust-std")));
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rustc"), target))
Expand All @@ -1266,11 +1279,19 @@ impl Step for Extended {
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-std"), target))
.join(format!("rust-std-{}", target)),
&exe.join("rust-std"));
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rls"), target))
.join("rls"),
&exe.join("rls"));
cp_r(&work.join(&format!("{}-{}", pkgname(build, "rust-analysis"), target))
.join(format!("rust-analysis-{}", target)),
&exe.join("rust-analysis"));

t!(fs::remove_file(exe.join("rustc/manifest.in")));
t!(fs::remove_file(exe.join("cargo/manifest.in")));
t!(fs::remove_file(exe.join("rust-docs/manifest.in")));
t!(fs::remove_file(exe.join("rust-std/manifest.in")));
t!(fs::remove_file(exe.join("rls/manifest.in")));
t!(fs::remove_file(exe.join("rust-analysis/manifest.in")));

if target.contains("windows-gnu") {
t!(fs::create_dir_all(exe.join("rust-mingw")));
Expand Down Expand Up @@ -1344,6 +1365,26 @@ impl Step for Extended {
.arg("-dr").arg("Std")
.arg("-var").arg("var.StdDir")
.arg("-out").arg(exe.join("StdGroup.wxs")));
build.run(Command::new(&heat)
.current_dir(&exe)
.arg("dir")
.arg("rls")
.args(&heat_flags)
.arg("-cg").arg("RlsGroup")
.arg("-dr").arg("Rls")
.arg("-var").arg("var.RlsDir")
.arg("-out").arg(exe.join("RlsGroup.wxs"))
.arg("-t").arg(etc.join("msi/remove-duplicates.xsl")));
build.run(Command::new(&heat)
.current_dir(&exe)
.arg("dir")
.arg("rust-analysis")
.args(&heat_flags)
.arg("-cg").arg("AnalysisGroup")
.arg("-dr").arg("Analysis")
.arg("-var").arg("var.AnalysisDir")
.arg("-out").arg(exe.join("AnalysisGroup.wxs"))
.arg("-t").arg(etc.join("msi/remove-duplicates.xsl")));
if target.contains("windows-gnu") {
build.run(Command::new(&heat)
.current_dir(&exe)
Expand All @@ -1367,6 +1408,8 @@ impl Step for Extended {
.arg("-dDocsDir=rust-docs")
.arg("-dCargoDir=cargo")
.arg("-dStdDir=rust-std")
.arg("-dRlsDir=rls")
.arg("-dAnalysisDir=rust-analysis")
.arg("-arch").arg(&arch)
.arg("-out").arg(&output)
.arg(&input);
Expand All @@ -1384,6 +1427,8 @@ impl Step for Extended {
candle("DocsGroup.wxs".as_ref());
candle("CargoGroup.wxs".as_ref());
candle("StdGroup.wxs".as_ref());
candle("RlsGroup.wxs".as_ref());
candle("AnalysisGroup.wxs".as_ref());

if target.contains("windows-gnu") {
candle("GccGroup.wxs".as_ref());
Expand All @@ -1406,6 +1451,8 @@ impl Step for Extended {
.arg("DocsGroup.wixobj")
.arg("CargoGroup.wixobj")
.arg("StdGroup.wixobj")
.arg("RlsGroup.wixobj")
.arg("AnalysisGroup.wixobj")
.current_dir(&exe);

if target.contains("windows-gnu") {
Expand Down Expand Up @@ -1490,6 +1537,7 @@ impl Step for HashSign {
cmd.arg(today.trim());
cmd.arg(build.rust_package_vers());
cmd.arg(build.package_vers(&build.release_num("cargo")));
cmd.arg(build.package_vers(&build.release_num("rls")));
cmd.arg(addr);

t!(fs::create_dir_all(distdir(build)));
Expand Down
1 change: 1 addition & 0 deletions src/bootstrap/mk/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ check-aux:
$(Q)$(BOOTSTRAP) test \
src/tools/cargotest \
src/tools/cargo \
src/tools/rls \
src/test/pretty \
src/test/run-pass/pretty \
src/test/run-fail/pretty \
Expand Down
5 changes: 3 additions & 2 deletions src/bootstrap/tool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -348,11 +348,12 @@ pub struct Rls {

impl Step for Rls {
type Output = PathBuf;
const DEFAULT: bool = false;
const DEFAULT: bool = true;
const ONLY_HOSTS: bool = true;

fn should_run(run: ShouldRun) -> ShouldRun {
run.path("src/tools/rls")
let builder = run.builder;
run.path("src/tools/rls").default_condition(builder.build.config.extended)
}

fn make_run(run: RunConfig) {
Expand Down
3 changes: 3 additions & 0 deletions src/etc/installer/exe/rust.iss
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Name: gcc; Description: "Linker and platform libraries"; Types: full
Name: docs; Description: "HTML documentation"; Types: full
Name: cargo; Description: "Cargo, the Rust package manager"; Types: full
Name: std; Description: "The Rust Standard Library"; Types: full
Name: rls; Description: "RLS, the Rust Language Server"

[Files]
Source: "rustc/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: rust
Expand All @@ -55,6 +56,8 @@ Source: "rust-mingw/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs;
Source: "rust-docs/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: docs
Source: "cargo/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: cargo
Source: "rust-std/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: std
Source: "rls/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: rls
Source: "rust-analysis/*.*"; DestDir: "{app}"; Flags: ignoreversion recursesubdirs; Components: rls

[Code]
const
Expand Down
10 changes: 10 additions & 0 deletions src/etc/installer/msi/rust.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@
<Directory Id="Docs" Name="." />
<Directory Id="Cargo" Name="." />
<Directory Id="Std" Name="." />
<Directory Id="Rls" Name="." />
<Directory Id="Analysis" Name="." />
</Directory>
</Directory>

Expand Down Expand Up @@ -273,6 +275,14 @@
<ComponentRef Id="PathEnvPerMachine" />
<ComponentRef Id="PathEnvPerUser" />
</Feature>
<Feature Id="RLS"
Title="RLS, the Rust Language Server"
Display="7"
Level="2"
AllowAdvertise="no">
<ComponentGroupRef Id="RlsGroup" />
<ComponentGroupRef Id="AnalysisGroup" />
</Feature>

<UIRef Id="RustUI" />
</Product>
Expand Down
11 changes: 11 additions & 0 deletions src/etc/installer/pkg/Distribution.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<line choice="rust-std"/>
<line choice="cargo"/>
<line choice="rust-docs"/>
<line choice="rls"/>
</line>
<line choice="uninstall" />
</choices-outline>
Expand Down Expand Up @@ -61,10 +62,20 @@
>
<pkg-ref id="org.rust-lang.rust-docs"/>
</choice>
<choice id="rls" visible="true"
title="RLS" description="RLS, the Rust Language Server"
selected="(!choices.uninstall.selected &amp;&amp; choices['rls'].selected) || (choices.uninstall.selected &amp;&amp; choices.install.selected)"
start_selected="false"
>
<pkg-ref id="org.rust-lang.rls"/>
<pkg-ref id="org.rust-lang.rust-analysis"/>
</choice>
<pkg-ref id="org.rust-lang.rustc" version="0" onConclusion="none">rustc.pkg</pkg-ref>
<pkg-ref id="org.rust-lang.cargo" version="0" onConclusion="none">cargo.pkg</pkg-ref>
<pkg-ref id="org.rust-lang.rust-docs" version="0" onConclusion="none">rust-docs.pkg</pkg-ref>
<pkg-ref id="org.rust-lang.rust-std" version="0" onConclusion="none">rust-std.pkg</pkg-ref>
<pkg-ref id="org.rust-lang.rls" version="0" onConclusion="none">rls.pkg</pkg-ref>
<pkg-ref id="org.rust-lang.rust-analysis" version="0" onConclusion="none">rust-analysis.pkg</pkg-ref>
<pkg-ref id="org.rust-lang.uninstall" version="0" onConclusion="none">uninstall.pkg</pkg-ref>
<background file="rust-logo.png" mime-type="image/png"
alignment="bottomleft"/>
Expand Down
20 changes: 20 additions & 0 deletions src/tools/build-manifest/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ macro_rules! t {
struct Builder {
rust_release: String,
cargo_release: String,
rls_release: String,
input: PathBuf,
output: PathBuf,
gpg_passphrase: String,
Expand All @@ -165,6 +166,7 @@ struct Builder {
date: String,
rust_version: String,
cargo_version: String,
rls_version: String,
}

fn main() {
Expand All @@ -174,13 +176,15 @@ fn main() {
let date = args.next().unwrap();
let rust_release = args.next().unwrap();
let cargo_release = args.next().unwrap();
let rls_release = args.next().unwrap();
let s3_address = args.next().unwrap();
let mut passphrase = String::new();
t!(io::stdin().read_to_string(&mut passphrase));

Builder {
rust_release,
cargo_release,
rls_release,
input,
output,
gpg_passphrase: passphrase,
Expand All @@ -189,13 +193,15 @@ fn main() {
date,
rust_version: String::new(),
cargo_version: String::new(),
rls_version: String::new(),
}.build();
}

impl Builder {
fn build(&mut self) {
self.rust_version = self.version("rust", "x86_64-unknown-linux-gnu");
self.cargo_version = self.version("cargo", "x86_64-unknown-linux-gnu");
self.rls_version = self.version("rls", "x86_64-unknown-linux-gnu");

self.digest_and_sign();
let manifest = self.build_manifest();
Expand Down Expand Up @@ -233,6 +239,12 @@ impl Builder {
self.package("rust-std", &mut manifest.pkg, TARGETS);
self.package("rust-docs", &mut manifest.pkg, TARGETS);
self.package("rust-src", &mut manifest.pkg, &["*"]);
let rls_package_name = if self.rust_release == "nightly" {
"rls"
} else {
"rls-preview"
};
self.package(rls_package_name, &mut manifest.pkg, HOSTS);
self.package("rust-analysis", &mut manifest.pkg, TARGETS);

let mut pkg = Package {
Expand Down Expand Up @@ -268,6 +280,10 @@ impl Builder {
});
}

extensions.push(Component {
pkg: rls_package_name.to_string(),
target: host.to_string(),
});
extensions.push(Component {
pkg: "rust-analysis".to_string(),
target: host.to_string(),
Expand Down Expand Up @@ -342,6 +358,8 @@ impl Builder {
format!("rust-src-{}.tar.gz", self.rust_release)
} else if component == "cargo" {
format!("cargo-{}-{}.tar.gz", self.cargo_release, target)
} else if component == "rls" || component == "rls-preview" {
format!("rls-{}-{}.tar.gz", self.rls_release, target)
} else {
format!("{}-{}-{}.tar.gz", component, self.rust_release, target)
}
Expand All @@ -350,6 +368,8 @@ impl Builder {
fn cached_version(&self, component: &str) -> &str {
if component == "cargo" {
&self.cargo_version
} else if component == "rls" || component == "rls-preview" {
&self.rls_version
} else {
&self.rust_version
}
Expand Down
2 changes: 1 addition & 1 deletion src/tools/rls
Submodule rls updated from 25ffb3 to 86ff0b