about summary refs log tree commit diff
path: root/src/librustpkg
AgeCommit message (Collapse)AuthorLines
2013-09-25rustdoc: Change all code-blocks with a scriptAlex Crichton-3/+3
find src -name '*.rs' | xargs sed -i '' 's/~~~.*{\.rust}/```rust/g' find src -name '*.rs' | xargs sed -i '' 's/ ~~~$/ ```/g' find src -name '*.rs' | xargs sed -i '' 's/^~~~$/ ```/g'
2013-09-25rustpkg: Search for packages correctly when using the rust_path_hackTim Chevalier-30/+78
Previously, any package would match any other package ID when searching using the rust_path_hack, so long as the directory had one or more crate files in it. Now, rustpkg checks that the parent directory matches the package ID. Closes #9273
2013-09-24Don't use libc::exit. #9473Brian Anderson-10/+14
This can cause unexpected errors in the runtime when done while scheduler threads are still initializing. Required some restructuring of the main_args functions in our libraries.
2013-09-23auto merge of #9310 : pcwalton/rust/at-fn, r=pcwaltonbors-49/+97
r? @brson
2013-09-23librustc: Fix merge fallout.Patrick Walton-2/+5
2013-09-23librustc: Remove `@fn` managed closures from the language.Patrick Walton-2/+2
2013-09-23libsyntax: Remove some more `@fn` usesPatrick Walton-30/+61
2013-09-23librustpkg: Fix diagnostic invocation syntax in librustdoc, librusti, and ↵Patrick Walton-3/+10
librustpkg.
2013-09-23librustc: Change fold to use traits instead of `@fn`.Patrick Walton-14/+21
2013-09-23Ignore some rustpkg tests for nowAlex Crichton-0/+2
They're blocking a new snapshot and @catamorphism is on it.
2013-09-21Update version numbers to 0.8Brian Anderson-1/+1
2013-09-20auto merge of #9337 : steveklabnik/rust/rustpkg_usage, r=catamorphismbors-2/+3
When I took out the ability to make a new project by name, I forgot to update the usage to reflect the changes.
2013-09-20auto merge of #9322 : catamorphism/rust/rustpkg-discovered-outputs, r=brsonbors-8/+84
r? @brson as per #9112 Closes #9112
2013-09-19Fix usage for rustpkg initSteve Klabnik-2/+3
When I took out the ability to make a new project by name, I forgot to update the usage to reflect the changes.
2013-09-19Turned extra::getopts functions into methodsMarvin Löbel-26/+26
Some minor api and doc adjustments
2013-09-18rustpkg: Register correct dependencies for built and installed filesTim Chevalier-8/+84
as per #9112 Closes #9112
2013-09-18rustpkg: Make crates, not packages, the unit of rustpkg dependenciesTim Chevalier-249/+409
Treating a package as the thing that can have other packages depend on it, and depends on other packages, was wrong if a package has more than one crate. Now, rustpkg knows about dependencies between crates in the same package. This solves the problem reported in #7879 where rustpkg wrongly discovered a circular dependency between thhe package and itself, and recursed infinitely. Closes #7879
2013-09-17Ignore a test which is blocking a snapshotAlex Crichton-0/+1
@catamorphism says he has a fix coming soon, so I didn't allocate an issue for it. If it festers for more than a few days I'll open something up though.
2013-09-17Implementing 'rustpkg init'.Steve Klabnik-1/+24
This will initialize a new workspace.
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