Commit Graph

239 Commits

Author SHA1 Message Date
Ivan Petkov
182bbb447a buildTrunkPackage: print warning with current, valid hashes 2024-11-18 13:37:01 -08:00
Ivan Petkov
3096fc35ad buildTrunkPackage: correctly inherit buildPhaseCargoCommand 2024-11-18 13:37:01 -08:00
Rijk van Putten
ef80ead953
Add fileset helpers (#731)
---------

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2024-11-08 12:39:11 -08:00
Ivan Petkov
e47c16b56e
removeReferencesToVendoredSourcesHook: avoid using /dev/fd directly (#737) 2024-11-08 18:36:43 +00:00
Ivan Petkov
f53b0b974f
buildTrunkPackage: set --release=true on newer trunk versions (#736) 2024-11-08 18:25:05 +00:00
Ivan Petkov
c052ed5e84
buildDepsOnly: set CRANE_BUILD_DEPS_ONLY env var when running (#722) 2024-10-12 23:28:15 +00:00
Rebecca Turner
112a80c012
Add cargoDocTest (#720)
---------

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2024-10-12 22:08:18 +00:00
Ivan Petkov
fd86b78f5f
vendorCargoRegistries: warn when registry names are not found (#716) 2024-10-07 16:39:36 -07:00
Ivan Petkov
d3797a7544
cargoDoc: add a fallback search for non-cross-compiled docs (#708) 2024-09-24 20:15:24 -07:00
[eureka@nixos]
96fd12c710
Add taploFmt TOML format function to mkLib (#674)
---------

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2024-08-31 17:27:30 +00:00
Ivan Petkov
63396562b8
Delete dead code 2024-08-29 16:28:27 -07:00
Ivan Petkov
95b42093e5
downloadCargoPackageFromGit: take hash instead of sha256 (#691) 2024-08-29 15:47:52 -07:00
Ivan Petkov
5d6c16530f
downloadCargoPackageFromGit: set fetchLFS when an output hash is defined (#690) 2024-08-29 15:35:39 -07:00
Ivan Petkov
af693bf608
buildPackage: do not add jq to nativeBuildInputs (#685)
Doing so ends up resulting in PKG_CONFIG_PATH changing which may result
in various `*-sys` crates needing to be rebuilt
2024-08-22 16:24:53 -07:00
Nils Harbke
4c6c77920b
Fix positioning of cargoExtraArgs in craneLib.cargoNextest (#678)
Both `cargo nextest run` and `cargo llvm-cov` do not place any cargo
options/flags right behind `cargo <HERE> ...`. All cargo related flags
can be added to the `cargoNextestExtraArgs` attribute. [Issue #675]

After altering `checkPhaseCargoCommand` to use one of two explicit
command strings inside if/else blocks, it is no longer necessary to
default `cmd` to an empty value when `withLlvmCov` is set to `true`.

---------

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2024-08-06 09:07:59 -07:00
Ivan Petkov
b7f607c200
Delete some dead code 2024-08-05 17:42:26 -07:00
Simon Žlender
c873fd2ad8
Fix deeply nested registries (#676)
---------

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2024-08-04 22:10:51 +00:00
Simon Žlender
aa5dcd0518
Splice overrideToolchain (#652)
---------

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2024-06-29 11:29:52 -07:00
Ivan Petkov
0095fd8ea0
removeReferencesToVendoredSources: handle cargoVendorDir not pointing to store (#646) 2024-06-15 17:55:13 +00: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
ad21f86e47
Drop support for nixpkgs-23.11 (#635) 2024-06-02 20:52:54 -07:00
Ivan Petkov
9787dc25b2
lib: use makeScopeWithSplicing' instead of makeScope (#634) 2024-06-03 02:48:19 +00:00
Rebecca Turner
480dff0be0
Fix xargs signIfRequired (#631)
`signIfRequired` is a shell function, not an executable, so we can't
call it with `xargs`.

---------
Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2024-05-29 23:24:23 +00:00
Ivan Petkov
35bc915249
cleanCargoToml: also clean variants using underscores (#626) 2024-05-26 17:41:17 +00:00
Ivan Petkov
701dbc191c
removeReferencesToVendoredSources: cache vendorDir crawling (#625)
There is no reason to repeatedly crawl the vendor directories for each
installed file, we can easily cache the results once up front.
2024-05-25 23:45:24 +00: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
5b0b062ff0
buildTrunkPackage: disable version checks by default (#616) 2024-05-19 00:06:59 +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
Simon Žlender
9b32adff97
mkDummySrc: ignore clippy warnings in dummyrs (#587)
---------

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2024-04-21 03:57:27 +00:00
Ivan Petkov
b47c4078b0
vendorCargoDeps: handle unused patch dependencies (#581) 2024-04-07 10:45:14 -07:00
Ivan Petkov
ada0fb4dcc
Add a warning if an unsupported version of nixpkgs is used (#571) 2024-03-29 03:09:12 +00:00
Ivan Petkov
270c7d60d3
inheritCargoArtifactsHook: correctly handle nested CARGO_TARGET_DIR (#561) 2024-03-22 23:32:09 +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
Vetle Brænd
865458e532
vendorMultipleCargoDeps: use backwards compatible groupBy (#546)
* builtins.groupBy is not included until nix version 2.5 and is only
  used as an optimization. Using lib.groupBy will retain compatibility
  with older versions of nix.
2024-03-08 19:53:46 +00:00
greaka
81c393c776
fix: allow registries in vendorMultipleCargoDeps as documented (#540)
---------

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2024-03-05 03:53:19 +00:00
Ivan Petkov
f2926e34a1
chore: replace overrideScope' with overrideScope (#517) 2024-02-08 03:38:28 +00:00
Ivan Petkov
c7bb4ed1f3
cleanCargoToml: strip out [lints] definitions when cleaning (#516) 2024-02-08 03:34:33 +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
Ivan Petkov
c5a3c5dac3
crane-utils: bump dependencies (#508) 2024-01-28 19:22:09 +00:00
Ivan Petkov
960d350770
vendorCargoDeps: manually splice packages to avoid cross build issues (#507)
* Source vendoring is passed as a standalone attribute to
  `mkCargoDerivation`, meaning it does not automagically get spliced
  with the correct local/cross system inputs (i.e. what would happen if
  it was a `depsBuildBuild` entry)
* To fix this we need to make sure that `vendorCargoDeps` and all of its
  transitive dependencies always use `runCommand` (and friends) from
  their `pkgsBuildBuild` equivalent. This should always be safe to do
  (even for cross-builds) since this amounts to building up a bunch of
  sources which will be read by the build system
* Unfortunately I had to manually specify `pkgsBuildBuild.whatever` in
  multiple places as I could not get things to work by messing with the
  `callPackage` definition. Perhaps we should be using
  `makeScopeWithSplicing'` instead of `makeScope` when constructing the
  library, but I couldn't get it working (and I couldn't find any decent
  docs on how to use it online) so this will make do for the time being.
2024-01-28 19:08:44 +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
Adam Curtis
751290c945
fix: add #[allow(unused_extern_crates)] to dummy.rs (#501) 2024-01-27 02:36:30 +00:00
Leonardo Eugênio
2a5136f14a
buildTrunkPackage: Add "wasm-bindgen-cli" argument (#363) 2023-12-20 08:24:53 -08:00
Ivan Petkov
c53a8c071d
buildDepsOnly: pass --no-run to cargo test by default (#470) 2023-11-30 00:43:47 +00:00
danjl1100
faf6a81da1
buildTrunkPackage - separately export and declare shell variables (SC2155) (#458)
---------

Co-authored-by: Ivan Petkov <ivanppetkov@gmail.com>
2023-11-26 18:28:14 +00:00
Ivan Petkov
f1c2fe6716
installCargoArtifactsHook: allow specifying additional zstd args (#450) 2023-11-05 20:34:43 +00:00