@@ -1211,7 +1211,8 @@ impl Step for Src {
12111211}
12121212
12131213/// Tarball for people who want to build rustc and other components from the source.
1214- /// Does not contain GPL code for licensing reasons.
1214+ /// Does not contain GPL code, which is separated into `PlainSourceTarballGpl`
1215+ /// for licensing reasons.
12151216#[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
12161217pub struct PlainSourceTarball ;
12171218
@@ -1261,7 +1262,39 @@ impl Step for PlainSourceTarball {
12611262 }
12621263}
12631264
1264- fn prepare_source_tarball ( builder : & Builder < ' _ > , name : & str , exclude_dirs : & [ & str ] ) -> Tarball {
1265+ /// Tarball with *all* source code for source builds, including GPL-licensed code.
1266+ #[ derive( Debug , Clone , Hash , PartialEq , Eq ) ]
1267+ pub struct PlainSourceTarballGpl ;
1268+
1269+ impl Step for PlainSourceTarballGpl {
1270+ /// Produces the location of the tarball generated
1271+ type Output = GeneratedTarball ;
1272+ const IS_HOST : bool = true ;
1273+
1274+ fn should_run ( run : ShouldRun < ' _ > ) -> ShouldRun < ' _ > {
1275+ run. alias ( "rustc-src-gpl" )
1276+ }
1277+
1278+ fn is_default_step ( builder : & Builder < ' _ > ) -> bool {
1279+ builder. config . rust_dist_src
1280+ }
1281+
1282+ fn make_run ( run : RunConfig < ' _ > ) {
1283+ run. builder . ensure ( PlainSourceTarballGpl ) ;
1284+ }
1285+
1286+ /// Creates the plain source tarball
1287+ fn run ( self , builder : & Builder < ' _ > ) -> GeneratedTarball {
1288+ let tarball = prepare_source_tarball ( builder, "src-gpl" , & [ ] ) ;
1289+ tarball. bare ( )
1290+ }
1291+ }
1292+
1293+ fn prepare_source_tarball < ' a > (
1294+ builder : & ' a Builder < ' a > ,
1295+ name : & str ,
1296+ exclude_dirs : & [ & str ] ,
1297+ ) -> Tarball < ' a > {
12651298 // NOTE: This is a strange component in a lot of ways. It uses `src` as the target, which
12661299 // means neither rustup nor rustup-toolchain-install-master know how to download it.
12671300 // It also contains symbolic links, unlike other any other dist tarball.
0 commit comments