about summary refs log tree commit diff
path: root/src/librustpkg/rustpkg.rs
AgeCommit message (Collapse)AuthorLines
2013-11-03Rename files to match current recommendations.Chris Morgan-936/+0
New standards have arisen in recent months, mostly for the use of rustpkg, but the main Rust codebase has not been altered to match these new specifications. This changeset rectifies most of these issues. - Renamed the crate source files `src/libX/X.rs` to `lib.rs`, for consistency with current styles; this affects extra, rustc, rustdoc, rustpkg, rustuv, std, syntax. - Renamed `X/X.rs` to `X/mod.rs,` as is now recommended style, for `std::num` and `std::terminfo`. - Shifted `src/libstd/str/ascii.rs` out of the otherwise unused `str` directory, to be consistent with its import path of `std::ascii`; libstd is flat at present so it's more appropriate thus. While this removes some `#[path = "..."]` directives, it does not remove all of them, and leaves certain other inconsistencies, such as `std::u8` et al. which are actually stored in `src/libstd/num/` (one subdirectory down). No quorum has been reached on this issue, so I felt it best to leave them all alone at present. #9208 deals with the possibility of making libstd more hierarchical (such as changing the crate to match the current filesystem structure, which would make the module path `std::num::u8`). There is one thing remaining in which this repository is not rustpkg-compliant: rustpkg would have `src/std/` et al. rather than `src/libstd/` et al. I have not endeavoured to change that at this point as it would guarantee prompt bitrot and confusion. A change of that magnitude needs to be discussed first.
2013-10-28auto merge of #10110 : catamorphism/rust/rustpkg-dependency-build-dir, ↵bors-2/+0
r=metajack r? @metajack When invoked with the --rust-path-hack flag, rustpkg was correctly building the package into the default workspace (and not into the build/ subdirectory of the parent directory of the source directory), but not correctly putting the output for any dependencies into the default workspace as well. Spotted by Jack.
2013-10-28auto merge of #10089 : pythonesque/rust/issue-7718, r=catamorphismbors-1/+3
Seems pretty straightforward, but please let me know if I'm doing something wrong or the test needs to be rewritten.
2013-10-27Integrate the code in the digest and cryptoutil modules directly into the ↵Palmer Cox-2/+0
sha1 module.
2013-10-27Remove dead code from cryptoutil.rs and remove macro_rules feature flag.Palmer Cox-1/+1
2013-10-27Remove MD5 and Sha2. Move Sha1 and support code into librustpkg.Palmer Cox-1/+4
2013-10-27rustpkg: Build dependencies into the correct workspace when using ↵Tim Chevalier-2/+0
--rust-path-hack When invoked with the --rust-path-hack flag, rustpkg was correctly building the package into the default workspace (and not into the build/ subdirectory of the parent directory of the source directory), but not correctly putting the output for any dependencies into the default workspace as well. Spotted by Jack.
2013-10-26Make addl_lib_search_paths a HashSet (Closes #7718).Joshua Yanovski-1/+3
2013-10-24Remove even more of std::ioAlex Crichton-3/+3
Big fish fried here: extra::json most of the compiler extra::io_util removed extra::fileinput removed Fish left to fry extra::ebml
2013-10-23register snapshotsDaniel Micay-1/+1
2013-10-22rustpkg: Support arbitrary dependencies in the install APITim Chevalier-47/+66
api::install_pkg now accepts an argument that's a list of (kind, path) dependency pairs. This allows custom package scripts to declare C dependencies, as is demonstrated in rustpkg::tests::test_c_dependency_ok. Closes #6403
2013-10-22Drop the '2' suffix from logging macrosAlex Crichton-33/+33
Who doesn't like a massive renaming?
2013-10-21rustpkg: Search for crates in the current directoryTim Chevalier-7/+7
As per #8520, find crates in the current working directory even if it's not a workspace. Closes #8520
2013-10-18rustc: Check that the output file is writeable before linkingTim Chevalier-4/+4
This is because on Linux, the linker will silently overwrite a read-only file.
2013-10-18rustpkg: Make rustpkg tests stop comparing datesTim Chevalier-3/+27
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-16path2: Update for latest masterKevin Ballard-7/+7
Also fix some issues that crept into earlier commits during the conflict resoution for the rebase.
2013-10-16path2: Update based on more review feedbackKevin Ballard-6/+6
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-2/+2
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-9/+9
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-61/+80
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-5/+13
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-10rustpkg: Make checked-out source files read-only, and overhaul where ↵Tim Chevalier-75/+71
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-1/+2
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-09-30rustpkg: Remove uses of fmt!Alex Crichton-44/+45
2013-09-29auto merge of #9612 : alexcrichton/rust/rc-crate2, r=huonwbors-8/+9
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-8/+9
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-27rustpkg: Implement `rustpkg test`Tim Chevalier-34/+74
Towards #7401
2013-09-26Update version numbers to 0.9-preBrian Anderson-1/+1
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-23librustpkg: Fix diagnostic invocation syntax in librustdoc, librusti, and ↵Patrick Walton-1/+3
librustpkg.
2013-09-21Update version numbers to 0.8Brian Anderson-1/+1
2013-09-20auto merge of #9322 : catamorphism/rust/rustpkg-discovered-outputs, r=brsonbors-3/+3
r? @brson as per #9112 Closes #9112
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-3/+3
as per #9112 Closes #9112
2013-09-18rustpkg: Make crates, not packages, the unit of rustpkg dependenciesTim Chevalier-112/+171
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-17Implementing 'rustpkg init'.Steve Klabnik-0/+16
This will initialize a new workspace.
2013-09-12rustpkg: Install to RUST_PATHTim Chevalier-9/+24
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-12rustpkg: Search RUST_PATH properly for dependencies, and add a test for ↵Tim Chevalier-1/+1
recursive dependencies Closes #8524
2013-09-10rustpkg: Pass command-line arguments to rustcTim Chevalier-26/+117
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-22/+19
2013-09-08rustpkg: Use workcacheTim Chevalier-86/+149
rustpkg now uses the workcache library to avoid recompilation. Hooray!
2013-09-05Rename str::from_bytes to str::from_utf8, closes #8985Florian Hahn-1/+1
2013-08-30rustpkg: Allow package directories to appear in the RUST_PATHTim Chevalier-44/+77
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-27Handle `rustpkg build`, etc. when given no args properlyKevin Ballard-15/+12
`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 #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-0/+2
multiple workspaces The test checks that rustpkg uses the first one, rather than complaining about multiple matches. Closes #7241