@@ -393,6 +393,7 @@ pub fn rust_src(build: &Build) {
393
393
"man" ,
394
394
"src" ,
395
395
"cargo" ,
396
+ "rls" ,
396
397
] ;
397
398
398
399
let filter_fn = move |path : & Path | {
@@ -593,6 +594,43 @@ pub fn cargo(build: &Build, stage: u32, target: &str) {
593
594
build. run ( & mut cmd) ;
594
595
}
595
596
597
+ pub fn rls ( build : & Build , stage : u32 , target : & str ) {
598
+ println ! ( "Dist RLS stage{} ({})" , stage, target) ;
599
+ let compiler = Compiler :: new ( stage, & build. config . build ) ;
600
+
601
+ let src = build. src . join ( "rls" ) ;
602
+ let release_num = build. rls_release_num ( ) ;
603
+ let name = format ! ( "rls-{}" , build. package_vers( & release_num) ) ;
604
+
605
+ let tmp = tmpdir ( build) ;
606
+ let image = tmp. join ( "rls-image" ) ;
607
+ drop ( fs:: remove_dir_all ( & image) ) ;
608
+ t ! ( fs:: create_dir_all( & image) ) ;
609
+
610
+ // Prepare the image directory
611
+ let rls = build. cargo_out ( & compiler, Mode :: Tool , target)
612
+ . join ( exe ( "rls" , target) ) ;
613
+ install ( & rls, & image. join ( "bin" ) , 0o755 ) ;
614
+ let doc = image. join ( "share/doc/rls" ) ;
615
+ install ( & src. join ( "README.md" ) , & doc, 0o644 ) ;
616
+ install ( & src. join ( "LICENSE-MIT" ) , & doc, 0o644 ) ;
617
+ install ( & src. join ( "LICENSE-APACHE" ) , & doc, 0o644 ) ;
618
+
619
+ // Generate the installer tarball
620
+ let mut cmd = Command :: new ( "sh" ) ;
621
+ cmd. arg ( sanitize_sh ( & build. src . join ( "src/rust-installer/gen-installer.sh" ) ) )
622
+ . arg ( "--product-name=Rust" )
623
+ . arg ( "--rel-manifest-dir=rustlib" )
624
+ . arg ( "--success-message=RLS-ready-to-serve." )
625
+ . arg ( format ! ( "--image-dir={}" , sanitize_sh( & image) ) )
626
+ . arg ( format ! ( "--work-dir={}" , sanitize_sh( & tmpdir( build) ) ) )
627
+ . arg ( format ! ( "--output-dir={}" , sanitize_sh( & distdir( build) ) ) )
628
+ . arg ( format ! ( "--package-name={}-{}" , name, target) )
629
+ . arg ( "--component-name=rls" )
630
+ . arg ( "--legacy-manifest-dirs=rustlib,cargo" ) ;
631
+ build. run ( & mut cmd) ;
632
+ }
633
+
596
634
/// Creates a combined installer for the specified target in the provided stage.
597
635
pub fn extended ( build : & Build , stage : u32 , target : & str ) {
598
636
println ! ( "Dist extended stage{} ({})" , stage, target) ;
@@ -604,6 +642,11 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
604
642
let cargo_installer = dist. join ( format ! ( "{}-{}.tar.gz" ,
605
643
pkgname( build, "cargo" ) ,
606
644
target) ) ;
645
+ let rls_installer = dist. join ( format ! ( "{}.tar.gz" ,
646
+ pkgname( build, "rls" ) ) ) ;
647
+ let analysis_installer = dist. join ( format ! ( "{}-{}.tar.gz" ,
648
+ pkgname( build, "rust-analysis" ) ,
649
+ target) ) ;
607
650
let docs_installer = dist. join ( format ! ( "{}-{}.tar.gz" ,
608
651
pkgname( build, "rust-docs" ) ,
609
652
target) ) ;
@@ -631,9 +674,11 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
631
674
// upgrades rustc was upgraded before rust-std. To avoid rustc clobbering
632
675
// the std files during uninstall. To do this ensure that rustc comes
633
676
// before rust-std in the list below.
634
- let mut input_tarballs = format ! ( "{},{},{},{}" ,
677
+ let mut input_tarballs = format ! ( "{},{},{},{},{},{} " ,
635
678
sanitize_sh( & rustc_installer) ,
636
679
sanitize_sh( & cargo_installer) ,
680
+ sanitize_sh( & rls_installer) ,
681
+ sanitize_sh( & analysis_installer) ,
637
682
sanitize_sh( & docs_installer) ,
638
683
sanitize_sh( & std_installer) ) ;
639
684
if target. contains ( "pc-windows-gnu" ) {
@@ -675,20 +720,28 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
675
720
let _ = fs:: remove_dir_all ( & pkg) ;
676
721
t ! ( fs:: create_dir_all( pkg. join( "rustc" ) ) ) ;
677
722
t ! ( fs:: create_dir_all( pkg. join( "cargo" ) ) ) ;
723
+ t ! ( fs:: create_dir_all( pkg. join( "rls" ) ) ) ;
724
+ t ! ( fs:: create_dir_all( pkg. join( "rust-analysis" ) ) ) ;
678
725
t ! ( fs:: create_dir_all( pkg. join( "rust-docs" ) ) ) ;
679
726
t ! ( fs:: create_dir_all( pkg. join( "rust-std" ) ) ) ;
680
727
681
728
cp_r ( & work. join ( & format ! ( "{}-{}" , pkgname( build, "rustc" ) , target) ) ,
682
729
& pkg. join ( "rustc" ) ) ;
683
730
cp_r ( & work. join ( & format ! ( "{}-{}" , pkgname( build, "cargo" ) , target) ) ,
684
731
& pkg. join ( "cargo" ) ) ;
732
+ cp_r ( & work. join ( pkgname ( build, "rls" ) ) ,
733
+ & pkg. join ( "rls" ) ) ;
734
+ cp_r ( & work. join ( & format ! ( "{}-{}" , pkgname( build, "rust-analysis" ) , target) ) ,
735
+ & pkg. join ( "rust-analysis" ) ) ;
685
736
cp_r ( & work. join ( & format ! ( "{}-{}" , pkgname( build, "rust-docs" ) , target) ) ,
686
737
& pkg. join ( "rust-docs" ) ) ;
687
738
cp_r ( & work. join ( & format ! ( "{}-{}" , pkgname( build, "rust-std" ) , target) ) ,
688
739
& pkg. join ( "rust-std" ) ) ;
689
740
690
741
install ( & etc. join ( "pkg/postinstall" ) , & pkg. join ( "rustc" ) , 0o755 ) ;
691
742
install ( & etc. join ( "pkg/postinstall" ) , & pkg. join ( "cargo" ) , 0o755 ) ;
743
+ install ( & etc. join ( "pkg/postinstall" ) , & pkg. join ( "rls" ) , 0o755 ) ;
744
+ install ( & etc. join ( "pkg/postinstall" ) , & pkg. join ( "rust-analysis" ) , 0o755 ) ;
692
745
install ( & etc. join ( "pkg/postinstall" ) , & pkg. join ( "rust-docs" ) , 0o755 ) ;
693
746
install ( & etc. join ( "pkg/postinstall" ) , & pkg. join ( "rust-std" ) , 0o755 ) ;
694
747
@@ -702,6 +755,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
702
755
} ;
703
756
pkgbuild ( "rustc" ) ;
704
757
pkgbuild ( "cargo" ) ;
758
+ pkgbuild ( "rls" ) ;
759
+ pkgbuild ( "rust-analysis" ) ;
705
760
pkgbuild ( "rust-docs" ) ;
706
761
pkgbuild ( "rust-std" ) ;
707
762
@@ -727,6 +782,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
727
782
let _ = fs:: remove_dir_all ( & exe) ;
728
783
t ! ( fs:: create_dir_all( exe. join( "rustc" ) ) ) ;
729
784
t ! ( fs:: create_dir_all( exe. join( "cargo" ) ) ) ;
785
+ t ! ( fs:: create_dir_all( exe. join( "rls" ) ) ) ;
786
+ t ! ( fs:: create_dir_all( exe. join( "rust-analysis" ) ) ) ;
730
787
t ! ( fs:: create_dir_all( exe. join( "rust-docs" ) ) ) ;
731
788
t ! ( fs:: create_dir_all( exe. join( "rust-std" ) ) ) ;
732
789
cp_r ( & work. join ( & format ! ( "{}-{}" , pkgname( build, "rustc" ) , target) )
@@ -735,6 +792,12 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
735
792
cp_r ( & work. join ( & format ! ( "{}-{}" , pkgname( build, "cargo" ) , target) )
736
793
. join ( "cargo" ) ,
737
794
& exe. join ( "cargo" ) ) ;
795
+ cp_r ( & work. join ( pkgname ( build, "rls" ) )
796
+ . join ( "rls" ) ,
797
+ & exe. join ( "rls" ) ) ;
798
+ cp_r ( & work. join ( & format ! ( "{}-{}" , pkgname( build, "rust-analysis" ) , target) )
799
+ . join ( "rust-analysis" ) ,
800
+ & exe. join ( "rust-analysis" ) ) ;
738
801
cp_r ( & work. join ( & format ! ( "{}-{}" , pkgname( build, "rust-docs" ) , target) )
739
802
. join ( "rust-docs" ) ,
740
803
& exe. join ( "rust-docs" ) ) ;
@@ -744,6 +807,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
744
807
745
808
t ! ( fs:: remove_file( exe. join( "rustc/manifest.in" ) ) ) ;
746
809
t ! ( fs:: remove_file( exe. join( "cargo/manifest.in" ) ) ) ;
810
+ t ! ( fs:: remove_file( exe. join( "rls/manifest.in" ) ) ) ;
811
+ t ! ( fs:: remove_file( exe. join( "rust-analysis/manifest.in" ) ) ) ;
747
812
t ! ( fs:: remove_file( exe. join( "rust-docs/manifest.in" ) ) ) ;
748
813
t ! ( fs:: remove_file( exe. join( "rust-std/manifest.in" ) ) ) ;
749
814
@@ -800,6 +865,26 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
800
865
. arg ( "-var" ) . arg ( "var.DocsDir" )
801
866
. arg ( "-out" ) . arg ( exe. join ( "DocsGroup.wxs" ) )
802
867
. arg ( "-t" ) . arg ( etc. join ( "msi/squash-components.xsl" ) ) ) ;
868
+ build. run ( Command :: new ( & heat)
869
+ . current_dir ( & exe)
870
+ . arg ( "dir" )
871
+ . arg ( "rls" )
872
+ . args ( & heat_flags)
873
+ . arg ( "-cg" ) . arg ( "RlsGroup" )
874
+ . arg ( "-dr" ) . arg ( "Rls" )
875
+ . arg ( "-var" ) . arg ( "var.RlsDir" )
876
+ . arg ( "-out" ) . arg ( exe. join ( "RlsGroup.wxs" ) )
877
+ . arg ( "-t" ) . arg ( etc. join ( "msi/squash-components.xsl" ) ) ) ;
878
+ build. run ( Command :: new ( & heat)
879
+ . current_dir ( & exe)
880
+ . arg ( "dir" )
881
+ . arg ( "rust-analysis" )
882
+ . args ( & heat_flags)
883
+ . arg ( "-cg" ) . arg ( "AnalysisGroup" )
884
+ . arg ( "-dr" ) . arg ( "Analysis" )
885
+ . arg ( "-var" ) . arg ( "var.AnalysisDir" )
886
+ . arg ( "-out" ) . arg ( exe. join ( "AnalysisGroup.wxs" ) )
887
+ . arg ( "-t" ) . arg ( etc. join ( "msi/squash-components.xsl" ) ) ) ;
803
888
build. run ( Command :: new ( & heat)
804
889
. current_dir ( & exe)
805
890
. arg ( "dir" )
@@ -840,6 +925,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
840
925
. arg ( "-nologo" )
841
926
. arg ( "-dRustcDir=rustc" )
842
927
. arg ( "-dDocsDir=rust-docs" )
928
+ . arg ( "-dRlsDir=rls" )
929
+ . arg ( "-dAnalysisDir=rust-analysis" )
843
930
. arg ( "-dCargoDir=cargo" )
844
931
. arg ( "-dStdDir=rust-std" )
845
932
. arg ( "-arch" ) . arg ( & arch)
@@ -857,6 +944,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
857
944
candle ( & etc. join ( "msi/rustwelcomedlg.wxs" ) ) ;
858
945
candle ( "RustcGroup.wxs" . as_ref ( ) ) ;
859
946
candle ( "DocsGroup.wxs" . as_ref ( ) ) ;
947
+ candle ( "RlsGroup.wxs" . as_ref ( ) ) ;
948
+ candle ( "AnalysisGroup.wxs" . as_ref ( ) ) ;
860
949
candle ( "CargoGroup.wxs" . as_ref ( ) ) ;
861
950
candle ( "StdGroup.wxs" . as_ref ( ) ) ;
862
951
@@ -879,6 +968,8 @@ pub fn extended(build: &Build, stage: u32, target: &str) {
879
968
. arg ( "rustwelcomedlg.wixobj" )
880
969
. arg ( "RustcGroup.wixobj" )
881
970
. arg ( "DocsGroup.wixobj" )
971
+ . arg ( "RlsGroup.wixobj" )
972
+ . arg ( "AnalysisGroup.wixobj" )
882
973
. arg ( "CargoGroup.wixobj" )
883
974
. arg ( "StdGroup.wixobj" )
884
975
. current_dir ( & exe) ;
0 commit comments