Commit graph

294 commits

Author SHA1 Message Date
dependabot[bot]
059feac06f Bump regex from 1.1.8 to 1.5.5 in /test/fast/simple-dep-patched/fixtures
Bumps [regex](https://github.com/rust-lang/regex) from 1.1.8 to 1.5.5.
- [Release notes](https://github.com/rust-lang/regex/releases)
- [Changelog](https://github.com/rust-lang/regex/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rust-lang/regex/compare/1.1.8...1.5.5)

---
updated-dependencies:
- dependency-name: regex
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-06-07 12:12:33 +02:00
ranfdev
69daaceebe Make dummy-src respect cargo fmt 2022-05-24 19:34:10 +02:00
Patryk Wychowaniec
94beb7a3ed Add support for the postInstall hook
During compilation, we build two derivations - one for the dependencies
and another for the user's crate itself. Passing `postInstall` to
`buildPackage` pass-throughs it into both derivations, which is not what
most users would probably expect.

This commit adds `postInstall` as an explicit configuration option (so
that it's neatly documented), zeroing it out for the dependencies-only
derivation.

I don't think there's any use case for something like `postInstallDeps`,
so it's not introduced here.

Closes https://github.com/nix-community/naersk/issues/237
2022-05-16 19:33:31 +02:00
Patryk Wychowaniec
66883c7d6d readme: Fix ./script/gen
I've accidentally broken the script during the recent test refactoring,
since now test.nix doesn't evaluate to an attrset.
2022-05-16 19:33:31 +02:00
Patryk Wychowaniec
f21309b38e refactor: Refactor tests into separate files 2022-05-03 12:41:13 +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
Patryk Wychowaniec
8cc3794788 chore: Add myself to .github/CODEOWNERS 2022-04-16 11:37:57 +02:00
Patryk Wychowaniec
d626f73332 code review: allRefs -> gitAllRefs, refresh README 2022-04-04 20:16:32 +02:00
Florian Franzen
4c9c275343 build: unpack only named git deps (#1)
Instead of unpacking all crates in a git dep, this only unpacks the
crates specified in the cargo lock file.
2022-04-04 20:16:32 +02:00
Yusuf Bera Ertan
99c7fce671 feat: optional submodule fetching 2022-04-04 20:16:32 +02:00
Yusuf Bera Ertan
8be5c0059d feat: simplify git dependency detection by only using cargo lock, allRefs support 2022-04-04 20:16:32 +02:00
Patryk Wychowaniec
e30ef9a5ce readme: Remove invalid link for Comparison 2022-03-29 11:01:30 +02:00
Maximilian Bosch
2fc8ce9d3c Correctly fetch git tags
Without this change you'd get errors like this when adding a
`git`-dependency to a `Cargo.toml` which is pinned to a tag:

    fetching Git repository 'git://github.com/ma27/nixpkgs-fmt'fatal: couldn't find remote ref refs/heads/v1.2.0-rnix-0.10
    error: program 'git' failed with exit code 128
2021-12-19 22:05:39 +01:00
Ivan Petkov
5415c70453 ci: bump nixpkgs versions
* Update to a more recent revision of nixpkgs
* Add nixpkgs-21.11 for testing
* Add nixpkgs-21.05 for testing
* Drop nixpkgs-20.09, branch is EOL
* Drop nixpkgs-20.05, branch is EOL
* Bump ripgrep-all to v0.9.6 to make tests pass
2021-12-17 10:00:02 +01:00
Anders Christiansen Sørby
ebde51ec0e Fix typo and add target to .gitignore 2021-12-09 13:02:23 +01:00
Anders Christiansen Sørby
ec031156ca Throw a better error when Cargo.lock is missing 2021-12-09 13:02:23 +01:00
Anders Christiansen Sørby
67be312127 Throw a better error when Cargo.lock is missing 2021-12-09 13:02:23 +01:00
Julian Stecklina
c3e56b8a4f ci: run fast tests on pull requests 2021-11-29 17:28:59 +01:00
Julian Stecklina
2380d53c2a doc: fix niv links in README 2021-11-29 17:28:59 +01:00
Julian Stecklina
a4c0a9f748 ci: use upstream install nix action
This also disables uploading artifacts to cachix, because we currently
don't have credentials to upload to a shared cachix repo.
2021-11-29 17:28:59 +01:00
Anders Christiansen Sørby
b043f2447a Replace nmattia with nix-community
The templates should contain a nix-community reference.
2021-11-22 11:29:58 +01:00
Ivan Petkov
93097326ee Fix copying cargo artifacts from deps
* Previously the CARGO_TARGET_DIR environment was set to the `out`
  directory which resulted in cargo placing all of its artifacts there
  instead of the default `target` directory
* Later on, the build scripts would then copy the (empty) `target`
  directory to `$out` resulting in cargo rebuilding the entire
  dependency tree from scratch whenever the top level crate's source was
  changed
* Now we omit the CARGO_TARGET_DIR environment variable and inspect the
  `target` directory for any binaries instead of the `out` directory
2021-11-22 11:27:45 +01:00
Julian Stecklina
5378c7de4d ci: update CODEOWNERS
Relates to #206.
2021-11-22 11:07:59 +01:00
Nicolas Mattia
55c4c0288e Try fixing CI 2021-11-15 10:30:30 +01:00
Sandro Stikić
074d81b1a4 Fix dependency builds being non-reproducible 2021-11-05 10:10:00 +01:00
Eli Flanagan
5bed2dbf07 ci: attempt to fix readme test
From what I can tell the readme test is failing because the config.nix differs from the README.md source

To regenerate the README, run:
```sh
./script/gen
```
and commit the results.
2021-11-01 15:38:16 +01:00
zimbatm
0d2ce479df install-nix: use the org-level cache
Fixes #196
2021-10-28 20:15:51 +02:00
zimbatm
3d3542a3fe install-nix: fix shellcheck warnings 2021-10-28 20:15:51 +02:00
Van Tuan Vo
ee7edec50b Add support for aarch64-darwin 2021-09-22 00:18:17 +01:00
Dawid Ciężarkiewicz
08afb3d1db Don't rely on unstable flags 2021-09-07 10:44:10 +02:00
Nicolas Mattia
df71f5e4ba Revert "Don't rely on unstable flags."
This reverts commit f9e6e8dd78. We should
`export CARGO_TARGET_DIR`, otherwise subsequent `cargo` calls will
rebuild everything (because they won't find the target dir).
2021-08-23 10:26:39 +02:00
Dawid Ciężarkiewicz
f9e6e8dd78 Don't rely on unstable flags. 2021-08-23 09:54:46 +02:00
figsoda
e09c320446 fix typo 2021-06-17 12:50:34 +02:00
zimbatm
4f7426c362 ci: run all tests on master
Some tests like the wasm one were never executed because they are
neither --fast, nor tested in the main CI.

This copies the fast.yml into test.yml, minus the --fast flag.
2021-06-10 13:30:58 +02:00
Jude Taylor
e8061169e1 add libiconv unconditionally 2021-06-04 14:38:02 +02:00
Nicolas Mattia
a3f40fe42c Make sure patched dependencies are left intact
Fixes #170
2021-05-06 17:48:50 +02:00
Nicolas Mattia
32e3ba39d9 Update README 2021-04-19 16:59:25 +02:00
Gregory C. Oakes
59bcaf4c47 Fix windows executables not having .exe suffix. 2021-04-19 16:49:26 +02:00
Milan Pässler
683f785848 add cargoDocOptions and cargoDocCommands 2021-04-19 16:47:23 +02:00
Gregory C. Oakes
380e143955 doc(flake): add examples and templates for cross compilation
This implements very basic examples of how to configure a project to
build mingw-w64 and static musl targets.
2021-04-19 16:45:58 +02:00
Nicolas Mattia
b3b099d669 Fix picking wrong git dep
We were using the first encountered dependency _by name_ from the
lockfile, although the revision may not have been correct.
2021-04-10 17:29:01 +02:00
Jörg Thalheim
e0fe990b47 Revert "make fetchgit work when not fetching from master"
This reverts commit 79129b5c16.

This fixes https://github.com/nmattia/naersk/issues/149
2021-03-03 16:30:51 +01:00
oxalica
a2a4b60a9e Avoid accidentally pulling std for no-std crates 2021-02-26 11:01:05 +01: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
jD91mZM2
6e149bfd72 Support flake-based workspaces
Flake sources are nix derivations, which means they automatically get
made read-only. This causes overwriting Cargo.toml and potentially
build.rs fail. The cure to this is to either chmod the sources after
copy, or in this case copy without preserving the file's original mode.
2021-02-01 16:19:24 +01:00
Jan Tojnar
f744d2f193 treewide: pkgconfig → pkg-config
The alias is now deprecated in Nixpkgs.
2021-02-01 16:18:21 +01:00
Jan Tojnar
3e223a7401 treewide: stdenv.lib → lib
The alias has been deprecated.

https://github.com/NixOS/nixpkgs/issues/108938
2021-02-01 16:18:21 +01:00
Léo Gaspard
79129b5c16 make fetchgit work when not fetching from master
This is required so that fetching dependencies from a feature branch is
possible.

See also https://github.com/NixOS/nix/pull/3408
2021-01-26 15:37:44 +01:00
Yusuf Bera Ertan
79a613f3b5 fix: renamed dependencies breaking matchByName 2021-01-18 14:48:59 +01:00
Yusuf Bera Ertan
4615814c20 fix: no rev found 2021-01-18 14:48:59 +01:00