about summary refs log tree commit diff
path: root/src/librustpkg
AgeCommit message (Collapse)AuthorLines
2013-10-18rustpkg: invoke touch with a portable set of argsTim Chevalier-1/+3
2013-10-18rustc: Check that the output file is writeable before linkingTim Chevalier-26/+20
This is because on Linux, the linker will silently overwrite a read-only file.
2013-10-18rustpkg: Make rustpkg tests stop comparing datesTim Chevalier-44/+159
Instead of scrutinizing modification times in rustpkg tests, change output files to be read-only and detect attempts to write to them (hack suggested by Jack). This avoids time granularity problems. As part of this change, I discovered that some dependencies weren't getting written correctly (involving built executables and library files), so this patch fixes that too. This partly addresses #9441, but one test (test_rebuild_when_needed) is still ignored on Linux.
2013-10-16Implement new methods vec.starts_with()/vec.ends_with()Kevin Ballard-6/+2
2013-10-16path2: Update for latest masterKevin Ballard-40/+48
Also fix some issues that crept into earlier commits during the conflict resoution for the rebase.
2013-10-16path2: Remove some API functionsKevin Ballard-2/+2
Delete the following API functions: - set_dirname() - with_dirname() - set_filestem() - with_filestem() - add_extension() - file_path() Also change pop() to return a boolean instead of an owned copy of the old filename.
2013-10-16path2: Update based on more review feedbackKevin Ballard-24/+24
Standardize the is_sep() functions to be the same in both posix and windows, and re-export from path. Update extra::glob to use this. Remove the usage of either, as it's going away. Move the WindowsPath-specific methods out of WindowsPath and make them top-level functions of path::windows instead. This way you cannot accidentally write code that will fail to compile on non-windows architectures without typing ::windows anywhere. Remove GenericPath::from_c_str() and just impl BytesContainer for CString instead. Remove .join_path() and .push_path() and just implement BytesContainer for Path instead. Remove FilenameDisplay and add a boolean flag to Display instead. Remove .each_parent(). It only had one caller, so just inline its definition there.
2013-10-15path2: Remove .with_display_str and friendsKevin Ballard-6/+6
Rewrite these methods as methods on Display and FilenameDisplay. This turns do path.with_display_str |s| { ... } into do path.display().with_str |s| { ... }
2013-10-15path2: Adjust the API to remove all the _str mutation methodsKevin Ballard-242/+239
Add a new trait BytesContainer that is implemented for both byte vectors and strings. Convert Path::from_vec and ::from_str to one function, Path::new(). Remove all the _str-suffixed mutation methods (push, join, with_*, set_*) and modify the non-suffixed versions to use BytesContainer.
2013-10-15path2: Replace the path module outrightKevin Ballard-621/+792
Remove the old path. Rename path2 to path. Update all clients for the new path. Also make some miscellaneous changes to the Path APIs to help the adoption process.
2013-10-11rustpkg: Set exit codes properly and make tests take advantage of thatTim Chevalier-27/+72
When I started writing the rustpkg tests, task failure didn't set the exit code properly. But bblum's work from July fixed that. Hooray! I just didn't know about it till now. So, now rustpkg uses exit codes in a more conventional way, and some of the tests are simpler. The bigger issue will be to make task failure propagate the error message. Right now, rustpkg does most of the work in separate tasks, which means if a task fails, rustpkg can't distinguish between different types of failure (see #3408)
2013-10-11extra::tempfile: replace mkdtemp with an RAII wrapperBenjamin Herr-277/+344
this incidentally stops `make check` from leaving directories in `/tmp`
2013-10-10rustpkg: Make checked-out source files read-only, and overhaul where ↵Tim Chevalier-292/+531
temporary files are stored rustpkg now makes source files that it checks out automatically read-only, and stores them under build/. Also, refactored the `PkgSrc` type to keep track of separate source and destination workspaces, as well as to have a `build_workspace` method that returns the workspace to put temporary files in (usually the source, sometimes the destination -- see comments for more details). Closes #6480
2013-10-09option: rewrite the API to use compositionDaniel Micay-9/+10
2013-10-08add new enum ast::StrStyle as field to ast::lit_strBenjamin Herr-2/+2
For the benefit of the pretty printer we want to keep track of how string literals in the ast were originally represented in the source code. This commit changes parser functions so they don't extract strings from the token stream without at least also returning what style of string literal it was. This is stored in the resulting ast node for string literals, obviously, for the package id in `extern mod = r"package id"` view items, for the inline asm in `asm!()` invocations. For `asm!()`'s other arguments or for `extern "Rust" fn()` items, I just the style of string, because it seemed disproportionally cumbersome to thread that information through the string processing that happens with those string literals, given the limited advantage raw string literals would provide in these positions. The other syntax extensions don't seem to store passed string literals in the ast, so they also discard the style of strings they parse.
2013-10-06auto merge of #9703 : alexcrichton/rust/compiler-features, r=cmrbors-0/+2
This implements the necessary logic for gating particular features off by default in the compiler. There are a number of issues which have been wanting this form of mechanism, and this initially gates features which we have open issues for. Additionally, this should unblock #9255
2013-10-06auto merge of #9741 : catamorphism/rust/rustpkg-remotes, r=cmrbors-21/+19
r? @cmr Closes #9193
2013-10-06rustpkg: Fix fetching remote packagesTim Chevalier-21/+19
Closes #9193
2013-10-05Implement feature-gating for the compilerAlex Crichton-0/+2
A few features are now hidden behind various #[feature(...)] directives. These include struct-like enum variants, glob imports, and macro_rules! invocations. Closes #9304 Closes #9305 Closes #9306 Closes #9331
2013-10-05docs / rustpkg: Document `rustpkg test` moreTim Chevalier-3/+3
Talk about `rustpkg test` in the tutorial, and update its usage message.
2013-10-01Migrate users of 'loop' to 'continue'Alex Crichton-3/+3
Closes #9467
2013-09-30rustpkg: Remove uses of fmt!Alex Crichton-305/+313
2013-09-30rustpkg: Make test_rustpkg_test_output more permissiveTim Chevalier-3/+5
test output may contain color codes, so check for several small strings instead of one big one.
2013-09-29auto merge of #9612 : alexcrichton/rust/rc-crate2, r=huonwbors-19/+15
This patch exposes actual ownership of an `ast::Crate` structure so it's not implicitly copied and reference counted via `@`. The main purpose for this patch was to get rid of the massive spike in memory during the start of the compiler (this can be seen on isrustfastyet). The reason that this spike exists is that during `phase_2` we're creating many copies of the crate by folding. Because these are reference counted, all instances of the old crates aren't dropped until the end of the function, which is why so much memory is accumulated. This patch exposes true ownership of the crate, meaning that it will be destroyed ASAP when requested. There are no code changes except for dealing with actual ownership of the crate. The large spike is then avoided: http://i.imgur.com/IO3NENy.png This shouldn't help our overall memory usage (that still is the highest at the end), but if we ever manage to bring that down it should help us not have a 1GB spike at the beginning of compilation. (This was to un-stuck bors (hopefully).)
2013-09-29Remove all usage of @ast::CrateAlex Crichton-19/+15
2013-09-28Don't redirect output in rustpkg testSteven Fackler-8/+2
Previously, if tests failed, you'd only get stderr which isn't very useful, especially if the failure didn't happen directly in a test function (e.g None.unwrap()).
2013-09-27auto merge of #9552 : brson/rust/0.9-pre, r=alexcrichtonbors-1/+1
2013-09-27auto merge of #9549 : catamorphism/rust/rustpkg-test-command, ↵bors-47/+148
r=catamorphism,metajack r? @metajack Towards #7401
2013-09-27rustpkg: Implement `rustpkg test`Tim Chevalier-47/+148
Towards #7401
2013-09-26Update version numbers to 0.9-preBrian Anderson-1/+1
2013-09-26Update the compiler to not use printf/printflnAlex Crichton-1/+1
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.