Commit graph

13 commits

Author SHA1 Message Date
Patryk Wychowaniec
0e758b9648 Use custom writeTOML on older nixpkgs 2023-08-16 11:32:57 +02:00
Patryk Wychowaniec
eb2bdf3b0f Use TOML serializer from nixpkgs
Closes https://github.com/nix-community/naersk/issues/263
2023-08-16 11:32:57 +02:00
Patryk Wychowaniec
6944160c19 Improve unpacking dependencies 2022-09-03 17:53:20 +02:00
Patryk Wychowaniec
e8f9f8d037 Support dependencies with slashes in their names
When a dependency gets fetched from Git, it's possible for its name to
contain slashes - e.g. because the dependency's branch name contains
one:

```
something-something = { git = "...", branch = "JIRA-123/dev" }
```

Currently, because we don't sanitize those slashes, trying to compile
such `Cargo.toml` / `Cargo.lock` would fail - e.g. given a dependency
from branch `JIRA-123/dev`, we'd try to extract it into path
`JIRA-123/dev` instead of something flat such as `JIRA-123_dev`.

This commit fixes this issue by sanitizing all the `nkey`s - basically,
for all dependency paths, we replace `/` with `_`.

The choice of underscore is arbitrary, just seemed like a good fit.
2022-04-18 09:12:25 +02:00
Cole Helbling
1a9e5ddc51 fix(builtins/to-toml): support int type
Fixes https://github.com/nmattia/naersk/issues/148.

"As of rust-lang/cargo@7dd9872, Cargo adds a new `version = 3` key to
the lockfile's top level"
2021-02-18 14:35:51 +01:00
Nicolas Mattia
b0756e84cf Implement toToml for 'int' 2020-01-14 19:52:10 +01:00
Nicolas Mattia
5958f39351 Use builtins.pathExists when applicable 2019-11-21 10:34:35 +01:00
zimbatm
9a72012540
stylistic changes
these are not mandated by nixpkgs-fmt
2019-11-19 20:12:42 +00:00
zimbatm
d11a8a036c
format nix code with nixpkgs-fmt v0.6.1 2019-11-19 20:12:36 +00:00
Bas van Dijk
8d59785ca6 Pass cargolock/cargotoml via file instead of via env var
Apparently the cargolock env var can become too big so we replace it
with a file. This fixes the following error:

  building
  '/nix/store/s8bv90acizsyvh1s9gk7yvpiyw2gcpnx-dfinity-application-and-others-deps.drv'...
  while setting up the build environment: executing
  '/nix/store/cinw572b38aln37glr0zb8lxwrgaffl4-bash-4.4-p23/bin/bash':
  Argument list too long

See the following on the background of why env vars can become too big:
https://stackoverflow.com/questions/28865473/setting-environment-variable-to-a-large-value-argument-list-too-long
2019-08-26 11:05:41 +02:00
Nicolas Mattia
2692cfbfc1 Avoid IFD as much as possible 2019-07-31 15:53:30 +02:00
Nicolas Mattia
104df3fe88 Fixup toTOML 2019-07-31 15:07:16 +02:00
Nicolas Mattia
bdf64f6034 wip 2019-07-31 13:41:34 +02:00