about summary refs log tree commit diff
path: root/src/librustpkg
AgeCommit message (Collapse)AuthorLines
2013-09-15rustpkg: CleanupTim Chevalier-59/+42
2013-09-14rustpkg: Always write a package_id attribute into the link metadataTim Chevalier-4/+51
For some reason, I thought it wasn't necessary to write the package_id attribute (which rustc's filesearch checks when searching for a package) if the package ID had a single component (like "foo") as opposed to multiple components (like "foo/bar/quux"). This meant that `extern mod quux = "an-awesome-library";` didn't work, even if an-awesome-library existed in the RUST_PATH. Fixed it.
2013-09-14auto merge of #9115 : erickt/rust/master, r=ericktbors-2/+2
This is a series of patches to modernize option and result. The highlights are: * rename `.unwrap_or_default(value)` and etc to `.unwrap_or(value)` * add `.unwrap_or_default()` that uses the `Default` trait * add `Default` implementations for vecs, HashMap, Option * add `Option.and(T) -> Option<T>`, `Option.and_then(&fn() -> Option<T>) -> Option<T>`, `Option.or(T) -> Option<T>`, and `Option.or_else(&fn() -> Option<T>) -> Option<T>` * add `option::ToOption`, `option::IntoOption`, `option::AsOption`, `result::ToResult`, `result::IntoResult`, `result::AsResult`, `either::ToEither`, and `either::IntoEither`, `either::AsEither` * renamed `Option::chain*` and `Result::chain*` to `and_then` and `or_else` to avoid the eventual collision with `Iterator.chain`. * Added a bunch of impls of `Default` * Added a `#[deriving(Default)]` syntax extension * Removed impls of `Zero` for `Option<T>` and vecs.
2013-09-13Remove all usage of change_dir_lockedAlex Crichton-14/+13
While usage of change_dir_locked is synchronized against itself, it's not synchronized against other relative path usage, so I'm of the opinion that it just really doesn't help in running tests. In order to prevent the problems that have been cropping up, this completely removes the function. All existing tests (except one) using it have been moved to run-pass tests where they get their own process and don't need to be synchronized with anyone else. There is one now-ignored rustpkg test because when I moved it to a run-pass test apparently run-pass isn't set up to have 'extern mod rustc' (it ends up having linkage failures).
2013-09-13rustc/rustpkg: Use a target-specific subdirectory in build/ and lib/Tim Chevalier-25/+83
As per rustpkg.md, rustpkg now builds in a target-specific subdirectory of build/, and installs libraries into a target-specific subdirectory of lib. Closes #8672
2013-09-13auto merge of #9148 : jakub-/rust/rustpkg-install-mkdir-p, r=catamorphismbors-5/+9
Testing this is a little tricky as an intermediate temporary directory is only used for remote git repositories and therefore that path cannot be reliably exercised in the tests.
2013-09-12rustpkg: Install to RUST_PATHTim Chevalier-9/+52
Install to the first directory in the RUST_PATH if the user set a RUST_PATH. In the case where RUST_PATH isn't set, the behavior remains unchanged. Closes #7402
2013-09-12std: Rename {Option,Result}::chain{,_err}* to {and_then,or_else}Erick Tryzelaar-2/+2
2013-09-12rustpkg: Search RUST_PATH properly for dependencies, and add a test for ↵Tim Chevalier-10/+48
recursive dependencies Closes #8524
2013-09-12Fix rustpkg install for git repositoriesJakub-5/+9
2013-09-12rustpkg: Support sub-package-IDsTim Chevalier-35/+137
Package IDs can now refer to a subdirectory of a particular source tree, and not just a top-level directory with a src/ directory as its parent. For example, referring to the package ID a/b/c/d , in workspace W, if W/src/a is a package, will build the sources for the package in a/b/c/d (and not other crates in W/src/a). Closes #6408
2013-09-10rustpkg: Pass command-line arguments to rustcTim Chevalier-65/+704
rustpkg now accepts most of rustc's command-line arguments and passes them along to rustc when building or installing. A few rarely-used arguments aren't implemented yet. rustpkg doesn't support flags that don't make sense with rustpkg (for example, --bin and --lib, which get inferred from crate file names). Closes #8522
2013-09-08rustpkg: Address review comments from JackTim Chevalier-164/+126
2013-09-08rustpkg: Use workcacheTim Chevalier-417/+652
rustpkg now uses the workcache library to avoid recompilation. Hooray!
2013-09-05Rename str::from_bytes to str::from_utf8, closes #8985Florian Hahn-24/+24
2013-09-04auto merge of #8978 : pnkfelix/rust/make-path-api-less-allocation-happy, r=huonwbors-16/+17
A [dialogue](https://github.com/mozilla/rust/pull/8909#discussion-diff-6102725) on PR #8909 inspired me to make this change. r? anyone (It is possible that `std::path` itself will soon be replaced with a new implementation that kballard's working on, as mentioned in the dialogue linked above, but this revision is simple enough that I figured I'd offer it up.)
2013-09-04Update clients of path.rs to use new API.Felix S. Klock II-16/+17
In most cases this involved removing a ~str allocations or clones (yay), or coercing a ~str to a slice. In a few places, I had to bind an intermediate Path (e.g. path.pop() return values), so that it would live long enough to support the borrowed &str. And in a few places, where the code was actively using the property that the old API returned ~str's, I had to put in to_owned() or clone(); but in those cases, we're trading an allocation within the path.rs code for one in the client code, so they neutralize each other.
2013-09-04Added explicit pub to several conditions. Enables completion of #6009.Felix S. Klock II-8/+9
2013-09-03Fixes #8881. condition! imports parent's pub identifiersjmgrosen-8/+8
2013-09-02Renamed syntax::ast::ident -> IdentMarvin Löbel-2/+2
2013-09-01Modernized a few type names in rustc and syntaxMarvin Löbel-3/+3
2013-08-30made Eq for package_id use more standard parameter namesEric Martin-2/+2
2013-08-30remove several 'ne' methodsEric Martin-6/+0
2013-08-30rustpkg: Allow package directories to appear in the RUST_PATHTim Chevalier-103/+428
This commit adds a rustpkg flag, --rust-path-hack, that allows rustpkg to *search* inside package directories if they appear in the RUST_PATH, while *building* libraries and executables into a different target directory. This behavior is hidden behind a flag because I believe we only want to support it temporarily, to make it easier to port servo to rustpkg. This commit also includes a fix for how rustpkg fetches sources from git repositories -- it uses a temporary directory as the target when invoking `git clone`, then moves that directory into the workspace if the clone was successful. (The old behavior was that when the `git clone` failed, the empty target directory would be left lying around anyway.)
2013-08-30rustpkg: Add a not_a_workspace conditionTim Chevalier-0/+8
2013-08-29Revert "auto merge of #8645 : alexcrichton/rust/issue-6436-run-non-blocking, ↵Brian Anderson-9/+7
r=brson" This reverts commit b8d1fa399402c71331aefd634d710004e00b73a6, reversing changes made to f22b4b169854c8a4ba86c16ee43327d6bcf94562. Conflicts: mk/rt.mk src/libuv
2013-08-27auto merge of #8645 : alexcrichton/rust/issue-6436-run-non-blocking, r=brsonbors-7/+9
This overhauls `std::run` to instead run on top of libuv. This is *not* in a mergeable state, I've been attempting to diagnose failures in the compiletest suite. I've managed to find a fair number of bugs so far, but I still don't seem to be done yet. Notable changes: * This requires upgrading libuv. From the discussion on #6567, I took libuv master from a few days ago, applied one patch to fix process spawning with multiple event loops in libuv, and pushed to my own fork * The build system for libuv has changed since we last used it. There's some extra checkout from a google build system which apparently does all the magic if you don't want to require autotools, and the google system just requires python. I updated the Makefile to get this build system and build libuv with it instead. This is untested on windows and arm, and both will probably need to see some improvement. * This required adding some pipe bindings to libuv as well. Currently the support is pretty simple and probably completely unsafe for pipes, but you at least get read/write methods. This is necessary for capturing output of processes. * I didn't redesign `std::run` at all, I simply tried to reimplement all the existing functionality on top of libuv. Some functions ended up dying, but nothing major. All uses of `std::run` in the compiler still work just fine. I'm not quite sure how the rest of the runtime deals with this, but I marked process structures as `no_send` because the waiting/waking up has to happen in the same event loop right now. If processes start migrating between event loops then very bad things can happen. This may be what threadsafe I/O would fix, and I would be more than willing to rebase on that if it lands first. Anyway, for now I wanted to put this up for review, I'm still investigating the corruption/deadlock bugs, but this is in an *almost* workable state. Once I find the bugs I'll also rebase on the current master.
2013-08-27Implement process bindings to libuvAlex Crichton-7/+9
Closes #6436
2013-08-27Handle `rustpkg build`, etc. when given no args properlyKevin Ballard-36/+35
`rustpkg build` et al were only checking one directory up to see if it was in a dir named "src". Ditch that entirely and instead check if the cwd is descended from any of the workspace paths. Besides being more intelligent about whether or not something is a workspace, this also allows for package ids composed of multiple path components.
2013-08-27auto merge of #8792 : adridu59/rust/master, r=catamorphismbors-5/+4
`target_library_in_workspace` is imported but unused: ~/rust/src/librustpkg/tests.rs:21:48: 21:75 warning: unused import [-W unused-imports (default)]
2013-08-27librustpkg/tests.rs: cleanup unused importAdrien Tétar-5/+4
2013-08-27auto merge of #8773 : catamorphism/rust/rustpkg-version-flag, r=anasazibors-1/+9
r? anyone. Now, rustpkg --version does something useful!
2013-08-26rustpkg: Implement --version command-line optionTim Chevalier-1/+9
Now, rustpkg --version does something useful!
2013-08-26rustpkg: Test that different copies of the same package ID can exist in ↵Tim Chevalier-18/+80
multiple workspaces The test checks that rustpkg uses the first one, rather than complaining about multiple matches. Closes #7241
2013-08-23auto merge of #8681 : mrordinaire/rust/remove-set_args, r=brsonbors-1/+4
2013-08-23removed os::set_args, closing #8325Do Nhat Minh-1/+4
removed pub on real_args, changed test to use args
2013-08-22Suppress a broken test. Issue #8690.Michael Sullivan-0/+1
2013-08-21rustpkg: Add test for #7348. Closes #7348Tim Chevalier-0/+12
2013-08-21rustpkg: Re-enable some more testsTim Chevalier-21/+22
2013-08-21rustpkg: Add test for #7338. Closes #7338Tim Chevalier-0/+12
2013-08-19rustpkg: Un-ignore most of the remaining testsTim Chevalier-93/+86
This necessitated some cleanup to how we parse library filenames when searching for libraries, since rustpkg may now create filenames that contain '-' characters. Also cleaned up how rustpkg passes the sysroot to a custom build script.
2013-08-19Add externfn macro and correctly label fixed_stack_segmentsNiko Matsakis-0/+4
2013-08-16auto merge of #8532 : kballard/rust/cstr-cleanup, r=ericktbors-2/+2
Implement interior null checking in `.to_c_str()`, among other changes.
2013-08-15auto merge of #8518 : catamorphism/rust/issue-8498-workaround, r=brsonbors-4/+6
r? @brson
2013-08-15Add ToCStr method .with_c_str()Kevin Ballard-2/+2
.with_c_str() is a replacement for the old .as_c_str(), to avoid unnecessary boilerplate. Replace all usages of .to_c_str().with_ref() with .with_c_str().
2013-08-14std: Change ProcessOptions struct to have an option of a ~ vectorTim Chevalier-4/+6
This is a workaround for #8498
2013-08-13Remove unused automatic cfg bindings Fixes #7169Nick Desaulniers-2/+2
2013-08-11Cleanup librustpkg a little bit.Steven Stewart-Gallus-74/+77
Mostly I did simple transformations from imperative style loops to more functional iterator based transformations.
2013-08-10std: Transform.find_ -> .findErick Tryzelaar-1/+1
2013-08-10std: Iterator.len_ -> .lenErick Tryzelaar-2/+2