Skip to content

Commit 2b93925

Browse files
committed
auto merge of #11706 : alexcrichton/rust/issue-11253, r=huonw
Closes #11253
2 parents 2ba72fa + 8a1b4dc commit 2b93925

File tree

6 files changed

+16
-11
lines changed

6 files changed

+16
-11
lines changed

src/compiletest/runtest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -700,7 +700,7 @@ fn compose_and_run_compiler(
700700
let abs_ab = config.aux_base.join(rel_ab.as_slice());
701701
let aux_props = load_props(&abs_ab);
702702
let aux_args =
703-
make_compile_args(config, &aux_props, ~[~"--lib"] + extra_link_args,
703+
make_compile_args(config, &aux_props, ~[~"--dylib"] + extra_link_args,
704704
|a,b| make_lib_name(a, b, testfile), &abs_ab);
705705
let auxres = compose_and_run(config, &abs_ab, aux_args, ~[],
706706
config.compile_lib_path, None);

src/librustc/driver/driver.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,14 +716,16 @@ pub fn build_session_options(binary: ~str,
716716
demitter: @diagnostic::Emitter)
717717
-> @session::Options {
718718
let mut outputs = ~[];
719+
if matches.opt_present("lib") {
720+
outputs.push(session::default_lib_output());
721+
}
719722
if matches.opt_present("rlib") {
720723
outputs.push(session::OutputRlib)
721724
}
722725
if matches.opt_present("staticlib") {
723726
outputs.push(session::OutputStaticlib)
724727
}
725-
// dynamic libraries are the "compiler blesssed" default library
726-
if matches.opt_present("dylib") || matches.opt_present("lib") {
728+
if matches.opt_present("dylib") {
727729
outputs.push(session::OutputDylib)
728730
}
729731
if matches.opt_present("bin") {

src/librustc/driver/session.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,6 +422,10 @@ pub fn building_library(options: &Options, crate: &ast::Crate) -> bool {
422422
}
423423
}
424424

425+
pub fn default_lib_output() -> OutputStyle {
426+
OutputRlib
427+
}
428+
425429
pub fn collect_outputs(session: &Session,
426430
attrs: &[ast::Attribute]) -> ~[OutputStyle] {
427431
// If we're generating a test executable, then ignore all other output
@@ -435,7 +439,7 @@ pub fn collect_outputs(session: &Session,
435439
match a.value_str() {
436440
Some(n) if "rlib" == n => Some(OutputRlib),
437441
Some(n) if "dylib" == n => Some(OutputDylib),
438-
Some(n) if "lib" == n => Some(OutputDylib),
442+
Some(n) if "lib" == n => Some(default_lib_output()),
439443
Some(n) if "staticlib" == n => Some(OutputStaticlib),
440444
Some(n) if "bin" == n => Some(OutputExecutable),
441445
Some(_) => {

src/librustpkg/tests.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -353,7 +353,7 @@ fn lib_exists(repo: &Path, crate_id: &CrateId) -> bool {
353353
debug!("assert_lib_exists: checking whether {:?} exists", lib);
354354
lib.is_some() && {
355355
let libname = lib.get_ref();
356-
libname.exists() && is_rwx(libname)
356+
libname.exists()
357357
}
358358
}
359359

@@ -437,7 +437,7 @@ fn built_library_exists(repo: &Path, short_name: &str) -> bool {
437437
let lib = built_library_in_workspace(&crate_id, repo);
438438
lib.is_some() && {
439439
let libname = lib.get_ref();
440-
libname.exists() && is_rwx(libname)
440+
libname.exists()
441441
}
442442
}
443443

@@ -634,7 +634,6 @@ fn test_install_valid_external() {
634634
let lib = installed_library_in_workspace(&temp_pkg_id, temp_workspace);
635635
debug!("lib = {:?}", lib);
636636
assert!(lib.as_ref().map_or(false, |l| l.exists()));
637-
assert!(lib.as_ref().map_or(false, |l| is_rwx(l)));
638637

639638
// And that the test and bench executables aren't installed
640639
assert!(!target_test_in_workspace(&temp_pkg_id, temp_workspace).exists());
@@ -758,7 +757,8 @@ fn test_package_request_version() {
758757
Some(p) => {
759758
debug!("installed: {}", p.display());
760759
let suffix = format!("0.3{}", os::consts::DLL_SUFFIX);
761-
p.as_vec().ends_with(suffix.as_bytes())
760+
p.as_vec().ends_with(suffix.as_bytes()) ||
761+
p.as_vec().ends_with(bytes!("0.3.rlib"))
762762
}
763763
None => false
764764
});
@@ -2160,7 +2160,6 @@ fn test_installed_read_only() {
21602160
built_library_in_workspace(&temp_pkg_id,
21612161
&ws).expect("test_install_git: built lib should exist");
21622162
assert!(built_lib.exists());
2163-
assert!(is_rwx(&built_lib));
21642163
21652164
// Make sure sources are (a) under "build" and (b) read-only
21662165
let temp_dir = format!("{}-{}", temp_pkg_id.path, temp_pkg_id.version_or_default());

src/test/run-make/bootstrap-from-c-with-green/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
#[crate_id="boot#0.1"];
12-
#[crate_type="lib"];
12+
#[crate_type="dylib"];
1313
#[no_uv];
1414

1515
extern mod rustuv;

src/test/run-make/bootstrap-from-c-with-native/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
// except according to those terms.
1010

1111
#[crate_id="boot#0.1"];
12-
#[crate_type="lib"];
12+
#[crate_type="dylib"];
1313
#[no_uv];
1414

1515
extern mod native;

0 commit comments

Comments
 (0)