Commit Graph

105 Commits

Author SHA1 Message Date
Simon Žlender
aa5dcd0518
Splice overrideToolchain (#652)
---------

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2024-06-29 11:29:52 -07:00
Ivan Petkov
a3f0c63eed
Try to avoid IFD in vendorCargoDeps and crateNameFromCargoToml; also avoid recommending nesting cleanCargoSource and path (#641)
We don't need to nest `cleanCargoSource` and `path` just to populate a
default value for `name`. As they both ultimately delegate to
`builtins.path`, the nesting can lead to IFD in situations which are
otherwise avoidable
2024-06-10 20:53:46 -07:00
Ivan Petkov
b7a1655564
Fix crate vendoring to not run the default fixup phase (#619) 2024-05-19 21:59:49 +00:00
Ivan Petkov
54fe6fed44
vendorCargoDeps: allow arbitrary overrides when vendoring sources (#615) 2024-05-18 23:39:46 +00:00
Ivan Petkov
33d5862dbb
crateNameFromCargoToml: support selecting a name from metadata (#606) 2024-05-04 19:36:42 +00:00
x10an14
23c2d75556
cargoDoc: support docInstallRoot to influence installation behavior (#603)
---------

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2024-05-04 17:49:24 +00:00
Jean
cd1bb8fb22
Remove cargoExtraArgs from cargoAudit (#602)
---------

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2024-05-04 17:20:06 +00:00
Nick Boultbee
cc1c68d5a3
Fix typo in cargoNextestExtraArgs docs (#599) 2024-05-01 01:33:35 +00:00
Ivan Petkov
55187a8218
cargoNextest: support withLlvmCov (#560)
* This adds a convenience method of running `nextest` within `cargo
  llvm-cov` without having to wire up the internal details manually
2024-03-22 22:39:45 +00:00
Ivan Petkov
f1dabc4aba
crateRegistries: use crates.io's CDN to download sources (#548)
https://blog.rust-lang.org/2024/03/11/crates-io-download-changes.html
2024-03-19 14:55:28 -07:00
Ivan Petkov
f2926e34a1
chore: replace overrideScope' with overrideScope (#517) 2024-02-08 03:38:28 +00:00
Ivan Petkov
7d5b46c17d
Update docs (#514)
* vendorCargoDeps: update error message to hint towards staging Cargo.lock
* crateNameFromCargoToml: update docs to note directory are not crawled
2024-02-04 19:31:22 +00:00
Charles Hall
0327ca9d77
force buildDepsOnly to produce out only (#493)
This allows multi-output derivations using e.g. `buildPackage` to work.
Without this change, they fail to build because Nix thinks
`buildDepsOnly` is supposed to produce mulitple outputs too, but it
doesn't.

---------

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2024-01-27 17:52:30 +00:00
Leonardo Eugênio
2a5136f14a
buildTrunkPackage: Add "wasm-bindgen-cli" argument (#363) 2023-12-20 08:24:53 -08:00
Ivan Petkov
537ebb11db
docs: add note about avoiding pyo3 rebuilds (#486) 2023-12-19 03:30:44 +00:00
Ivan Petkov
c53a8c071d
buildDepsOnly: pass --no-run to cargo test by default (#470) 2023-11-30 00:43:47 +00:00
Ivan Petkov
3aaa2c5ddb
fix: avoid path starts with illegal character error (#459)
* Looks like Nix 2.19.0 doesn't like it when a path starts with `.` so
  this updates the examples and tests to avoid doing that
2023-11-26 10:15:16 -08:00
Ivan Petkov
f1c2fe6716
installCargoArtifactsHook: allow specifying additional zstd args (#450) 2023-11-05 20:34:43 +00:00
Ivan Petkov
2b1203872d
chore: clean up some dead code warnings (#449) 2023-11-05 18:42:08 +00:00
Ivan Petkov
758ae44222
installCargoArtifactsHook: change default installation mode to use-zstd (#442) 2023-10-20 22:28:41 +00:00
Aidan Gauland
f8f1b3fc5b
cargoLib.cargoDeny: init (#440)
---------

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2023-10-20 21:45:03 +00:00
Ivan Petkov
6b229eec8a
fix: correct installFromCargoBuildLogHook docs 2023-10-20 07:11:01 -07:00
Ivan Petkov
eb5034b6ee
replaceCargoLockHook: run as prePatchHook not postUnpack (#434) 2023-10-17 03:31:33 +00:00
Ivan Petkov
f2b70c85d5
devShell: add clippy and rustfmt from the current toolchain (#432) 2023-10-17 00:24:15 +00:00
simonzkl
47f84c5b60
removeReferencesToVendoredSources: sign aarch64-darwin binaries (#418)
---------

Co-authored-by: Simon Zlender <simonz@btcx.com>
Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2023-10-15 20:09:08 +00:00
Ivan Petkov
4dcf584de1
mkCargoDerivation: replace Cargo.lock with contents of cargoLock (#425)
* The vendoring helpers already accept a `cargoLock` override, so
  automatically linking it in the derivation (if set) makes it a bit
  easier without having the caller manually do the link themselves
2023-10-15 01:42:24 +00:00
Ivan Petkov
ce0a13f8ba
cargoAudit: ignore yanked crates by default (#423)
* Checking for yanked crates requires network access (to ping the
  crates.io index) which won't work from inside the sandbox
2023-10-14 21:50:48 +00:00
Marijan Petričević
a863ce3c79
fix #404 - lib/cargoTarpaulin: lowercase --out xml argument (#405) 2023-10-01 11:22:09 -07:00
Jörg Thalheim
16f5732c14
allow to pass outputHashes to crane (#266)
This makes it possible to evaluate crane in a nixos test without network
as well as allow to backup all fetched input derivations properly in a
binary cache, whereas fetchGit will fallback to downloading from a
repository, which also requires a `git` binary to be present.

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2023-09-22 04:08:53 +00:00
Rebecca Turner
7b92b595c9
Add devshell helper (#378) 2023-09-03 10:33:10 -07:00
Ivan Petkov
ecf151658e
cargoDoc: do not install cargo artifacts by default (#381)
* Also install generated docs
2023-09-03 10:29:13 -07:00
Ivan Petkov
43db881168
various: change cargoExtraArgs defaults to include --locked (#373) 2023-08-27 19:17:58 +00:00
Leonardo Eugênio
1b8653ad52
Trunk: use native dart-sass (#360)
Replace the javascript version of dart-sass with a native binary version.
Should improve built times and reduce disk usage.

---------

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2023-08-11 00:38:14 +00:00
Ivan Petkov
116b32c30b
inheritCargoArtifactsHook: allow disabling symlink behavior (#345) 2023-06-21 01:13:46 +00:00
Ivan Petkov
bd65e0e473
inheritCargoArtifactsHook: symlink dependency rlib and rmeta files (#344)
* cargoTarpaulin: do not clean by default

---------

Co-authored-by: Philipp Mildenberger <philipp@mildenberger.me>
Co-authored-by: Philipp Mildenberger <philipp.mildenberger@artfabrik.at>
2023-06-19 21:50:17 +00:00
James Baker
75f7d715f8
Natively support sparse registries (#324)
With Cargo 1.68.0, sparse registries were made stable. With sparse
registries, index metadata is stored in an HTTP api rather than in
a git repository.

As relevant to Crane, the relevant changes are mostly that registries
do not always start with `registry+` and mostly start with `registry+`
or `sparse+` depending on whether the registry is sparse or not.

This PR adjusts the core of Crane to differentiate between `registry`
and `sparse`, and adds a new sparse registry factory to make things
easy.

---------

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2023-06-13 02:03:18 +00:00
Ivan Petkov
057d95721e
Add support for installing dylib crate types (#340)
---------

Signed-off-by: Roman Volosatovs <rvolosatovs@riseup.net>
Co-authored-by: Roman Volosatovs <rvolosatovs@riseup.net>
2023-06-08 01:00:25 +00:00
Uosis
3acc7230ee
Clean install hooks from buildDepsOnly invocation (#334)
---------

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2023-06-07 05:38:53 +00:00
Leonardo Eugênio
db21a44eb0
Trunk support (#299)
[Trunk](https://trunkrs.dev) is a tool that allow you to build web apps
using Rust and webassembly, including compiling scss, and distributing
other assets.

Adds `craneLib.buildTrunkPackage`, a function that builds a Trunk
project returning a directory with the resulting dist files for that
project

---------

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2023-04-29 12:34:39 -07:00
Ivan Petkov
0c9f468ff0
buildPackage: don't inherit installPhase when calling buildDepsOnly (#297) 2023-04-11 01:37:58 +00:00
Ivan Petkov
f491bee4f9
Add support for building standard library crates (#287)
* vendorCargoRegistries: accept `registries` from the caller if specified
* Add vendorMultipleCargoDeps
2023-04-02 17:57:17 +00:00
Ivan Petkov
141943d26a
docs: replace references to lib with craneLib (#274)
* `lib` is already a common import representing `pkgs.lib`
* Consistently using `craneLib` in the docs and examples will ensure
  better clarity
2023-03-20 04:13:23 +00:00
Ivan Petkov
6fd78bc66a
Add path as a convenience wrapper around builtins.path (#273) 2023-03-19 20:57:15 -07:00
figsoda
77435dad14
feat: add cargoLockParsed option (#270)
---------

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2023-03-20 00:33:17 +00:00
figsoda
475de74fa2
feat: add cargoLlvmCov (#267)
* feat: add cargoLlvmCov
* cargoHelperFunctionsHook: prefer `--release` over `--profile release`
Some tools (e.g. cargo-llvm-cov) don't understand `--profile release` as
an alias for `--release`, so `cargoWithProfile` should prefer passing
`--release` when `$CARGO_PROFILE` == "release"

---------

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2023-03-19 23:44:14 +00:00
Ivan Petkov
6fb400ec63
crateNameFromCargoToml: warn when values can't be found (#237) 2023-02-12 00:39:43 +00:00
Ivan Petkov
8c34e5ecad
docs: Clarify docs and add example of setting custom environment variable (#233)
Clarify docs and add example of setting custom environment variable
2023-02-09 00:27:05 +00:00
Ivan Petkov
a41a7d3f81
Update docs to clarify buildPackage installation behavior (#225) 2023-01-22 00:50:20 +00:00
Ivan Petkov
0428181b7b
cleanCargoSource: fix documentation typo (#177) 2022-12-01 00:14:59 +00:00
Ivan Petkov
2b0be4c1c4
mkDummySrc: work with uefi targets by default, and allow downstream customization (#174)
* mkDummySrc: also include `no_std` attrs for target_os = uefi
* buildDepsOnly: only check with `--all-targets` if doCheck enabled
* mkDummySrc: allow customizing dummy Rust file contents
2022-11-28 03:23:35 +00:00