Skip to content

Commit ef9a876

Browse files
committed
Auto merge of #60423 - varkor:update-getopts, r=alexcrichton
Update getopts This is a prerequisite to fixing #32352. The rustbuild fix has been pulled out of #59440. r? @alexcrichton
2 parents 1891bfa + e72f7e1 commit ef9a876

File tree

4 files changed

+35
-16
lines changed

4 files changed

+35
-16
lines changed

Cargo.lock

+13-10
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ dependencies = [
169169
"cc 1.0.35 (registry+https://github.com/rust-lang/crates.io-index)",
170170
"cmake 0.1.38 (registry+https://github.com/rust-lang/crates.io-index)",
171171
"filetime 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
172-
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
172+
"getopts 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
173173
"lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
174174
"libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)",
175175
"num_cpus 1.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -463,7 +463,7 @@ dependencies = [
463463
"diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
464464
"env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)",
465465
"filetime 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
466-
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
466+
"getopts 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
467467
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
468468
"libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)",
469469
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -484,7 +484,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
484484
dependencies = [
485485
"diff 0.1.11 (registry+https://github.com/rust-lang/crates.io-index)",
486486
"filetime 0.2.4 (registry+https://github.com/rust-lang/crates.io-index)",
487-
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
487+
"getopts 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
488488
"libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)",
489489
"log 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
490490
"miow 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -974,8 +974,11 @@ dependencies = [
974974

975975
[[package]]
976976
name = "getopts"
977-
version = "0.2.17"
977+
version = "0.2.18"
978978
source = "registry+https://github.com/rust-lang/crates.io-index"
979+
dependencies = [
980+
"unicode-width 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
981+
]
979982

980983
[[package]]
981984
name = "git2"
@@ -1986,7 +1989,7 @@ version = "0.1.2"
19861989
source = "registry+https://github.com/rust-lang/crates.io-index"
19871990
dependencies = [
19881991
"bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)",
1989-
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
1992+
"getopts 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
19901993
]
19911994

19921995
[[package]]
@@ -2005,7 +2008,7 @@ version = "0.5.0"
20052008
source = "registry+https://github.com/rust-lang/crates.io-index"
20062009
dependencies = [
20072010
"bitflags 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
2008-
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
2011+
"getopts 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
20092012
"memchr 2.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
20102013
"unicase 2.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
20112014
]
@@ -3091,7 +3094,7 @@ dependencies = [
30913094
"dirs 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)",
30923095
"env_logger 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)",
30933096
"failure 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
3094-
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
3097+
"getopts 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
30953098
"ignore 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
30963099
"itertools 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)",
30973100
"lazy_static 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -3518,7 +3521,7 @@ dependencies = [
35183521
name = "test"
35193522
version = "0.0.0"
35203523
dependencies = [
3521-
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
3524+
"getopts 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
35223525
"proc_macro 0.0.0",
35233526
"term 0.0.0",
35243527
]
@@ -3528,7 +3531,7 @@ name = "tester"
35283531
version = "0.5.0"
35293532
source = "registry+https://github.com/rust-lang/crates.io-index"
35303533
dependencies = [
3531-
"getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)",
3534+
"getopts 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)",
35323535
"libc 0.2.51 (registry+https://github.com/rust-lang/crates.io-index)",
35333536
"term 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
35343537
]
@@ -4127,7 +4130,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
41274130
"checksum futures 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "1a70b146671de62ec8c8ed572219ca5d594d9b06c0b364d5e67b722fc559b48c"
41284131
"checksum fwdansi 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "34dd4c507af68d37ffef962063dfa1944ce0dd4d5b82043dbab1dabe088610c3"
41294132
"checksum generic-array 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ef25c5683767570c2bbd7deba372926a55eaae9982d7726ee2a1050239d45b9d"
4130-
"checksum getopts 0.2.17 (registry+https://github.com/rust-lang/crates.io-index)" = "b900c08c1939860ce8b54dc6a89e26e00c04c380fd0e09796799bd7f12861e05"
4133+
"checksum getopts 0.2.18 (registry+https://github.com/rust-lang/crates.io-index)" = "0a7292d30132fb5424b354f5dc02512a86e4c516fe544bb7a25e7f266951b797"
41314134
"checksum git2 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c7339329bfa14a00223244311560d11f8f489b453fb90092af97f267a6090ab0"
41324135
"checksum git2-curl 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d58551e903ed7e2d6fe3a2f3c7efa3a784ec29b19d0fbb035aaf0497c183fbdd"
41334136
"checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574"

src/bootstrap/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ build_helper = { path = "../build_helper" }
3939
cmake = "0.1.38"
4040
filetime = "0.2"
4141
num_cpus = "1.0"
42-
getopts = "0.2"
42+
getopts = "0.2.18"
4343
cc = "1.0.35"
4444
libc = "0.2"
4545
serde = "1.0.8"

src/bootstrap/builder.rs

+20-4
Original file line numberDiff line numberDiff line change
@@ -853,14 +853,30 @@ impl<'a> Builder<'a> {
853853

854854
// FIXME: Temporary fix for https://github.com/rust-lang/cargo/issues/3005
855855
// Force cargo to output binaries with disambiguating hashes in the name
856-
let metadata = if compiler.stage == 0 {
857-
// Treat stage0 like special channel, whether it's a normal prior-
856+
let mut metadata = if compiler.stage == 0 {
857+
// Treat stage0 like a special channel, whether it's a normal prior-
858858
// release rustc or a local rebuild with the same version, so we
859859
// never mix these libraries by accident.
860-
"bootstrap"
860+
"bootstrap".to_string()
861861
} else {
862-
&self.config.channel
862+
self.config.channel.to_string()
863863
};
864+
// We want to make sure that none of the dependencies between
865+
// std/test/rustc unify with one another. This is done for weird linkage
866+
// reasons but the gist of the problem is that if librustc, libtest, and
867+
// libstd all depend on libc from crates.io (which they actually do) we
868+
// want to make sure they all get distinct versions. Things get really
869+
// weird if we try to unify all these dependencies right now, namely
870+
// around how many times the library is linked in dynamic libraries and
871+
// such. If rustc were a static executable or if we didn't ship dylibs
872+
// this wouldn't be a problem, but we do, so it is. This is in general
873+
// just here to make sure things build right. If you can remove this and
874+
// things still build right, please do!
875+
match mode {
876+
Mode::Std => metadata.push_str("std"),
877+
Mode::Test => metadata.push_str("test"),
878+
_ => {},
879+
}
864880
cargo.env("__CARGO_DEFAULT_LIB_METADATA", &metadata);
865881

866882
let stage;

src/libtest/Cargo.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ path = "lib.rs"
1010
crate-type = ["dylib", "rlib"]
1111

1212
[dependencies]
13-
getopts = "0.2"
13+
getopts = "0.2.18"
1414
term = { path = "../libterm" }
1515

1616
# not actually used but needed to always have proc_macro in the sysroot

0 commit comments

Comments
 (0)