Commit Graph

13 Commits

Author SHA1 Message Date
Ivan Petkov
fd86b78f5f
vendorCargoRegistries: warn when registry names are not found (#716) 2024-10-07 16:39:36 -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
Ivan Petkov
54fe6fed44
vendorCargoDeps: allow arbitrary overrides when vendoring sources (#615) 2024-05-18 23:39:46 +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
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
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
49141d2b37
Import groupBy from lib not builtins
* lib.groupBy will default to builtins.groupBy if available, so it is
  safer to use
2022-06-07 14:51:20 -07:00
adisbladis
a1e56fba69 Stop passing around fromTOML
It's a builtin that we can just use directly.
2022-06-03 02:01:02 +08:00
Ivan Petkov
4bd60ab128
Drop compatibility for Nix versions below 2.8.1 2022-06-01 17:05:52 -07:00
Ivan Petkov
762784a8c5
Add compatibility fallback for builtins.groupBy 2022-02-20 14:20:21 -08:00
Ivan Petkov
e2c665091e
Add test that source prefix remapping works 2022-02-09 20:54:56 -08:00
Ivan Petkov
1ab0cad98c
Split out registry vendoring to vendorCargoRegistries 2022-02-06 17:16:49 -08:00