Commit graph

8 commits

Author SHA1 Message Date
André Rocha c2ff988c9f Reorganize integration tests as one crate with many modules. Issue #4867. 2018-02-21 13:33:51 -05:00
Chris Swindle d43bf9c5f4 Merge branch 'master' of github.com:rust-lang/cargo into alt-registries 2017-10-24 20:54:59 +01:00
NODA, Kai d43ee1dd22
cargotest/support: remove internal mutability in favor of switching types
Remove is_build: Cell<bool> from ProjectBuilder and introduce a new type Project.

is_build==false <-> ProjectBuilder
is_build==true <-> Project

Also add #[must_use] to ProjectBuilder to confirm its instances are surely consumed by its build() method to produce Project.

The same goes for RepoBuilder.

ProjectBuilder::cargo_process() was removed as its design heavily depended on the internal mutability.

Signed-off-by: NODA, Kai <nodakai@gmail.com>
2017-10-10 16:47:12 +08:00
Without Boats 8a70ffb03b Fix tests (to do with printing). 2017-10-04 15:07:01 -07:00
Carol (Nichols || Goulding) 2490f3fb63 Should not have to specify crates-io registry URL to replace-with
Since cargo knows crates-io's registry URL and, anyway, you're trying to
say that you don't want to use crates-io.
2016-09-26 10:56:19 -04:00
Alex Crichton 4814a84e65 Addressing review comments 2016-08-01 10:53:19 -07:00
Alex Crichton 7fd5243c46 Implement a directory source
This flavor of source is intended to behave like a local registry except that
its contents are unpacked rather than zipped up in `.crate` form. Like with
local registries the only way to use this currently is via the
`.cargo/config`-based source replacement currently, and primarily only to
replace crates.io or other registries at the moment.

A directory source is simply a directory which has many `.crate` files unpacked
inside of it. The directory is not recursively traversed for changes, but rather
it is just required that all elements in the directory are themselves
directories of packages.

This format is more suitable for checking into source trees, and it still
provides guarantees around preventing modification of the original source from
the upstream copy. Each directory in the directory source is required to have a
`.cargo-checksum.json` file indicating the checksum it *would* have had if the
crate had come from the original source as well as all of the sha256 checksums
of all the files in the repo. It is intended that directory sources are
assembled from a separately shipped subcommand (e.g.  `cargo vendor` or `cargo
local-registry`), so these checksum files don't have to be managed manually.

Modification of a directory source is not the intended purpose, and if a
modification is detected then the user is nudged towards solutions like
`[replace]` which are intended for overriding other sources and processing local
modifications.
2016-08-01 10:14:52 -07:00
Alex Crichton c3a9599044 Implement a local registry type
This flavor of registry is intended to behave very similarly to the standard
remote registry, except everything is contained locally on the filesystem
instead. There are a few components to this new flavor of registry:

1. The registry itself is rooted at a particular directory, owning all structure
   beneath it.
2. There is an `index` folder with the same structure as the crates.io index
   describing the local registry (e.g. contents, versions, checksums, etc).
3. Inside the root will also be a list of `.crate` files which correspond to
   those described in the index. All crates must be of the form
   `name-version.crate` and be the same `.crate` files from crates.io itself.

This support can currently be used via the previous implementation of source
overrides with the new type:

```toml
[source.crates-io]
replace-with = 'my-awesome-registry'

[source.my-awesome-registry]
local-registry = 'path/to/registry'
```

I will soon follow up with a tool which can be used to manage these local
registries externally.
2016-08-01 10:14:52 -07:00