Skip to content

Commit 7727dbc

Browse files
committed
---
yaml --- r: 81889 b: refs/heads/master c: 252c6db h: refs/heads/master i: 81887: 58d2b2e v: v3
1 parent 3937545 commit 7727dbc

File tree

19 files changed

+284
-329
lines changed

19 files changed

+284
-329
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: eb2b25dd6d38157213742b048fad63fa4ceec691
2+
refs/heads/master: 252c6dbe857c3440c889928b451790a52106f5c6
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 6c08cc2db4f98e9f07ae7d50338396c4123c2f0a
55
refs/heads/try: 70152ff55722878cde684ee6462c14c65f2c4729

trunk/configure

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,8 +848,6 @@ do
848848
# Disable term-info, linkage of which comes in multiple forms,
849849
# making our snapshots incompatible (#9334)
850850
LLVM_OPTS="$LLVM_OPTS --disable-terminfo"
851-
# Try to have LLVM pull in as few dependencies as possible (#9397)
852-
LLVM_OPTS="$LLVM_OPTS --disable-zlib --disable-libffi"
853851

854852
case "$CFG_C_COMPILER" in
855853
("ccache clang")

trunk/src/libextra/crypto/md5.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,7 @@ static C4: [u32, ..16] = [
156156

157157

158158
/// The MD5 Digest algorithm
159-
struct Md5 {
159+
pub struct Md5 {
160160
priv length_bytes: u64,
161161
priv buffer: FixedBuffer64,
162162
priv state: Md5State,

trunk/src/libextra/crypto/sha2.rs

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,8 @@ impl Engine512 {
230230
}
231231

232232

233-
struct Sha512 {
233+
/// The SHA-512 hash algorithm
234+
pub struct Sha512 {
234235
priv engine: Engine512
235236
}
236237

@@ -282,7 +283,8 @@ static H512: [u64, ..8] = [
282283
];
283284

284285

285-
struct Sha384 {
286+
/// The SHA-384 hash algorithm
287+
pub struct Sha384 {
286288
priv engine: Engine512
287289
}
288290

@@ -332,7 +334,8 @@ static H384: [u64, ..8] = [
332334
];
333335

334336

335-
struct Sha512Trunc256 {
337+
/// The SHA-512 hash algorithm with digest truncated to 256 bits
338+
pub struct Sha512Trunc256 {
336339
priv engine: Engine512
337340
}
338341

@@ -380,7 +383,8 @@ static H512_TRUNC_256: [u64, ..8] = [
380383
];
381384

382385

383-
struct Sha512Trunc224 {
386+
/// The SHA-512 hash algorithm with digest truncated to 224 bits
387+
pub struct Sha512Trunc224 {
384388
priv engine: Engine512
385389
}
386390

@@ -635,7 +639,8 @@ impl Engine256 {
635639
}
636640

637641

638-
struct Sha256 {
642+
/// The SHA-256 hash algorithm
643+
pub struct Sha256 {
639644
priv engine: Engine256
640645
}
641646

@@ -687,7 +692,8 @@ static H256: [u32, ..8] = [
687692
];
688693

689694

690-
struct Sha224 {
695+
/// The SHA-224 hash algorithm
696+
pub struct Sha224 {
691697
priv engine: Engine256
692698
}
693699

trunk/src/librustpkg/package_source.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@ impl PkgSrc {
5959
use conditions::nonexistent_package::cond;
6060

6161
debug!("Checking package source for package ID %s, \
62-
workspace = %s use_rust_path_hack = %?",
63-
id.to_str(), workspace.to_str(), use_rust_path_hack);
62+
workspace = %s", id.to_str(), workspace.to_str());
6463

6564
let mut to_try = ~[];
6665
if use_rust_path_hack {

trunk/src/librustpkg/path_util.rs

Lines changed: 5 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -421,16 +421,11 @@ fn dir_has_file(dir: &Path, file: &str) -> bool {
421421
pub fn find_dir_using_rust_path_hack(p: &PkgId) -> Option<Path> {
422422
let rp = rust_path();
423423
for dir in rp.iter() {
424-
// Require that the parent directory match the package ID
425-
// Note that this only matches if the package ID being searched for
426-
// has a name that's a single component
427-
if dir.is_parent_of(&p.path) || dir.is_parent_of(&versionize(&p.path, &p.version)) {
428-
debug!("In find_dir_using_rust_path_hack: checking dir %s", dir.to_str());
429-
if dir_has_file(dir, "lib.rs") || dir_has_file(dir, "main.rs")
430-
|| dir_has_file(dir, "test.rs") || dir_has_file(dir, "bench.rs") {
431-
debug!("Did find id %s in dir %s", p.to_str(), dir.to_str());
432-
return Some(dir.clone());
433-
}
424+
debug!("In find_dir_using_rust_path_hack: checking dir %s", dir.to_str());
425+
if dir_has_file(dir, "lib.rs") || dir_has_file(dir, "main.rs")
426+
|| dir_has_file(dir, "test.rs") || dir_has_file(dir, "bench.rs") {
427+
debug!("Did find id %s in dir %s", p.to_str(), dir.to_str());
428+
return Some(dir.clone());
434429
}
435430
debug!("Didn't find id %s in dir %s", p.to_str(), dir.to_str())
436431
}
@@ -445,11 +440,3 @@ pub fn user_set_rust_path() -> bool {
445440
Some(_) => true
446441
}
447442
}
448-
449-
/// Append the version string onto the end of the path's filename
450-
fn versionize(p: &Path, v: &Version) -> Path {
451-
let q = p.file_path().to_str();
452-
p.with_filename(fmt!("%s-%s", q, v.to_str()))
453-
}
454-
455-

trunk/src/librustpkg/tests.rs

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1267,9 +1267,7 @@ fn test_rust_path_can_contain_package_dirs_without_flag() {
12671267
#[test]
12681268
fn rust_path_hack_cwd() {
12691269
// Same as rust_path_hack_test, but the CWD is the dir to build out of
1270-
let cwd = mkdtemp(&os::tmpdir(), "foo").expect("rust_path_hack_cwd");
1271-
let cwd = cwd.push("foo");
1272-
assert!(os::mkdir_recursive(&cwd, U_RWX));
1270+
let cwd = mkdtemp(&os::tmpdir(), "pkg_files").expect("rust_path_hack_cwd");
12731271
writeFile(&cwd.push("lib.rs"), "pub fn f() { }");
12741272

12751273
let dest_workspace = mk_empty_workspace(&Path("bar"), &NoVersion, "dest_workspace");
@@ -1765,41 +1763,6 @@ fn reinstall() {
17651763
assert_built_executable_exists(&workspace, b.short_name);
17661764
}
17671765
1768-
#[test]
1769-
fn correct_package_name_with_rust_path_hack() {
1770-
/*
1771-
Set rust_path_hack flag
1772-
1773-
Try to install bar
1774-
Check that:
1775-
- no output gets produced in any workspace
1776-
- there's an error
1777-
*/
1778-
1779-
// Set RUST_PATH to something containing only the sources for foo
1780-
let foo_id = PkgId::new("foo");
1781-
let bar_id = PkgId::new("bar");
1782-
let foo_workspace = create_local_package(&foo_id);
1783-
let dest_workspace = mk_empty_workspace(&Path("bar"), &NoVersion, "dest_workspace");
1784-
1785-
writeFile(&dest_workspace.push_many(["src", "bar-0.1", "main.rs"]),
1786-
"extern mod blat; fn main() { let _x = (); }");
1787-
1788-
let rust_path = Some(~[(~"RUST_PATH", fmt!("%s:%s", dest_workspace.to_str(),
1789-
foo_workspace.push_many(["src", "foo-0.1"]).to_str()))]);
1790-
// bar doesn't exist, but we want to make sure rustpkg doesn't think foo is bar
1791-
command_line_test_with_env([~"install", ~"--rust-path-hack", ~"bar"],
1792-
&dest_workspace, rust_path);
1793-
assert!(!executable_exists(&dest_workspace, "bar"));
1794-
assert!(!lib_exists(&dest_workspace, &bar_id.path.clone(), bar_id.version.clone()));
1795-
assert!(!executable_exists(&dest_workspace, "foo"));
1796-
assert!(!lib_exists(&dest_workspace, &foo_id.path.clone(), foo_id.version.clone()));
1797-
assert!(!executable_exists(&foo_workspace, "bar"));
1798-
assert!(!lib_exists(&foo_workspace, &bar_id.path.clone(), bar_id.version.clone()));
1799-
assert!(!executable_exists(&foo_workspace, "foo"));
1800-
assert!(!lib_exists(&foo_workspace, &foo_id.path.clone(), foo_id.version.clone()));
1801-
}
1802-
18031766
/// Returns true if p exists and is executable
18041767
fn is_executable(p: &Path) -> bool {
18051768
use std::libc::consts::os::posix88::{S_IXUSR};

trunk/src/librustpkg/util.rs

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -439,30 +439,26 @@ impl<'self> Visitor<()> for ViewItemVisitor<'self> {
439439
let pkg_id = PkgId::new(lib_name);
440440
let workspaces = pkg_parent_workspaces(&self.context.context,
441441
&pkg_id);
442-
let source_workspace = if workspaces.is_empty() {
443-
error(fmt!("Couldn't find package %s \
444-
in any of the workspaces in the RUST_PATH (%s)",
445-
lib_name,
446-
rust_path().map(|s| s.to_str()).connect(":")));
442+
let dep_workspace = if workspaces.is_empty() {
443+
error(fmt!("Couldn't find package %s, which is needed by %s, \
444+
in any of the workspaces in the RUST_PATH (%?)",
445+
lib_name,
446+
self.parent.to_str(),
447+
rust_path()));
447448
cond.raise((pkg_id.clone(), ~"Dependency not found"))
448449
}
449-
else {
450+
else {
450451
workspaces[0]
451452
};
452453
let (outputs_disc, inputs_disc) =
453-
self.context.install(PkgSrc::new(source_workspace.clone(),
454-
// Use the rust_path_hack to search for dependencies iff
455-
// we were already using it
456-
self.context.context.use_rust_path_hack,
454+
self.context.install(PkgSrc::new(dep_workspace.clone(),
455+
false,
457456
pkg_id),
458457
&JustOne(Path(
459-
lib_crate_filename)));
458+
lib_crate_filename)));
460459
debug!("Installed %s, returned %? dependencies and \
461460
%? transitive dependencies",
462461
lib_name, outputs_disc.len(), inputs_disc.len());
463-
// It must have installed *something*...
464-
assert!(!outputs_disc.is_empty());
465-
let target_workspace = outputs_disc[0].pop();
466462
for dep in outputs_disc.iter() {
467463
debug!("Discovering a binary input: %s", dep.to_str());
468464
self.exec.discover_input("binary",
@@ -475,24 +471,31 @@ impl<'self> Visitor<()> for ViewItemVisitor<'self> {
475471
*dep,
476472
digest_file_with_date(&Path(*dep)));
477473
}
478-
else if *what == ~"binary" {
474+
else if *what == ~"binary" {
479475
self.exec.discover_input(*what,
480476
*dep,
481477
digest_only_date(&Path(*dep)));
482478
}
483-
else {
479+
else {
484480
fail!("Bad kind: %s", *what);
485481
}
486482
}
487483
// Also, add an additional search path
488-
debug!("Installed %s into %s", lib_name, target_workspace.to_str());
489-
(self.save)(target_workspace);
484+
debug!("Adding additional search path: %s", lib_name);
485+
let installed_library =
486+
installed_library_in_workspace(&Path(lib_name), &dep_workspace)
487+
.expect(fmt!("rustpkg failed to install dependency %s",
488+
lib_name));
489+
let install_dir = installed_library.pop();
490+
debug!("Installed %s into %s [%?]", lib_name, install_dir.to_str(),
491+
datestamp(&installed_library));
492+
(self.save)(install_dir);
490493
}
491-
}
492-
}
494+
}}
493495
// Ignore `use`s
494496
_ => ()
495497
}
498+
496499
visit::walk_view_item(self, vi, env)
497500
}
498501
}

trunk/src/libstd/logging.rs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010

1111
//! Logging
1212
13-
use fmt;
1413
use option::*;
1514
use os;
1615
use rt;
1716
use rt::logging::{Logger, StdErrLogger};
17+
use send_str::SendStrOwned;
1818

1919
/// Turns on logging to stdout globally
2020
pub fn console_on() {
@@ -37,17 +37,7 @@ pub fn console_off() {
3737
rt::logging::console_off();
3838
}
3939

40-
#[cfg(stage0)]
41-
#[doc(hidden)]
42-
pub fn log(_level: u32, s: ~str) {
43-
// this is a terrible approximation, but it gets the job done (for stage0 at
44-
// least)
45-
::io::println(s);
46-
}
47-
48-
#[allow(missing_doc)]
49-
#[cfg(not(stage0))]
50-
pub fn log(_level: u32, args: &fmt::Arguments) {
40+
fn newsched_log_str(msg: ~str) {
5141
use rt::task::Task;
5242
use rt::local::Local;
5343

@@ -56,13 +46,20 @@ pub fn log(_level: u32, args: &fmt::Arguments) {
5646
match optional_task {
5747
Some(local) => {
5848
// Use the available logger
59-
(*local).logger.log(args);
49+
(*local).logger.log(SendStrOwned(msg));
6050
}
6151
None => {
6252
// There is no logger anywhere, just write to stderr
6353
let mut logger = StdErrLogger;
64-
logger.log(args);
54+
logger.log(SendStrOwned(msg));
6555
}
6656
}
6757
}
6858
}
59+
60+
// XXX: This will change soon to not require an allocation. This is an unstable
61+
// api which should not be used outside of the macros in ext/expand.
62+
#[doc(hidden)]
63+
pub fn log(_level: u32, msg: ~str) {
64+
newsched_log_str(msg);
65+
}

trunk/src/libstd/path.rs

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -233,21 +233,6 @@ pub trait GenericPath : Clone + Eq + ToStr {
233233
result
234234
}
235235

236-
237-
/// Returns `true` iff `child` is a suffix of `parent`. See the test
238-
/// case for examples.
239-
fn is_parent_of(&self, child: &Self) -> bool {
240-
if !self.is_absolute() || child.is_absolute()
241-
|| self.components().len() < child.components().len()
242-
|| self.components().is_empty() {
243-
return false;
244-
}
245-
let child_components = child.components().len();
246-
let parent_components = self.components().len();
247-
let to_drop = self.components().len() - child_components;
248-
self.components().slice(to_drop, parent_components) == child.components()
249-
}
250-
251236
fn components<'a>(&'a self) -> &'a [~str];
252237
}
253238

@@ -1465,43 +1450,4 @@ mod tests {
14651450

14661451
}
14671452

1468-
1469-
#[test]
1470-
fn test_is_parent_of() {
1471-
fn is_parent_of_pp(p: &PosixPath, q: &PosixPath) -> bool {
1472-
p.is_parent_of(q)
1473-
}
1474-
1475-
assert!(is_parent_of_pp(&PosixPath("/a/b/c/d/e"), &PosixPath("c/d/e")));
1476-
assert!(!is_parent_of_pp(&PosixPath("a/b/c/d/e"), &PosixPath("c/d/e")));
1477-
assert!(!is_parent_of_pp(&PosixPath("/a/b/c/d/e"), &PosixPath("/c/d/e")));
1478-
assert!(!is_parent_of_pp(&PosixPath(""), &PosixPath("")));
1479-
assert!(!is_parent_of_pp(&PosixPath(""), &PosixPath("a/b/c")));
1480-
assert!(is_parent_of_pp(&PosixPath("/a/b/c"), &PosixPath("")));
1481-
assert!(is_parent_of_pp(&PosixPath("/a/b/c"), &PosixPath("a/b/c")));
1482-
assert!(!is_parent_of_pp(&PosixPath("/a/b/c"), &PosixPath("d/e/f")));
1483-
1484-
fn is_parent_of_wp(p: &WindowsPath, q: &WindowsPath) -> bool {
1485-
p.is_parent_of(q)
1486-
}
1487-
1488-
let abcde = WindowsPath("C:\\a\\b\\c\\d\\e");
1489-
let rel_abcde = WindowsPath("a\\b\\c\\d\\e");
1490-
let cde = WindowsPath("c\\d\\e");
1491-
let slashcde = WindowsPath("C:\\c\\d\\e");
1492-
let empty = WindowsPath("");
1493-
let abc = WindowsPath("C:\\a\\b\\c");
1494-
let rel_abc = WindowsPath("a\\b\\c");
1495-
let def = WindowsPath("d\\e\\f");
1496-
1497-
assert!(is_parent_of_wp(&abcde, &cde));
1498-
assert!(!is_parent_of_wp(&rel_abcde, &cde));
1499-
assert!(!is_parent_of_wp(&abcde, &slashcde));
1500-
assert!(!is_parent_of_wp(&empty, &empty));
1501-
assert!(!is_parent_of_wp(&empty, &rel_abc));
1502-
assert!(is_parent_of_wp(&abc, &empty));
1503-
assert!(is_parent_of_wp(&abc, &rel_abc));
1504-
assert!(!is_parent_of_wp(&abc, &def));
1505-
}
1506-
15071453
}

trunk/src/libstd/prelude.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@ pub use from_str::FromStr;
7272
pub use to_bytes::IterBytes;
7373
pub use to_str::{ToStr, ToStrConsume};
7474
pub use tuple::{CopyableTuple, ImmutableTuple};
75-
pub use tuple::{Tuple1, ImmutableTuple1};
76-
pub use tuple::{Tuple2, Tuple3, Tuple4, Tuple5};
77-
pub use tuple::{Tuple6, Tuple7, Tuple8, Tuple9};
78-
pub use tuple::{Tuple10, Tuple11, Tuple12};
75+
pub use tuple::{CloneableTuple1, ImmutableTuple1};
76+
pub use tuple::{CloneableTuple2, CloneableTuple3, CloneableTuple4, CloneableTuple5};
77+
pub use tuple::{CloneableTuple6, CloneableTuple7, CloneableTuple8, CloneableTuple9};
78+
pub use tuple::{CloneableTuple10, CloneableTuple11, CloneableTuple12};
7979
pub use tuple::{ImmutableTuple2, ImmutableTuple3, ImmutableTuple4, ImmutableTuple5};
8080
pub use tuple::{ImmutableTuple6, ImmutableTuple7, ImmutableTuple8, ImmutableTuple9};
8181
pub use tuple::{ImmutableTuple10, ImmutableTuple11, ImmutableTuple12};

0 commit comments

Comments
 (0)