bors [Tue, 7 Feb 2017 22:02:51 +0000 (22:02 +0000)]
Auto merge of #3651 - pkgw:pr-issue-3366, r=alexcrichton
Attempt to solve #3366, regarding spurious shared library search paths.
This drops `native_dirs` entries that are not within the target output when modifying the (DY)LD_LIBRARY_PATH environment variable before running programs.
Peter Williams [Tue, 7 Feb 2017 20:55:36 +0000 (15:55 -0500)]
Attempt to fix the run_with_library_paths test for Windows.
I was just pasting the build directories into Rust string literals, so Windows
paths with backslashes were being interpreted as having unknown string
escapes. Raw string guards should fix this for all but the most pathological
of build directories.
bors [Tue, 7 Feb 2017 20:08:02 +0000 (20:08 +0000)]
Auto merge of #3664 - pwoolcoc:issue-3391, r=alexcrichton
Assume that a `build.rs` file is a build script
If cargo sees a `build.rs` file in the same directory as the current
`Cargo.toml`, it will assume that the `build.rs` file is a build script,
unless there is `build = false` in the `Cargo.toml` file.
Paul Woolcock [Tue, 7 Feb 2017 17:41:36 +0000 (12:41 -0500)]
Assume that a `build.rs` file is a build script
If cargo sees a `build.rs` file in the same directory as the current
`Cargo.toml`, it will assume that the `build.rs` file is a build script,
_unless there is_ `build = false` _in the _ `Cargo.toml` _file_.
bors [Sun, 5 Feb 2017 22:29:03 +0000 (22:29 +0000)]
Auto merge of #3632 - Susurrus:master, r=alexcrichton
Document build badge for Gitlab CI
This doesn't make sense to merge until rust-lang/crates.io#539 is merged, but I figured I'd get it all spooled up since that PR is already ready for merging.
Peter Williams [Sun, 5 Feb 2017 21:15:24 +0000 (16:15 -0500)]
Attempt to solve #3366, regarding spurious shared library search paths.
This drops `native_dirs` entries that are not within the target directory when
modifying the (DY)LD_LIBRARY_PATH environment variable before running
programs.
bors [Sat, 4 Feb 2017 19:28:44 +0000 (19:28 +0000)]
Auto merge of #3648 - cuviper:powerpc64-gcc4, r=alexcrichton
Update OPENSSL_CC_powerpc64-unknown-linux-gnu
With the new `rust-slave-linux-cross:2017-02-02`, powerpc64 no longer
uses gcc-5. I updated the `Dockerfile` at the time to reflect this, but
missed `OPENSSL_CC_powerpc64-unknown-linux-gnu` in `Makefile.in`.
Josh Stone [Sat, 4 Feb 2017 01:59:30 +0000 (17:59 -0800)]
Update OPENSSL_CC_powerpc64-unknown-linux-gnu
With the new `rust-slave-linux-cross:2017-02-02`, powerpc64 no longer
uses gcc-5. I updated the `Dockerfile` at the time to reflect this, but
missed `OPENSSL_CC_powerpc64-unknown-linux-gnu` in `Makefile.in`.
bors [Fri, 3 Feb 2017 04:16:05 +0000 (04:16 +0000)]
Auto merge of #3634 - steveklabnik:bump-semver, r=alexcrichton
bump semver version
Thanks to @raphlinus , semver-parser no longer depends on regex. The code is (probably, I haven't technically tested it but it's hard to imagine it's not) faster, smaller, and has zero dependencies, as well as better errors.
This new version of semver only updates the dependencies involved, no interface changes, so it should be a drop-in replacement.
bors [Fri, 3 Feb 2017 00:59:41 +0000 (00:59 +0000)]
Auto merge of #3628 - zackmdavis:the_maelstrom_of_my_purity_born_of_pain, r=alexcrichton
make build tests not depend on minutiae of rustc output
This little patch arises from the maelstrom of my purity born of pain.
It's the pain of seeing rust-lang/rust#38103 in its perfect crystalline beauty waste away on page four of https://github.com/rust-lang/rust/pulls, waiting, ready, itching to land, dying with anticipation to bring the light of clearer lint group error messages to Rust users of all creeds and nations, only for its promise to be cruelly blocked by the fateful, hateful hand of circular dependency. For it is written in src/tools/cargotest/main.rs that the Cargo tests must pass before the PR can receive Appveyor's blessing, but the Cargo tests could not pass (because they depend on fine details of the output that the PR is meant to change), and the Cargo tests could not be changed (because updating the test expectation to match the proposed new compiler output, would fail with the current compiler).
The Gordian knot is cut in the bowels of cargotest's very notion of comparison (of JSON objects) itself, by means of introducing a magic string literal `"{...}"`, which can server as a wildcard for any JSON sub-object.
And so it will be for the children, and the children's children, and unto the 1.17.0 and 1.18.0 releases, that Cargo's build test expectations will faithfully expect the exact JSON output by Cargo itself, but the string literal `"{...}"` shall be a token upon the JSON output by rustc, and when I see `"{...}"`, I will pass over you, and the failure shall not be upon you.
Zack M. Davis [Wed, 1 Feb 2017 04:51:24 +0000 (20:51 -0800)]
make build tests not depend on minutiæ of rustc output
This little patch arises from the maelstrom of my purity born of pain.
It's the pain of seeing rust-lang/rust#38103 in its perfect
crystalline beauty waste away on page four of
https://github.com/rust-lang/rust/pulls, waiting, ready, itching to
land, dying with anticipation to bring the light of clearer lint group
error messages to Rust users of all creeds and nations, only for its
promise to be cruelly blocked by the fateful, hateful hand of circular
dependency. For it is written in src/tools/cargotest/main.rs that the
Cargo tests must pass before the PR can receive Appveyor's blessing,
but the Cargo tests could not pass (because they depend on fine
details of the output that the PR is meant to change), and the Cargo
tests could not be changed (because updating the test expectation to
match the proposed new compiler output, would fail with the current
compiler).
The Gordian knot is cut in the bowels of cargotest's very notion of
comparison (of JSON objects) itself, by means of introducing a magic
string literal `"{...}"`, which can server as a wildcard for any JSON
sub-object.
And so it will be for the children, and the children's children, and
unto the 1.17.0 and 1.18.0 releases, that Cargo's build test
expectations will faithfully expect the exact JSON output by Cargo
itself, but the string literal `"{...}"` shall be a token upon the
JSON output by rustc, and when I see `"{...}"`, I will pass over you,
and the failure shall not be upon you.
bors [Thu, 2 Feb 2017 02:15:05 +0000 (02:15 +0000)]
Auto merge of #3609 - jmatraszek:build_proper_binary, r=alexcrichton
Fix building multiple binaries that do not have path spacified in Cargo.toml
When multiple binaries are specified in Cargo.toml, the binaries that do not have `path` specified are build from `src/main.rs`. Discovered here: https://github.com/rust-lang-nursery/thanks/pull/40#issuecomment-275493045.
This was caused by setting for a binary a main layout here https://github.com/rust-lang/cargo/blob/master/src/cargo/util/toml.rs#L478, which caused `normalize` to not fallback to default binary path here https://github.com/rust-lang/cargo/blob/master/src/cargo/util/toml.rs#L1149 (as `bin.path` was always `Some("/path/to/main.rs")`.
Added a test and fixed this by not using `layout.main()`, so right now for bins without `path` specified we fallback to default path inferred from bin's name (e.g. `src/bin/foo.rs`), test if the file exists and only if it doesn't -- fallback to `src/main.rs`.
I do not have any knowledge about Cargo's design, so I am not sure if this is the proper place to test for file existence.
If `[members]` key present, it compliantly defines the set of members. Otherwise, members are all (transitive) path dependencies.
The problem with this approach is that it violates convention over configuration principle: almost always you want a path dependency to be a member, even if there are some explicit members. Listing **all** path deps is just to much work.
# Original implementation
So, the actual algorithm **unconditionally** included path dependencies as memebers.
This is also problematic, because certain workspace configurations become impossible. In particular, you can't have a path dependency which is not a member of the workspace. This issue was reported in #3192.
# Current implementation
Current implementation (was merged couple of days ago) includes path dependency into the workspace only if is inside the workspace directory. This solves the problem in #3192 perfectly. However, some configuration are still impossible: you can't have a non-member path dependency inside a workspace directory. But the thinking is that if you don't want this path-dep to be a member, just don't put it inside the workspace directory.
There is another problem with current imlementation. Suppose you have an explicit member which lives alongside the workspace. Suppose this member has a path-dep which lives inside the member's folder. Under current implementation, this path-dep won't be a member of the workspace. It seems logical that it should be though (but we haven't received any actual bug reports yet)!
# Implementation in this PR
So, with this PR, the logic is as follows: members are explicit members + all path dependencies which reside under any of the explicit members.
bors [Wed, 1 Feb 2017 22:22:19 +0000 (22:22 +0000)]
Auto merge of #3004 - ehiggs:master, r=alexcrichton
Resubmission of templating PR (#1747)
This is a manual rebase of the older #1747 PR which was basically unrebasable due to the time it's been dormant.. This implements templating for Cargo and is basically the work of Greg Chapple (@gchp).
I'd love for this feature to move forward since it's really tedious to create all the directories (e.g. `src/bin`) and copy paste docopt examples which I then edit. Then implement the `main` program to delegate to the subcommands in `src/bin`, etc.
Ewan Higgs [Tue, 16 Aug 2016 23:58:05 +0000 (01:58 +0200)]
Cargo templating for `new` and `init`
PR #3004 This is a resubmission of the PR #1747 (from scratch) which adds
support for templating in Cargo. The templates are implemented using the
handlebars crate (where the original PR used mustache).
Examples:
cargo new --template https://url/to/template somedir foo
cargo new --template https://url/to/templates --template-subdir somedir foo
cargo new --template ../path/to/template somedir foo
bors [Tue, 31 Jan 2017 03:20:49 +0000 (03:20 +0000)]
Auto merge of #3618 - sbeckeriv:3473-new-subcommand-doc-update, r=alexcrichton
Update new command help doc
Resolves #3473
Dearest reviewer,
I hope that all is well in rustland. I was reviewing some open issues
and saw this update to the help text for the new command. I have added
the suggested help text from issue #3473. I formated to the message to
match the publish bin's job flag.
I hope that all is well in rustland. I was reviewing some open issues
and saw this update to the help text for the new command. I have added
the suggested help text from issue #3473. I formated to the message to
match the publish bin's job flag.
bors [Sun, 29 Jan 2017 02:06:47 +0000 (02:06 +0000)]
Auto merge of #3604 - froydnj:rich-version-info, r=alexcrichton
implement `cargo --version --verbose`
As suggested in #3584. This is a bit underwhelming, and I'm unsure if some of the complexity in froydnj/cargo@775c900 is really warranted, but this series gets the job done. Sample output when building with `configure` and `make`:
bors [Sat, 28 Jan 2017 00:35:00 +0000 (00:35 +0000)]
Auto merge of #3593 - Susurrus:master, r=alexcrichton
Improve error for dependencies that don't have the same source paths
I've added an additional test case which is how my project compiled. Part of the issue was that I didn't know that each dependency needs to use the same path for all build targets. The previous error message was unclear both in what was going on and how to resolve it. The new error message should be more clear.
bors [Fri, 27 Jan 2017 22:55:06 +0000 (22:55 +0000)]
Auto merge of #3557 - raphlinus:master, r=alexcrichton
Add dep-info generation
Work in progress: add a --dep-info flag to cargo build (and also
rustc) that outputs dependency information in a form compatible with
make and ninja, to a specified file. This will help in integrating
into other build systems.
Nathan Froyd [Fri, 27 Jan 2017 16:39:17 +0000 (11:39 -0500)]
export rich version information from cargo::version
To support `cargo --version --verbose`, ala rustc, we need more
information to be injected into cargo when it's built from the Makefile,
and a more explicit data structure to be returned from cargo::version.
We implement fmt::Display for our newly-created structure so clients
don't have to bother with the details of interpreting the structure if
all they want is a string.
bors [Thu, 26 Jan 2017 22:27:33 +0000 (22:27 +0000)]
Auto merge of #3597 - Susurrus:badge_docs, r=alexcrichton
Add gitlab to the supported services for AppVeyor badges.
This is undocumented but supported behavior for AppVeyor. I have already done this with a crate I own and the badge works on both the AppVeyor and crates.io end.
Raph Levien [Tue, 17 Jan 2017 21:22:05 +0000 (13:22 -0800)]
Add dep-info generation
Make cargo output a ".d" file containing dependency info (in a format
that make and ninja can consume) for each artifact it produces. This
will help in integrating into other build systems.