auto merge of #513 : bkoropoff/cargo/revert-static, r=alexcrichton
This reverts a commit that worked around an overly restrictive lifetime bound on the `Writer` impl for `Box<Writer>` in libstd. Now that this restriction has been lifted, the workaround can be reverted.
Alex Crichton [Sun, 7 Sep 2014 18:26:07 +0000 (11:26 -0700)]
Don't run cargo as root during `make install`
This rejiggers the dependencies for `make install` to only copy files into the
destination, never assemble anything. This adds a hard requirement that `make`
is executed before `make install`.
auto merge of #503 : alexcrichton/cargo/issue-493, r=brson
This commit updates git2-rs to get the implementation of the authentication
callback in libgit2. Additionally this specifies the callback for whenever we're
cloning into the database or updating submodules.
Currently cargo will *not* ask for user input, but rather require you to have
authentication configured in git through some other means. There are currently
two primary methods of doing so:
1. Any SSH key in the local ssh-agent will be used for authentication with SSH
repositories.
2. The `credential.helper` interface (as specified by gitcredential(7)) has been
implemented in git2-rs to allow for picking up of storage of passwords in the
local git cache or keychain.
If these two methods fail, then there will likely be an authentication failure.
Interactive prompts for authentication have not been implemented as there is no
method to currently enter your password into the terminal silently.
A consequence of this commit is that cargo now depends on libssh2. A package was
created to create a static copy of libssh2, and this is now linked into cargo by
default.
It turned out that just building libssh2 was quite a beast in and of itself on
windows. The primary stickler point is that on the current release, 1.4.3,
libssh2 requires openssl on windows. At this time I don't want to pick up a
dependency on openssl for windows, and it turned out that the unreleased 1.4.4
version has a new backend for windows not based on openssl, but rather windows's
cryptography API.
The current bundled version of libssh2 is 1.4.4 with some light modifications to
actually build on windows (wow that was hard). All in all, we're now statically
linking to libssh 1.4.4 (not a runtime dependency).
Alex Crichton [Mon, 1 Sep 2014 06:03:45 +0000 (23:03 -0700)]
Implement git authentication
This commit updates git2-rs to get the implementation of the authentication
callback in libgit2. Additionally this specifies the callback for whenever we're
cloning into the database or updating submodules.
Currently cargo will *not* ask for user input, but rather require you to have
authentication configured in git through some other means. There are currently
two primary methods of doing so:
1. Any SSH key in the local ssh-agent will be used for authentication with SSH
repositories.
2. The `credential.helper` interface (as specified by gitcredential(7)) has been
implemented in git2-rs to allow for picking up of storage of passwords in the
local git cache or keychain.
If these two methods fail, then there will likely be an authentication failure.
Interactive prompts for authentication have not been implemented as there is no
method to currently enter your password into the terminal silently.
A consequence of this commit is that cargo now depends on libssh2. A package was
created to create a static copy of libssh2, and this is now linked into cargo by
default.
It turned out that just building libssh2 was quite a beast in and of itself on
windows. The primary stickler point is that on the current release, 1.4.3,
libssh2 requires openssl on windows. At this time I don't want to pick up a
dependency on openssl for windows, and it turned out that the unreleased 1.4.4
version has a new backend for windows not based on openssl, but rather windows's
cryptography API.
The current bundled version of libssh2 is 1.4.4 with some light modifications to
actually build on windows (wow that was hard). All in all, we're now statically
linking to libssh 1.4.4 (not a runtime dependency).
auto merge of #470 : alexcrichton/cargo/cargo-new-git, r=brson
This adds a command-line --no-git option to disable this behavior, as well as
adding a global config section for `git = false`. While I was at it I write some
documentation for the configuration format that cargo uses.
Alex Crichton [Thu, 28 Aug 2014 20:22:36 +0000 (13:22 -0700)]
Turn --git on by default for `cargo-new`.
This adds a command-line --no-git option to disable this behavior, as well as
adding a global config section for `git = false`. While I was at it I write some
documentation for the configuration format that cargo uses.
Alex Crichton [Wed, 3 Sep 2014 18:54:47 +0000 (11:54 -0700)]
Re-enable passing -g to rustc
Now that there is a way to disable debuginfo for a build, we can go back to
passing it by default. Any bugs in debuginfo will get weeded out by specifying
`debug = false` in the profile.
auto merge of #506 : alexcrichton/cargo/sooner-lockfile, r=wycats
It's quite annoying if you update a dependency, but it takes you awhile to get
the dependency building. Previously the dependency graph would have to be
updated each time because the lockfile was only written *after* a successful
build.
Other tools like `cargo generate-lockfile` will already generate a lockfile at
any time, so just make it easier by moving it up in the compilation process.
Alex Crichton [Wed, 3 Sep 2014 15:23:59 +0000 (08:23 -0700)]
Generate a lockfile sooner in `cargo build`
It's quite annoying if you update a dependency, but it takes you awhile to get
the dependency building. Previously the dependency graph would have to be
updated each time because the lockfile was only written *after* a successful
build.
Other tools like `cargo generate-lockfile` will already generate a lockfile at
any time, so just make it easier by moving it up in the compilation process.
auto merge of #500 : alexcrichton/cargo/fix-flaky-test, r=brson
This test has been flaky on the bots for quite some time now, and the cause has
now been discovered. The root cause of the failure is that the execve for the
`cargo --list` command was failing with ETXTBUSY. In querying the manpage, this
means:
Executable was open for writing by one or more processes.
This error can be explained by the following trace:
1. Thread A, running the `cargo --list` test, opens the destination executable
for writing because it's copying the current executable into a different
location.
2. Thread B, some other test, forks the process. The file descriptor of the
destination executable of thread A is now duplicated in this process.
3. Thread A closes all files and such, and then goes to fork/exec
`cargo --list`.
4. Thread B has not had time to close all its descriptors. so it still has the
executable open for writing, causing the `execve` of thread A to fail.
This commit just removes these tested portions of the test, only testing that
cargo probes PATH.
auto merge of #475 : alexcrichton/cargo/issue-458, r=brson
Relative paths are now considered relative to the directory containing the
`.cargo/config` file specifying the relative path.
I also merge ConfigValueValue into ConfigValue by moving the Path directly next
to the String that defined it so we can track which strings came from which
paths.
Alex Crichton [Fri, 29 Aug 2014 04:38:35 +0000 (21:38 -0700)]
Fix relative override paths
Relative paths are now considered relative to the directory containing the
`.cargo/config` file specifying the relative path.
I also merge ConfigValueValue into ConfigValue by moving the Path directly next
to the String that defined it so we can track which strings came from which
paths.
Alex Crichton [Tue, 2 Sep 2014 16:51:48 +0000 (09:51 -0700)]
Slim down the `cargo --list` test
This test has been flaky on the bots for quite some time now, and the cause has
now been discovered. The root cause of the failure is that the execve for the
`cargo --list` command was failing with ETXTBUSY. In querying the manpage, this
means:
Executable was open for writing by one or more processes.
This error can be explained by the following trace:
1. Thread A, running the `cargo --list` test, opens the destination executable
for writing because it's copying the current executable into a different
location.
2. Thread B, some other test, forks the process. The file descriptor of the
destination executable of thread A is now duplicated in this process.
3. Thread A closes all files and such, and then goes to fork/exec
`cargo --list`.
4. Thread B has not had time to close all its descriptors. so it still has the
executable open for writing, causing the `execve` of thread A to fail.
This commit just removes these tested portions of the test, only testing that
cargo probes PATH.
Brian Koropoff [Fri, 29 Aug 2014 06:36:28 +0000 (23:36 -0700)]
Fix build breakage due to generalized type parameter and object bounds
It is worth noting that cargo was actually creating trait boxes
that contain non-static references, so I couldn't just put 'static
everywhere to appease rustc.
bors [Thu, 28 Aug 2014 18:28:57 +0000 (18:28 +0000)]
auto merge of #465 : alexcrichton/cargo/update-git2, r=wycats
It turned out most of the methods in libgit2 don't actually require a Signature
structure, they're all mostly optional. This commit updates to this version of
libgit2 where the arguments are all optional.
Alex Crichton [Thu, 28 Aug 2014 18:10:10 +0000 (11:10 -0700)]
Update the git2 dependency
It turned out most of the methods in libgit2 don't actually require a Signature
structure, they're all mostly optional. This commit updates to this version of
libgit2 where the arguments are all optional.
bors [Wed, 27 Aug 2014 05:38:17 +0000 (05:38 +0000)]
auto merge of #446 : alexcrichton/cargo/libgit2-again, r=brson
I applied https://github.com/libgit2/libgit2/pull/2414 to a [local branch](https://github.com/alexcrichton/libgit2/tree/mingw-w64-winhttp) and then fixed the build for mingw-w64. The tests pass fine on mingw and I've used https successfully on windows with libgit2 on cargo now.
Alex Crichton [Tue, 26 Aug 2014 18:31:28 +0000 (11:31 -0700)]
Update git2-rs with mingw support
An upstream PR for libgit2 was applied locally, modified to build, and then
git2-rs was updated to use this small for of libgit2. This adds https support
via winhttp on mingw for windows users.
bors [Wed, 27 Aug 2014 02:51:45 +0000 (02:51 +0000)]
auto merge of #444 : alexcrichton/cargo/issue-54, r=brson
This generates errors for malformed semver versions during the decoding process
rather than later in the convertion to a package id. This also cuts down on the
large number of derived traits to only what's necessary.
bors [Wed, 27 Aug 2014 02:17:17 +0000 (02:17 +0000)]
auto merge of #423 : alexcrichton/cargo/cargo-package, r=brson
This command will assemble the current package into a tarball ready for
uploading to the cargo registry. Currently no further verification is done
beyond packaging the local repository into a tarball, but in the future this
could execute other operations such as api stability tools.