Skip to content

Commit dc868cd

Browse files
committed
---
yaml --- r: 145051 b: refs/heads/try2 c: 2aa578e h: refs/heads/master i: 145049: e3cf3d4 145047: c85e1c8 v: v3
1 parent b94419e commit dc868cd

31 files changed

+866
-683
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ refs/heads/snap-stage3: 78a7676898d9f80ab540c6df5d4c9ce35bb50463
55
refs/heads/try: 519addf6277dbafccbb4159db4b710c37eaa2ec5
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
8-
refs/heads/try2: 93683ae6da3a47f1cd0644a093cb4b1b0bee7faa
8+
refs/heads/try2: 2aa578efd9834e37ad52879ff10ee2c2aa938389
99
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
1010
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
1111
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try2/doc/rustpkg.md

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,11 @@ A valid workspace must contain each of the following subdirectories:
5252
rustpkg will install libraries for bar to `foo/lib/x86_64-apple-darwin/`.
5353
The libraries will have names of the form `foo/lib/x86_64-apple-darwin/libbar-[hash].dylib`,
5454
where [hash] is a hash of the package ID.
55-
* 'bin/': `rustpkg install` installs executable binaries into a target-specific subdirectory of this directory.
55+
* 'bin/': `rustpkg install` installs executable binaries into this directory.
5656

57-
For example, on a 64-bit machine running Mac OS X,
58-
if `foo` is a workspace, containing the package `bar`,
59-
rustpkg will install executables for `bar` to
60-
`foo/bin/x86_64-apple-darwin/`.
61-
The executables will have names of the form `foo/bin/x86_64-apple-darwin/bar`.
57+
For example, rustpkg will install executables for `bar` to
58+
`foo/bin`.
59+
The executables will have names of the form `foo/bin/bar`.
6260
* 'build/': `rustpkg build` stores temporary build artifacts in a target-specific subdirectory of this directory.
6361

6462
For example, on a 64-bit machine running Mac OS X,
@@ -85,6 +83,12 @@ rustpkg also interprets any dependencies on such a package ID literally
8583
Thus, `github.com/mozilla/rust#5c4cd30f80` is also a valid package ID,
8684
since git can deduce that 5c4cd30f80 refers to a revision of the desired repository.
8785

86+
A package identifier can name a subdirectory of another package.
87+
For example, if `foo` is a workspace, and `foo/src/bar/lib.rs` exists,
88+
as well as `foo/src/bar/extras/baz/lib.rs`,
89+
then both `bar` and `bar/extras/baz` are valid package identifiers
90+
in the workspace `foo`.
91+
8892
## Source files
8993

9094
rustpkg searches for four different fixed filenames in order to determine the crates to build:
@@ -140,9 +144,11 @@ but not in their `lib` or `bin` directories.
140144

141145
## install
142146

143-
`rustpkg install foo` builds the libraries and/or executables that are targets for `foo`,
144-
and then installs them either into `foo`'s `lib` and `bin` directories,
145-
or into the `lib` and `bin` subdirectories of the first entry in `RUST_PATH`.
147+
`rustpkg install foo` builds the libraries and/or executables that are targets for `foo`.
148+
If `RUST_PATH` is declared as an environment variable, then rustpkg installs the
149+
libraries and executables into the `lib` and `bin` subdirectories
150+
of the first entry in `RUST_PATH`.
151+
Otherwise, it installs them into `foo`'s `lib` and `bin` directories.
146152

147153
## test
148154

branches/try2/mk/rt.mk

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ RUNTIME_CXXS_$(1)_$(2) := \
7575
rt/rust_rng.cpp \
7676
rt/rust_upcall.cpp \
7777
rt/rust_uv.cpp \
78-
rt/rust_crate_map.cpp \
7978
rt/isaac/randport.cpp \
8079
rt/miniz.cpp \
8180
rt/memory_region.cpp \

branches/try2/src/libextra/fileinput.rs

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -417,20 +417,23 @@ mod test {
417417

418418
use super::{FileInput, make_path_option_vec, input_vec, input_vec_state};
419419

420-
use std::io;
420+
use std::rt::io;
421+
use std::rt::io::Writer;
422+
use std::rt::io::file;
421423
use std::uint;
422424
use std::vec;
423425

424426
fn make_file(path : &Path, contents: &[~str]) {
425-
let file = io::file_writer(path, [io::Create, io::Truncate]).unwrap();
427+
let mut file = file::open(path, io::CreateOrTruncate, io::Write).unwrap();
426428

427429
for str in contents.iter() {
428-
file.write_str(*str);
429-
file.write_char('\n');
430+
file.write(str.as_bytes());
431+
file.write(['\n' as u8]);
430432
}
431433
}
432434

433435
#[test]
436+
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
434437
fn test_make_path_option_vec() {
435438
let strs = [~"some/path",
436439
~"some/other/path"];
@@ -445,6 +448,7 @@ mod test {
445448
}
446449
447450
#[test]
451+
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
448452
fn test_fileinput_read_byte() {
449453
let filenames = make_path_option_vec(vec::from_fn(
450454
3,
@@ -475,6 +479,7 @@ mod test {
475479
}
476480
477481
#[test]
482+
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
478483
fn test_fileinput_read() {
479484
let filenames = make_path_option_vec(vec::from_fn(
480485
3,
@@ -495,6 +500,7 @@ mod test {
495500
}
496501

497502
#[test]
503+
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
498504
fn test_input_vec() {
499505
let mut all_lines = ~[];
500506
let filenames = make_path_option_vec(vec::from_fn(
@@ -518,6 +524,7 @@ mod test {
518524
}
519525

520526
#[test]
527+
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
521528
fn test_input_vec_state() {
522529
let filenames = make_path_option_vec(vec::from_fn(
523530
3,
@@ -540,6 +547,7 @@ mod test {
540547
}
541548

542549
#[test]
550+
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
543551
fn test_empty_files() {
544552
let filenames = make_path_option_vec(vec::from_fn(
545553
3,
@@ -564,18 +572,21 @@ mod test {
564572
}
565573
566574
#[test]
575+
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
567576
fn test_no_trailing_newline() {
568577
let f1 =
569578
Some(Path("tmp/lib-fileinput-test-no-trailing-newline-1.tmp"));
570579
let f2 =
571580
Some(Path("tmp/lib-fileinput-test-no-trailing-newline-2.tmp"));
572581
573-
let wr = io::file_writer(f1.get_ref(),
574-
[io::Create, io::Truncate]).unwrap();
575-
wr.write_str("1\n2");
576-
let wr = io::file_writer(f2.get_ref(),
577-
[io::Create, io::Truncate]).unwrap();
578-
wr.write_str("3\n4");
582+
{
583+
let mut wr = file::open(f1.get_ref(), io::CreateOrTruncate,
584+
io::Write).unwrap();
585+
wr.write("1\n2".as_bytes());
586+
let mut wr = file::open(f2.get_ref(), io::CreateOrTruncate,
587+
io::Write).unwrap();
588+
wr.write("3\n4".as_bytes());
589+
}
579590
580591
let mut lines = ~[];
581592
do input_vec(~[f1, f2]) |line| {
@@ -587,6 +598,7 @@ mod test {
587598
588599
589600
#[test]
601+
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
590602
fn test_next_file() {
591603
let filenames = make_path_option_vec(vec::from_fn(
592604
3,
@@ -618,6 +630,7 @@ mod test {
618630
619631
#[test]
620632
#[should_fail]
633+
#[ignore(cfg(windows))] // FIXME(#8810): rt::io::file and windows don't agree
621634
fn test_input_vec_missing_file() {
622635
do input_vec(make_path_option_vec([~"this/file/doesnt/exist"], true)) |line| {
623636
println(line);

branches/try2/src/libextra/glob.rs

Lines changed: 0 additions & 188 deletions
Original file line numberDiff line numberDiff line change
@@ -556,194 +556,6 @@ mod test {
556556
use super::*;
557557
use tempfile;
558558
559-
#[test]
560-
fn test_relative_pattern() {
561-
562-
fn change_then_remove(p: &Path, f: &fn()) {
563-
do (|| {
564-
unstable::change_dir_locked(p, || f());
565-
}).finally {
566-
os::remove_dir_recursive(p);
567-
}
568-
}
569-
570-
fn mk_file(path: &str, directory: bool) {
571-
if directory {
572-
os::make_dir(&Path(path), 0xFFFF);
573-
} else {
574-
io::mk_file_writer(&Path(path), [io::Create]);
575-
}
576-
}
577-
578-
fn abs_path(path: &str) -> Path {
579-
os::getcwd().push_many(Path(path).components)
580-
}
581-
582-
fn glob_vec(pattern: &str) -> ~[Path] {
583-
glob(pattern).collect()
584-
}
585-
586-
let root = tempfile::mkdtemp(&os::tmpdir(), "glob-tests");
587-
let root = root.expect("Should have created a temp directory");
588-
589-
do change_then_remove(&root) {
590-
591-
mk_file("aaa", true);
592-
mk_file("aaa/apple", true);
593-
mk_file("aaa/orange", true);
594-
mk_file("aaa/tomato", true);
595-
mk_file("aaa/tomato/tomato.txt", false);
596-
mk_file("aaa/tomato/tomoto.txt", false);
597-
mk_file("bbb", true);
598-
mk_file("bbb/specials", true);
599-
mk_file("bbb/specials/!", false);
600-
601-
// windows does not allow `*` or `?` characters to exist in filenames
602-
if os::consts::FAMILY != os::consts::windows::FAMILY {
603-
mk_file("bbb/specials/*", false);
604-
mk_file("bbb/specials/?", false);
605-
}
606-
607-
mk_file("bbb/specials/[", false);
608-
mk_file("bbb/specials/]", false);
609-
mk_file("ccc", true);
610-
mk_file("xyz", true);
611-
mk_file("xyz/x", false);
612-
mk_file("xyz/y", false);
613-
mk_file("xyz/z", false);
614-
615-
assert_eq!(glob_vec(""), ~[]);
616-
assert_eq!(glob_vec("."), ~[]);
617-
assert_eq!(glob_vec(".."), ~[]);
618-
619-
assert_eq!(glob_vec("aaa"), ~[abs_path("aaa")]);
620-
assert_eq!(glob_vec("aaa/"), ~[abs_path("aaa")]);
621-
assert_eq!(glob_vec("a"), ~[]);
622-
assert_eq!(glob_vec("aa"), ~[]);
623-
assert_eq!(glob_vec("aaaa"), ~[]);
624-
625-
assert_eq!(glob_vec("aaa/apple"), ~[abs_path("aaa/apple")]);
626-
assert_eq!(glob_vec("aaa/apple/nope"), ~[]);
627-
628-
// windows should support both / and \ as directory separators
629-
if os::consts::FAMILY == os::consts::windows::FAMILY {
630-
assert_eq!(glob_vec("aaa\\apple"), ~[abs_path("aaa/apple")]);
631-
}
632-
633-
assert_eq!(glob_vec("???/"), ~[
634-
abs_path("aaa"),
635-
abs_path("bbb"),
636-
abs_path("ccc"),
637-
abs_path("xyz")]);
638-
639-
assert_eq!(glob_vec("aaa/tomato/tom?to.txt"), ~[
640-
abs_path("aaa/tomato/tomato.txt"),
641-
abs_path("aaa/tomato/tomoto.txt")]);
642-
643-
assert_eq!(glob_vec("xyz/?"), ~[
644-
abs_path("xyz/x"),
645-
abs_path("xyz/y"),
646-
abs_path("xyz/z")]);
647-
648-
assert_eq!(glob_vec("a*"), ~[abs_path("aaa")]);
649-
assert_eq!(glob_vec("*a*"), ~[abs_path("aaa")]);
650-
assert_eq!(glob_vec("a*a"), ~[abs_path("aaa")]);
651-
assert_eq!(glob_vec("aaa*"), ~[abs_path("aaa")]);
652-
assert_eq!(glob_vec("*aaa"), ~[abs_path("aaa")]);
653-
assert_eq!(glob_vec("*aaa*"), ~[abs_path("aaa")]);
654-
assert_eq!(glob_vec("*a*a*a*"), ~[abs_path("aaa")]);
655-
assert_eq!(glob_vec("aaa*/"), ~[abs_path("aaa")]);
656-
657-
assert_eq!(glob_vec("aaa/*"), ~[
658-
abs_path("aaa/apple"),
659-
abs_path("aaa/orange"),
660-
abs_path("aaa/tomato")]);
661-
662-
assert_eq!(glob_vec("aaa/*a*"), ~[
663-
abs_path("aaa/apple"),
664-
abs_path("aaa/orange"),
665-
abs_path("aaa/tomato")]);
666-
667-
assert_eq!(glob_vec("*/*/*.txt"), ~[
668-
abs_path("aaa/tomato/tomato.txt"),
669-
abs_path("aaa/tomato/tomoto.txt")]);
670-
671-
assert_eq!(glob_vec("*/*/t[aob]m?to[.]t[!y]t"), ~[
672-
abs_path("aaa/tomato/tomato.txt"),
673-
abs_path("aaa/tomato/tomoto.txt")]);
674-
675-
assert_eq!(glob_vec("aa[a]"), ~[abs_path("aaa")]);
676-
assert_eq!(glob_vec("aa[abc]"), ~[abs_path("aaa")]);
677-
assert_eq!(glob_vec("a[bca]a"), ~[abs_path("aaa")]);
678-
assert_eq!(glob_vec("aa[b]"), ~[]);
679-
assert_eq!(glob_vec("aa[xyz]"), ~[]);
680-
assert_eq!(glob_vec("aa[]]"), ~[]);
681-
682-
assert_eq!(glob_vec("aa[!b]"), ~[abs_path("aaa")]);
683-
assert_eq!(glob_vec("aa[!bcd]"), ~[abs_path("aaa")]);
684-
assert_eq!(glob_vec("a[!bcd]a"), ~[abs_path("aaa")]);
685-
assert_eq!(glob_vec("aa[!a]"), ~[]);
686-
assert_eq!(glob_vec("aa[!abc]"), ~[]);
687-
688-
assert_eq!(glob_vec("bbb/specials/[[]"), ~[abs_path("bbb/specials/[")]);
689-
assert_eq!(glob_vec("bbb/specials/!"), ~[abs_path("bbb/specials/!")]);
690-
assert_eq!(glob_vec("bbb/specials/[]]"), ~[abs_path("bbb/specials/]")]);
691-
692-
if os::consts::FAMILY != os::consts::windows::FAMILY {
693-
assert_eq!(glob_vec("bbb/specials/[*]"), ~[abs_path("bbb/specials/*")]);
694-
assert_eq!(glob_vec("bbb/specials/[?]"), ~[abs_path("bbb/specials/?")]);
695-
}
696-
697-
if os::consts::FAMILY == os::consts::windows::FAMILY {
698-
699-
assert_eq!(glob_vec("bbb/specials/[![]"), ~[
700-
abs_path("bbb/specials/!"),
701-
abs_path("bbb/specials/]")]);
702-
703-
assert_eq!(glob_vec("bbb/specials/[!]]"), ~[
704-
abs_path("bbb/specials/!"),
705-
abs_path("bbb/specials/[")]);
706-
707-
assert_eq!(glob_vec("bbb/specials/[!!]"), ~[
708-
abs_path("bbb/specials/["),
709-
abs_path("bbb/specials/]")]);
710-
711-
} else {
712-
713-
assert_eq!(glob_vec("bbb/specials/[![]"), ~[
714-
abs_path("bbb/specials/!"),
715-
abs_path("bbb/specials/*"),
716-
abs_path("bbb/specials/?"),
717-
abs_path("bbb/specials/]")]);
718-
719-
assert_eq!(glob_vec("bbb/specials/[!]]"), ~[
720-
abs_path("bbb/specials/!"),
721-
abs_path("bbb/specials/*"),
722-
abs_path("bbb/specials/?"),
723-
abs_path("bbb/specials/[")]);
724-
725-
assert_eq!(glob_vec("bbb/specials/[!!]"), ~[
726-
abs_path("bbb/specials/*"),
727-
abs_path("bbb/specials/?"),
728-
abs_path("bbb/specials/["),
729-
abs_path("bbb/specials/]")]);
730-
731-
assert_eq!(glob_vec("bbb/specials/[!*]"), ~[
732-
abs_path("bbb/specials/!"),
733-
abs_path("bbb/specials/?"),
734-
abs_path("bbb/specials/["),
735-
abs_path("bbb/specials/]")]);
736-
737-
assert_eq!(glob_vec("bbb/specials/[!?]"), ~[
738-
abs_path("bbb/specials/!"),
739-
abs_path("bbb/specials/*"),
740-
abs_path("bbb/specials/["),
741-
abs_path("bbb/specials/]")]);
742-
743-
}
744-
};
745-
}
746-
747559
#[test]
748560
fn test_absolute_pattern() {
749561
// assume that the filesystem is not empty!

0 commit comments

Comments
 (0)