Skip to content

Commit 48285ce

Browse files
committed
---
yaml --- r: 80750 b: refs/heads/try c: 24fdb1d h: refs/heads/master v: v3
1 parent 609d851 commit 48285ce

File tree

19 files changed

+376
-296
lines changed

19 files changed

+376
-296
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: 4c6bf4872012c010f84dc7fa2cdfe87522533f89
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: cbd1eefbd350797b783df119fed7956d7e1c74ad
5-
refs/heads/try: 1ac37d50c0096f13604c7ca249517b76ff1f1802
5+
refs/heads/try: 24fdb1d102eaa062a8a6213ec28803885192a694
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b
88
refs/heads/try2: 147ecfdd8221e4a4d4e090486829a06da1e0ca3c

branches/try/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/try/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/try/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/try/src/librustc/metadata/filesearch.rs

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,15 +77,15 @@ pub fn mk_filesearch(maybe_sysroot: &Option<@Path>,
7777
if !found {
7878
let rustpath = rust_path();
7979
for path in rustpath.iter() {
80-
debug!("is %s in visited_dirs? %?",
81-
path.push("lib").to_str(),
82-
visited_dirs.contains(&path.push("lib").to_str()));
80+
let tlib_path = make_rustpkg_target_lib_path(path, self.target_triple);
81+
debug!("is %s in visited_dirs? %?", tlib_path.to_str(),
82+
visited_dirs.contains(&tlib_path.to_str()));
8383

84-
if !visited_dirs.contains(&path.push("lib").to_str()) {
85-
visited_dirs.insert(path.push("lib").to_str());
84+
if !visited_dirs.contains(&tlib_path.to_str()) {
85+
visited_dirs.insert(tlib_path.to_str());
8686
// Don't keep searching the RUST_PATH if one match turns up --
8787
// if we did, we'd get a "multiple matching crates" error
88-
match f(&path.push("lib")) {
88+
match f(&tlib_path) {
8989
FileMatches => {
9090
break;
9191
}
@@ -145,6 +145,11 @@ fn make_target_lib_path(sysroot: &Path,
145145
sysroot.push_rel(&relative_target_lib_path(target_triple))
146146
}
147147

148+
fn make_rustpkg_target_lib_path(dir: &Path,
149+
target_triple: &str) -> Path {
150+
dir.push_rel(&Path(libdir()).push(target_triple.to_owned()))
151+
}
152+
148153
fn get_or_default_sysroot() -> Path {
149154
match os::self_exe_path() {
150155
option::Some(ref p) => (*p).pop(),

branches/try/src/librustc/middle/trans/build.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -655,9 +655,9 @@ pub fn FastCall(cx: @mut Block, Fn: ValueRef, Args: &[ValueRef]) -> ValueRef {
655655
}
656656

657657
pub fn CallWithConv(cx: @mut Block, Fn: ValueRef, Args: &[ValueRef],
658-
Conv: CallConv, sret: bool) -> ValueRef {
658+
Conv: CallConv) -> ValueRef {
659659
if cx.unreachable { return _UndefReturn(cx, Fn); }
660-
B(cx).call_with_conv(Fn, Args, Conv, sret)
660+
B(cx).call_with_conv(Fn, Args, Conv)
661661
}
662662

663663
pub fn AtomicFence(cx: @mut Block, order: AtomicOrdering) {

branches/try/src/librustc/middle/trans/builder.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@ use lib::llvm::llvm;
1313
use lib::llvm::{CallConv, AtomicBinOp, AtomicOrdering, AsmDialect};
1414
use lib::llvm::{Opcode, IntPredicate, RealPredicate, False};
1515
use lib::llvm::{ValueRef, BasicBlockRef, BuilderRef, ModuleRef};
16-
use lib::llvm::{StructRetAttribute};
1716
use middle::trans::base;
1817
use middle::trans::common::*;
1918
use middle::trans::machine::llalign_of_min;
@@ -779,9 +778,14 @@ impl Builder {
779778

780779
pub fn call(&self, llfn: ValueRef, args: &[ValueRef]) -> ValueRef {
781780
self.count_insn("call");
781+
782+
debug!("Call(llfn=%s, args=%?)",
783+
self.ccx.tn.val_to_str(llfn),
784+
args.map(|arg| self.ccx.tn.val_to_str(*arg)));
785+
782786
do args.as_imm_buf |ptr, len| {
783787
unsafe {
784-
llvm::LLVMBuildCall(self.llbuilder, llfn, ptr, len as c_uint, noname())
788+
llvm::LLVMBuildCall(self.llbuilder, llfn, ptr, len as c_uint, noname())
785789
}
786790
}
787791
}
@@ -797,16 +801,12 @@ impl Builder {
797801
}
798802

799803
pub fn call_with_conv(&self, llfn: ValueRef, args: &[ValueRef],
800-
conv: CallConv, sret: bool) -> ValueRef {
804+
conv: CallConv) -> ValueRef {
801805
self.count_insn("callwithconv");
802806
unsafe {
803807
let v = llvm::LLVMBuildCall(self.llbuilder, llfn, vec::raw::to_ptr(args),
804808
args.len() as c_uint, noname());
805809
lib::llvm::SetInstructionCallConv(v, conv);
806-
if sret {
807-
let return_slot = 1;
808-
llvm::LLVMAddInstrAttribute(v, return_slot, StructRetAttribute as c_uint);
809-
}
810810
v
811811
}
812812
}

branches/try/src/librustc/middle/trans/foreign.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,7 +266,7 @@ pub fn trans_native_call(bcx: @mut Block,
266266
}
267267
};
268268

269-
let llforeign_retval = CallWithConv(bcx, llfn, llargs_foreign, cc, fn_type.sret);
269+
let llforeign_retval = CallWithConv(bcx, llfn, llargs_foreign, cc);
270270

271271
// If the function we just called does not use an outpointer,
272272
// store the result into the rust outpointer. Cast the outpointer

branches/try/src/librustpkg/package_source.rs

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ use context::*;
1818
use crate::Crate;
1919
use messages::*;
2020
use source_control::{git_clone, git_clone_general};
21-
use path_util::{find_dir_using_rust_path_hack, default_workspace};
21+
use path_util::{find_dir_using_rust_path_hack, default_workspace, make_dir_rwx_recursive};
2222
use util::compile_crate;
2323
use workspace::is_workspace;
2424
use workcache_support;
@@ -197,12 +197,14 @@ impl PkgSrc {
197197
url, clone_target.to_str(), pkgid.version.to_str());
198198

199199
if git_clone_general(url, &clone_target, &pkgid.version) {
200-
// since the operation succeeded, move clone_target to local
201-
if !os::rename_file(&clone_target, local) {
202-
None
200+
// Since the operation succeeded, move clone_target to local.
201+
// First, create all ancestor directories.
202+
if make_dir_rwx_recursive(&local.pop())
203+
&& os::rename_file(&clone_target, local) {
204+
Some(local.clone())
203205
}
204206
else {
205-
Some(local.clone())
207+
None
206208
}
207209
}
208210
else {

0 commit comments

Comments
 (0)