Commit Graph

19 Commits

Author SHA1 Message Date
Benjamin Hipple
05343f6ff1 rust: remove legacy cargo fetcher
We have now migrated every single Rust package in NixPkgs! This deletes the
legacy fetcher, which is now unused.

Resolves #79975
2020-03-18 20:12:32 -07:00
Benjamin Hipple
ad30a30488 rustPlatform.fetchCargo: handle custom Cargo.lock patchfiles with validation
Previously, we would asssert that the lockfiles are consistent during the
unpackPhase, but if the pkg has a patch for the lockfile itself then we must
wait until the patchPhase is complete to check.

This also removes an implicity dependency on the src attribute coming from
`fetchzip` / `fetchFromGitHub`, which happens to name the source directory
"source". Now we glob for it, so different fetchers will work consistently.
2020-02-28 18:54:23 -08:00
Jonathan Ringer
3990b914c3 manual: use quoted homepage urls 2020-02-16 09:49:12 -08:00
Benjamin Hipple
131a32a5af rust: update docs on legacyCargoFetcher; remove unnecessary defaults
As mentioned in #79975, the default on `legacyCargoFetcher` if left unspecified
is now `false`.
2020-02-15 22:07:47 -08:00
Benjamin Hipple
2115a2037c fetchcargo: use flat tar.gz file for vendored src instead of recursive hash dir
This has several advantages:

1. It takes up less space on disk in-between builds in the nix store.
2. It uses less space in the binary cache for vendor derivation packages.
3. It uses less network traffic downloading from the binary cache.
4. It plays nicely with hashed mirrors like tarballs.nixos.org, which only
   substitute --flat hashes on single files (not recursive directory hashes).
5. It's consistent with how simple `fetchurl` src derivations work.
6. It provides a stronger abstraction between input src-package and output
   package, e.g., it's harder to accidentally depend on the src derivation at
   runtime by referencing something like `${src}/etc/index.html`. Likewise, in
   the store it's harder to get confused with something that is just there as a
   build-time dependency vs. a runtime dependency, since the build-time
   src dependencies are tarred up.

Disadvantages are:
1. It takes slightly longer to untar at the start of a build.

As currently implemented, this attaches the compacted vendor.tar.gz feature as a
rider on `verifyCargoDeps`, since both of them are relatively newly implemented
behavior that change the `cargoSha256`.

If this PR is accepted, I will push forward the remaining rust packages with a
series of treewide PRs to update the `cargoSha256`s.
2020-02-10 10:17:29 -05:00
adisbladis
fece3e5ca1
doc: Remove comment advising to install build tooling system-wide
We should not encourage installing build-tooling system-wide but
instead promote nix-shell.
2020-01-23 21:09:30 +00:00
Benjamin Hipple
c2e5ff3fe8 doc: update rust example on buildRustPackage (#77534)
The example in the manual was out of date and didn't use the newer `pname`
convention, which simplifies the fetch call.
2020-01-12 17:19:57 +00:00
Arnout Engelen
07c84f4de2 documentation: drop double 'the' 2019-11-09 10:10:47 +01:00
Jörg Thalheim
56240d7f20
Merge pull request #71899 from decentriq/aslemmer/build-rust-package-add-target
build-support/rust: Add target option
2019-11-01 15:46:47 +00:00
exfalso
bb7184d6a6 buildRustPackage: Add readme comment on target option 2019-11-01 14:19:39 +00:00
Frederik Rietdijk
95dfbe2d63 doc: organize chapters into parts, and reduce toc depth
Reorganize the chapters into parts and reduce the TOC depth to make the
TOC useful again. The top-level TOC is very brief, but that is fine
because every part will have its own TOC.

Section titles of languages/frameworks are also simplified to just
the name of the language/framework.
2019-10-20 13:35:04 +02:00
zimbatm
f8d67ec135
buildRustPackage: add verifyCargoDeps option
One issue with cargoSha256 is that it's hard to detect when it needs to
be updated or not. It's possible to upgrade a package and forget to
update cargoSha256 and run with old versions of the program or
libraries.

This commit introduces `verifyCargoDeps` which, when enabled, will check
that the Cargo.lock is not out of date in the cargoDeps by comparing it
with the package source.
2019-09-30 17:09:52 +00:00
Lorenzo Manacorda
4356b98d85 doc: update nixpkgs-mozilla rev
The previous one didn't work, returning a TOML parse error.
2019-06-08 16:15:32 +02:00
John Ericson
fcce28f1af
docs: Small change to Rust guide to be more cross friendly 2018-12-18 06:09:34 +01:00
worldofpeace
6dae5de436
rust.section.md: remove nixcrate reference
nixcrate is deprecated
2018-09-15 18:38:26 +00:00
John Ericson
0828e2d8c3 treewide: Remove usage of remaining redundant platform compatability stuff
Want to get this out of here for 18.09, so it can be deprecated
thereafter.
2018-08-30 17:20:32 -04:00
Léo Gaspard
af960e5df9
buildRustPackage: add documentation about cargoPatches 2018-08-14 20:09:45 +09:00
Garrett Berg
f7342a3625 docs: extend rust docs (#35587)
- Add example for setting up nix-shell, improve rust docs
- Rust docs: add gcc rust dependencies and fix carnix commands
- Fix a typo with the carnix command.
2018-03-28 02:07:19 +01:00
Graham Christensen
92d53362d4
Move all nixpkgs doc files in to the doc directory
This makes a makefile-driven developer workflow nicer.
2018-03-25 19:52:00 -04:00