10 Commits

Author SHA1 Message Date
Eric Huss
34307c6122 Stabilize publish-lockfile. 2019-06-10 13:19:18 -07:00
Jethro Beekman
0e0d968825 Update #[test] attribute on all tests in the testsuite
sed -i 's/^#\[test\]/#[cargo_test]/' $(rg -l '^#\[test\]')

Manual fixes:
* proc_macro::proc_macro_doctest
2019-06-07 12:41:26 -07:00
Eric Huss
7d202307ce Include Cargo.lock in package checks.
This includes `Cargo.lock` in the git dirty check. It explicitly excludes
`Cargo.lock` as an untracked file, since it is not relevant for the dirty check;
it is only checked if it is committed to git.

This also adds `Cargo.lock` to the "did anything modify this" check during
verification. I don't see a reason to exclude it (particularly since ephemeral
workspaces do not save the lock file).

Also add "Archiving: Cargo.lock" to the verbose output.
2019-04-17 14:06:05 -07:00
Eric Huss
5553284d05 Avoid multiple index updates.
This also restores the Cargo.lock update during packaging.
2019-04-16 11:03:20 -07:00
Eric Huss
753b03f652 Alter cargo package Cargo.lock modification note.
Try to make it clearer that it is not modifying the actual Cargo.lock file, but
the one that is being stored in the .crate file.
2019-04-16 09:06:59 -07:00
Eric Huss
6eb55abe2c cargo package: Change lock file updates from warning to requiring -v. 2019-04-16 08:54:24 -07:00
Eric Huss
c03c85ad49 publish-lockfile: Change default to true.
The feature still needs to be enabled.
2019-04-16 08:54:24 -07:00
Eric Huss
5f616eb18e Add warnings for yanked dependencies.
This only applies for `cargo package/publish` with the publish-lockfile feature,
or `cargo install --locked`.
2019-04-16 08:54:24 -07:00
Eric Huss
27932ead44 publish-lockfile: Always check Cargo.lock is up-to-date.
This changes it so that `cargo package` will make sure the Cargo.lock file is
in sync with the Cargo.toml that is generated during packaging. This has several
points:

- This makes the Cargo.lock more accurately reflect what would be locked
  if a user runs `cargo install` on the resulting package.
- In a workspace, this removes irrelevant packages from the lock file.
- This handles `[patch]` dependencies and dual-source dependencies (like
  path/version).
- Warnings are generated for any differences in the lock file compared to the
  original.

This has a significant change in how `cargo package` works. It now
unconditionally copies the package to `target/package`. Previously this was only
done during the verification step. This is necessary to run the resolver against
the new `Cargo.toml` that gets generated.
2019-04-16 08:54:24 -07:00
Eric Huss
ebb5764ad8 Move publish-lockfile tests to a dedicated file. 2019-04-16 08:54:24 -07:00