!FBuJyWXTGcGtHTPphC:nixos.org

Nix Rust

508 Members
Rust112 Servers

Load older messages


SenderMessageTime
3 Jan 2025
@tomasajt:matrix.orgToma I could implement a .override interface for fetchCargoVendor though I'm not the most fond of that API. 14:38:55
@tomasajt:matrix.orgTomaIt wouldn't fix the issue of not having finalAttrs, but it would be a bit simpler to override14:39:30
@tomasajt:matrix.orgToma *

It is possible, though it wouldn't get a new version value, so it's only ever useful if you use fetchCargoVendor separately.

some-package.overrideAttrs (prevAttrs: {
    cargoDeps = prevAttrs.cargoDeps.overrideAttrs (prevDepsAttrs: {
      vendorStaging = prevDepsAttrs.vendorStaging.overrideAttrs {
        outputHash = "new-hash";
      };
    });
  })

Also, fetchCargoTarball has the same issue when used internally by buildRustPackage, but it's a bit easier to override at least

14:51:57
@tomasajt:matrix.orgToma *

It is possible, though it wouldn't get a new version value, so it's only ever useful if you use fetchCargoVendor separately.

some-package.overrideAttrs (prevAttrs: {
  cargoDeps = prevAttrs.cargoDeps.overrideAttrs (prevDepsAttrs: {
    vendorStaging = prevDepsAttrs.vendorStaging.overrideAttrs {
      outputHash = "new-hash";
    };
  });
})

Also, fetchCargoTarball has the same issue when used internally by buildRustPackage, but it's a bit easier to override at least

14:52:27
4 Jan 2025
@mrvandalo:terranix.orgpalo joined the room.21:28:53
6 Jan 2025
@reflux1291:catgirl.cloudAny (they/any) changed their display name from reflux1291 to Any (reflux1291) (they/any).03:28:41
@frederic:scs.ems.hostFrédéric Christ changed their display name from Frédéric Christ 🎄23.12. - 07.01. to Frédéric Christ.12:32:01
7 Jan 2025
@bemyak:matrix.orgbemyak joined the room.10:29:11
@bemyak:matrix.orgbemyak

Hi, folks! I'm trying to update the version of prisma-engines, but just bumping versions and updating hashes gives me this error:

cargoBuildHook flags: -j 16 --target x86_64-unknown-linux-gnu --offline --profile release -p query-engine -p query-engine-node-api -p schema-engine-cli -p prisma-fmt
error: failed to get `mongodb` as a dependency of package `mongodb-schema-connector v0.1.0 (/var/tmp/nix-build-prisma-engines-6.1.0.drv-0/source/schema-engine/connectors/mongodb-schema-connector)`

Caused by:
  failed to load source for dependency `mongodb`

Caused by:
  Unable to update https://github.com/prisma/mongo-rust-driver.git?branch=RUST-1994%2Fhappy-eyeballs#31e03563

Caused by:
  can't checkout from 'https://github.com/prisma/mongo-rust-driver.git': you are in the offline mode (--offline)

Not sure if it's related, but if I set cargoHash to an empty/invalid valiue, the build seems to proceed further, I can see mondo and other git dependencies being checked out.
But if I use the has it gives me afterwards, the build fails much quicker and mongo is not being cheched out 🤔

10:33:34
@bemyak:matrix.orgbemyak *

Hi, folks! I'm trying to update the version of prisma-engines, but just bumping versions and updating hashes gives me this error:

cargoBuildHook flags: -j 16 --target x86_64-unknown-linux-gnu --offline --profile release -p query-engine -p query-engine-node-api -p schema-engine-cli -p prisma-fmt
error: failed to get `mongodb` as a dependency of package `mongodb-schema-connector v0.1.0 (/var/tmp/nix-build-prisma-engines-6.1.0.drv-0/source/schema-engine/connectors/mongodb-schema-connector)`

Caused by:
  failed to load source for dependency `mongodb`

Caused by:
  Unable to update https://github.com/prisma/mongo-rust-driver.git?branch=RUST-1994%2Fhappy-eyeballs#31e03563

Caused by:
  can't checkout from 'https://github.com/prisma/mongo-rust-driver.git': you are in the offline mode (--offline)

Not sure if it's related, but if I set cargoHash to an empty/invalid valiue, the build seems to proceed further, I can see mondo and other git dependencies being checked out.
But if I use the has it gives me afterwards, the build fails much quicker and mongo is not being cheched out 🤔

10:39:36
@bemyak:matrix.orgbemyak

I've tried switching to the "cargoLock" method, but it fails with the same error:

  cargoLock = {
    lockFile = "${src}/Cargo.lock";
    outputHashes = {
      "barrel-0.6.6-alpha.0" = "sha256-USh0lQ1z+3Spgc69bRFySUzhuY79qprLlEExTmYWFN8=";
      "cuid-1.3.3" = "sha256-RzbBkiWt6uY0EwPuy71HQ+rZTgvMDtmhxA+SHRL3YMQ=";
      "graphql-parser-0.3.0" = "sha256-0ZAsj2mW6fCLhwTETucjbu4rPNzfbNiHu2wVTBlTNe4=";
      "mongodb-3.0.0" = "sha256-1WQgY0zSZhFjt1nrLYTUBrpqBxpCCgKRSeGJLtkE6pw=";
      "mysql_async-0.31.3" = "sha256-2wOupQ/LFV9pUifqBLwTvA0tySv+XWbxHiqs7iTzvvg=";
      "postgres-native-tls-0.5.0" = "sha256-pzMPNZzlvMaQqBu/V3ExPYVnoIaALeUaYJ4oo/hY9lA=";
    };
  };
11:51:32
@bemyak:matrix.orgbemyak *

Hi, folks! I'm trying to update the version of prisma-engines to 6.1.0, but just bumping versions and updating hashes gives me this error:

cargoBuildHook flags: -j 16 --target x86_64-unknown-linux-gnu --offline --profile release -p query-engine -p query-engine-node-api -p schema-engine-cli -p prisma-fmt
error: failed to get `mongodb` as a dependency of package `mongodb-schema-connector v0.1.0 (/var/tmp/nix-build-prisma-engines-6.1.0.drv-0/source/schema-engine/connectors/mongodb-schema-connector)`

Caused by:
  failed to load source for dependency `mongodb`

Caused by:
  Unable to update https://github.com/prisma/mongo-rust-driver.git?branch=RUST-1994%2Fhappy-eyeballs#31e03563

Caused by:
  can't checkout from 'https://github.com/prisma/mongo-rust-driver.git': you are in the offline mode (--offline)

Not sure if it's related, but if I set cargoHash to an empty/invalid valiue, the build seems to proceed further, I can see mondo and other git dependencies being checked out.
But if I use the has it gives me afterwards, the build fails much quicker and mongo is not being cheched out 🤔

11:55:40
@morj:morj.menMorjDid you build the project outside nix first, to update the cargo lockfile? I believe the reason for failing is as follows: nix rust derivations work by splitting your project in two: the dependencies and the project itself. The dependecies only depend on your lockfile, and the project depends on everything else. When you update the versions, you also need to update the lockfile to trigger the rebuild of deps. If you don't do it, cargo will try to download deps when building the main project, but fail as it's offline11:56:18
@morj:morj.menMorj* Did you build the project outside nix first, to update the cargo lockfile? I believe the reason for failing is as follows: nix rust derivations work by splitting your project in two derivations: the dependencies and the project itself. The dependecies derivation only depend on your lockfile, and the project depends on everything else. When you update the versions, you also need to update the lockfile to trigger the rebuild of deps. If you don't do it, cargo will try to download deps when building the main project, but fail as it's offline11:56:37
@morj:morj.menMorj* Did you build the project outside nix first, to update the cargo lockfile? I believe the reason for failing is as follows: nix rust derivations work by splitting your project in two derivations: the dependencies and the project itself. The dependecies derivation only depend on your lockfile, and the project depends on everything else. When you update the versions, you also need to update the lockfile to trigger the rebuild of deps. If you don't do it, the old derivations with old deps will be the only one present, and cargo will try to download the updated deps when building the main project, but fail as it's offline11:57:05
@bemyak:matrix.orgbemyakWell, the lock file is shipped with prisma-engines: https://github.com/prisma/prisma-engines/blob/6.1.0/Cargo.lock So I don't think I can update it11:59:39
@tomasajt:matrix.orgTomaI'll take a look12:17:16
@tomasajt:matrix.orgTomaprobably the same issue as https://github.com/NixOS/nixpkgs/issues/37169212:22:22
@tomasajt:matrix.orgToma

this is part of the config.toml file of the cargoDeps

[source."git+https://github.com/prisma/mongo-rust-driver.git?branch=RUST-1994%2Fhappy-eyeballs"]
git = "https://github.com/prisma/mongo-rust-driver.git"
branch = "RUST-1994%2Fhappy-eyeballs"
replace-with = "vendored-sources"
12:23:19
@bemyak:matrix.orgbemyakOh, I see. Indeed, it seems to be the same issue. How can I override this branch name in the nix derivation?12:43:04
@tomasajt:matrix.orgTomafixed in https://github.com/NixOS/nixpkgs/pull/37179513:02:59
@bemyak:matrix.orgbemyakThanks a lot!13:09:08
8 Jan 2025
@l1npengtul:matrix.orgl1npengtul joined the room.12:23:43
9 Jan 2025
@vhdirk:matrix.orgDirk Van Haerenborgh @ FOSDEM joined the room.17:08:43
11 Jan 2025
@orzklv:matrix.org@orzklv:matrix.org left the room.04:07:46
@oak:universumi.fioak changed their profile picture.16:45:28
@oak:universumi.fioak changed their profile picture.16:46:31
@pandapip1:matrix.orgpandapip1 joined the room.21:21:10
12 Jan 2025
@elikoga:matrix.orgelikoga joined the room.01:24:34
@nakibrayane:matrix.orgRayane Nakib (ريان نقيب) joined the room.12:37:12

Show newer messages


Back to Room ListRoom Version: 6