| 7 Nov 2021 |
legendofmiracles | Is it off the table to bring it back if needed? | 04:48:02 |
andi- | legendofmiracles: why is it needed and why does the rust project fail on newer compilers? (I've seen such issues myself but usually the rust community tries to avoid that situation) | 14:48:16 |
| wackbyte joined the room. | 18:40:16 |
| 8 Nov 2021 |
| jonringer joined the room. | 13:02:15 |
legendofmiracles | How does nix handle cargo patches, like here: https://github.com/a-b-street/abstreet/blob/4717c3c8f7072cd0efc6c49403f724b95f8738fe/Cargo.toml#L39 | 16:44:56 |
legendofmiracles | * How does nix handle cargo patches, like here?: https://github.com/a-b-street/abstreet/blob/4717c3c8f7072cd0efc6c49403f724b95f8738fe/Cargo.toml#L39 | 16:45:02 |
Yureka (she/her) | If you use buildRustPackage, It mostly doesn't interact with them | 16:45:35 |
legendofmiracles | Because it's in the lockfile? | 16:46:00 |
Yureka (she/her) | If you use cargoSha256, then Nix doesn't care about the lockfile or Cargo.toml at all. It just runs cargo vendor, and then later cargo build with the vendored sources. | 16:47:21 |
Yureka (she/her) | If you use the importCargoLock / cargoLock.lockFile thing, the cargo vendor part is replaced by a Nix derivation that downloads all the things in the lockfile, which is just the same as what cargo vendor would do | 16:48:41 |
Yureka (she/her) | * If you use the importCargoLock / cargoLock.lockFile thing, the cargo vendor part is replaced by a Nix derivation that depends on fetchurl/fetchgit downloads of all the things in the lockfile, which is just the same as what cargo vendor would do | 16:49:04 |
Yureka (she/her) | Either way the patch entries in Cargo.toml should be honored | 16:49:19 |
jonringer | if you do need to apply patches before vendoring, you can declare them with cargoPatches | 16:49:21 |
Yureka (she/her) | I don't think the question was about patching Cargo.toml / Cargo.lock | 16:50:13 |
legendofmiracles | building
Updating git repository `https://github.com/georust/geo`
error: failed to sync
Caused by:
failed to load pkg lockfile
Caused by:
failed to resolve patches for `https://github.com/rust-lang/crates.io-index`
Caused by:
failed to load source for dependency `geo`
Caused by:
Unable to update https://github.com/georust/geo?branch=mkirk/concave-hull-fix-empty-crash#243ad260
Caused by:
object not found - no match for id (243ad260ba9dec5fe6ab5d184ac625f6ed01b53b); class=Odb (9); code=NotFound (-3)
Traceback (most recent call last):
File "/nix/store/c7cph7saraq1zq690ch368bjfdlmaypd-cargo-vendor-normalise/bin/.cargo-vendor-normalise-wrapped", line 42, in <module>
main()
File "/nix/store/c7cph7saraq1zq690ch368bjfdlmaypd-cargo-vendor-normalise/bin/.cargo-vendor-normalise-wrapped", line 17, in main
assert list(data.keys()) == ["source"]
AssertionError
| 16:50:21 |
legendofmiracles | The reason I asked is because of these errors | 16:50:31 |
legendofmiracles | but now that I look at it again, it doesn't seem to have anything to do with nix | 16:51:15 |
Yureka (she/her) | maybe the lockfile is outdated? | 16:51:22 |
Yureka (she/her) | or some git branch/tag was yanked? | 16:51:30 |
legendofmiracles | Or commit | 16:51:37 |
legendofmiracles | I'll play around a bit, thanks for the hint | 16:51:52 |
lourkeur (nix btw) | In reply to @jonringer:matrix.org if you do need to apply patches before vendoring, you can declare them with cargoPatches Interesting. I didn't know that so I used this pattern instead recently. Would cargoPatches be preferable in this case?
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src patches;
name = "${pname}-${version}";
```https://github.com/NixOS/nixpkgs/pull/144733/files#diff-a35bcf6b38716a31d2a5ea43b4ff2e6217c591817597572a22d560fa86ba0bb8R28
| 16:54:11 |
lourkeur (nix btw) | In reply to @jonringer:matrix.org if you do need to apply patches before vendoring, you can declare them with cargoPatches * Interesting. I didn't know that so I used this pattern instead recently. Would cargoPatches be preferable in this case?
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src patches;
name = "${pname}-${version}";
}
https://github.com/NixOS/nixpkgs/pull/144733/files#diff-a35bcf6b38716a31d2a5ea43b4ff2e6217c591817597572a22d560fa86ba0bb8R28
| 16:54:22 |
lourkeur (nix btw) | * Interesting. I didn't know that so I used this pattern instead recently. Would cargoPatches be preferable in this case?
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src patches;
name = "${pname}-${version}";
}
https://github.com/NixOS/nixpkgs/pull/144733/files#diff-a35bcf6b38716a31d2a5ea43b4ff2e6217c591817597572a22d560fa86ba0bb8R28
| 16:54:39 |
lourkeur (nix btw) | * Interesting. I didn't know that so I used this pattern instead recently. Would cargoPatches be preferable in this case?
cargoDeps = rustPlatform.fetchCargoTarball {
inherit src patches;
name = "${pname}-${version}";
sha256 = "...";
}
https://github.com/NixOS/nixpkgs/pull/144733/files#diff-a35bcf6b38716a31d2a5ea43b4ff2e6217c591817597572a22d560fa86ba0bb8R28
| 16:54:57 |
Yureka (she/her) | should be the same thing | 16:55:00 |
legendofmiracles | In reply to @legendofmiracles:matrix.org I'll play around a bit, thanks for the hint I can't, my rust version is 1.55 but this program needs 1.56 | 17:03:26 |
Yureka (she/her) | staging-next has 1.56 | 17:04:10 |
Yureka (she/her) | it's in the binary cache | 17:05:14 |
Yureka (she/her) | nix build -f "<nixpkgs>" rustc -I nixpkgs=https://github.com/nixos/nixpkgs/archive/staging-next.tar.gz
| 17:05:21 |