Skip to content

Commit da2ce22

Browse files
authored
Auto merge of #37670 - eddyb:rollup, r=eddyb
Rollup of 15 pull requests - Successful merges: #36868, #37134, #37229, #37250, #37370, #37428, #37432, #37472, #37524, #37614, #37622, #37627, #37636, #37644, #37654 - Failed merges: #37463, #37542, #37645
2 parents bca365e + 60c74b7 commit da2ce22

File tree

510 files changed

+42643
-1380
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

510 files changed

+42643
-1380
lines changed

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,4 @@
77
src/etc/pkg/rust-logo.ico binary
88
src/etc/pkg/rust-logo.png binary
99
*.woff binary
10+
src/vendor/* binary

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,4 @@ tmp.*.rs
9898
version.md
9999
version.ml
100100
version.texi
101+
.cargo

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ before_install:
1515
script:
1616
- docker run -v `pwd`:/build rust
1717
sh -c "
18-
./configure --enable-rustbuild --llvm-root=/usr/lib/llvm-3.7 --enable-quiet-tests &&
18+
./configure --enable-vendor --enable-rustbuild --llvm-root=/usr/lib/llvm-3.7 --enable-quiet-tests &&
1919
make tidy &&
2020
make check -j4
2121
"

configure

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,7 @@ opt rustbuild 0 "use the rust and cargo based build system"
634634
opt codegen-tests 1 "run the src/test/codegen tests"
635635
opt option-checking 1 "complain about unrecognized options in this configure script"
636636
opt ninja 0 "build LLVM using the Ninja generator (for MSVC, requires building in the correct environment)"
637+
opt vendor 0 "enable usage of vendored Rust crates"
637638

638639
# Optimization and debugging options. These may be overridden by the release channel, etc.
639640
opt_nosave optimize 1 "build optimized rust code"

mk/dist.mk

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,8 @@ PKG_FILES := \
6565
stage0.txt \
6666
rust-installer \
6767
tools \
68-
test) \
68+
test \
69+
vendor) \
6970
$(PKG_GITMODULES) \
7071
$(filter-out config.stamp, \
7172
$(MKFILES_FOR_TARBALL))

src/Cargo.lock

Lines changed: 0 additions & 69 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/bootstrap/Cargo.toml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,6 @@ num_cpus = "0.2"
2727
toml = "0.1"
2828
getopts = "0.2"
2929
rustc-serialize = "0.3"
30-
gcc = "0.3.36"
30+
gcc = "0.3.38"
3131
libc = "0.2"
3232
md5 = "0.1"
33-
34-
[target.'cfg(windows)'.dependencies]
35-
winapi = "0.2"
36-
kernel32-sys = "0.2"

src/bootstrap/bootstrap.py

Lines changed: 24 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -259,9 +259,11 @@ def build_bootstrap(self):
259259
env["DYLD_LIBRARY_PATH"] = os.path.join(self.bin_root(), "lib")
260260
env["PATH"] = os.path.join(self.bin_root(), "bin") + \
261261
os.pathsep + env["PATH"]
262-
self.run([self.cargo(), "build", "--manifest-path",
263-
os.path.join(self.rust_root, "src/bootstrap/Cargo.toml")],
264-
env)
262+
args = [self.cargo(), "build", "--manifest-path",
263+
os.path.join(self.rust_root, "src/bootstrap/Cargo.toml")]
264+
if self.use_vendored_sources:
265+
args.append("--frozen")
266+
self.run(args, env)
265267

266268
def run(self, args, env):
267269
proc = subprocess.Popen(args, env=env)
@@ -400,6 +402,25 @@ def main():
400402
except:
401403
pass
402404

405+
rb.use_vendored_sources = '\nvendor = true' in rb.config_toml or \
406+
'CFG_ENABLE_VENDOR' in rb.config_mk
407+
408+
if rb.use_vendored_sources:
409+
if not os.path.exists('.cargo'):
410+
os.makedirs('.cargo')
411+
f = open('.cargo/config','w')
412+
f.write("""
413+
[source.crates-io]
414+
replace-with = 'vendored-sources'
415+
registry = 'https://example.com'
416+
417+
[source.vendored-sources]
418+
directory = '{}/src/vendor'
419+
""".format(rb.rust_root))
420+
f.close()
421+
else:
422+
if os.path.exists('.cargo'):
423+
shutil.rmtree('.cargo')
403424
data = stage0_data(rb.rust_root)
404425
rb._rustc_channel, rb._rustc_date = data['rustc'].split('-', 1)
405426
rb._cargo_channel, rb._cargo_date = data['cargo'].split('-', 1)

src/bootstrap/config.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ pub struct Config {
4444
pub submodules: bool,
4545
pub compiler_docs: bool,
4646
pub docs: bool,
47+
pub vendor: bool,
4748
pub target_config: HashMap<String, Target>,
4849

4950
// llvm codegen options
@@ -126,6 +127,7 @@ struct Build {
126127
docs: Option<bool>,
127128
submodules: Option<bool>,
128129
gdb: Option<String>,
130+
vendor: Option<bool>,
129131
}
130132

131133
/// TOML representation of how the LLVM build is configured.
@@ -234,6 +236,7 @@ impl Config {
234236
set(&mut config.compiler_docs, build.compiler_docs);
235237
set(&mut config.docs, build.docs);
236238
set(&mut config.submodules, build.submodules);
239+
set(&mut config.vendor, build.vendor);
237240

238241
if let Some(ref llvm) = toml.llvm {
239242
set(&mut config.ccache, llvm.ccache);
@@ -347,6 +350,7 @@ impl Config {
347350
("LOCAL_REBUILD", self.local_rebuild),
348351
("NINJA", self.ninja),
349352
("CODEGEN_TESTS", self.codegen_tests),
353+
("VENDOR", self.vendor),
350354
}
351355

352356
match key {

src/bootstrap/config.toml.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,9 @@
8282
# The path to (or name of) the GDB executable to use
8383
#gdb = "gdb"
8484

85+
# Indicate whether the vendored sources are used for Rust dependencies or not
86+
#vendor = false
87+
8588
# =============================================================================
8689
# Options for compiling Rust code itself
8790
# =============================================================================

0 commit comments

Comments
 (0)