2 Jan 2025 |
antrz | Thank you. I will try that now | 20:35:48 |
antrz | ah! i guess i need the patches too | 20:39:12 |
Toma | oh, yeah, forgot about those | 20:39:25 |
antrz | It's a little bit over doing it, but it seems to work. hopefully the nixpkg gets refactored in a nicer way | 20:42:27 |
antrz | soon | 20:42:29 |
antrz | building this derivation feels like building the entire universe | 21:11:18 |
Niklas Korz | it would work a lot better if buildRustPackage had something like stdenv's finalAttrs | 21:51:38 |
Niklas Korz | hm not sure why the override for cargoHash is not working | 21:55:24 |
Niklas Korz | oh wow there are four different PRs attempting an implementation by now 🥲 | 21:57:54 |
antrz | damn! hopefully one of them works :D | 21:58:37 |
Niklas Korz | hm yeah cargoHash with useFetchCargoVendor is seemingly impossible to override atm | 22:02:58 |
Niklas Korz | antrz: this is the smallest working override I could come up with:
pkgs.zed-editor.overrideAttrs (
finalAttrs: prevAttrs: {
version = "0.168.0-pre";
src = prevAttrs.src.override {
tag = "v${finalAttrs.version}";
hash = "sha256-GcsK64tJrEp1QVcLJV2xTWAzupmNXsMgzzW5KOEFqTI=";
};
postPatch = ''
substituteInPlace ../${finalAttrs.pname}-${finalAttrs.version}-vendor/webrtc-sys-*/build.rs \
--replace-fail "cargo:rustc-link-lib=static=webrtc" "cargo:rustc-link-lib=dylib=webrtc"
'';
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
inherit (finalAttrs) pname version src;
hash = "sha256-EuQhqTz200P5xfJGowP1jZxbyJbE2Nl3hm2wVubdOOM=";
};
env.RELEASE_VERSION = finalAttrs.version;
}
)
| 22:17:27 |
Niklas Korz | the postPatch override unfortunately is necessary because it also references the version | 22:17:44 |
Niklas Korz | oh no I still get a build failure in the end 🫠| 22:20:14 |
antrz | That's really great! Thank you. I will try that soon | 22:20:16 |
antrz | ah! | 22:20:23 |
antrz | okay | 22:20:25 |
Niklas Korz | oh, ups | 22:21:31 |
Niklas Korz | I know why, one sec | 22:21:34 |
Niklas Korz | env.RELEASE_VERSION = finalAttrs.version; should be:
env = prevAttrs.env // {
RELEASE_VERSION = finalAttrs.version;
};
| 22:22:10 |
Niklas Korz | * antrz: this is the smallest working override I could come up with:
pkgs.zed-editor.overrideAttrs (
finalAttrs: prevAttrs: {
version = "0.168.0-pre";
src = prevAttrs.src.override {
tag = "v${finalAttrs.version}";
hash = "sha256-GcsK64tJrEp1QVcLJV2xTWAzupmNXsMgzzW5KOEFqTI=";
};
postPatch = ''
substituteInPlace ../${finalAttrs.pname}-${finalAttrs.version}-vendor/webrtc-sys-*/build.rs \
--replace-fail "cargo:rustc-link-lib=static=webrtc" "cargo:rustc-link-lib=dylib=webrtc"
'';
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
inherit (finalAttrs) pname version src;
hash = "sha256-EuQhqTz200P5xfJGowP1jZxbyJbE2Nl3hm2wVubdOOM=";
};
env = prevAttrs.env // {
RELEASE_VERSION = finalAttrs.version;
};
}
)
| 22:22:44 |
antrz | building 167 right now. I will try that after | 22:27:27 |
Niklas Korz | version has to 0.168.0 without -pre | 23:11:41 |
Niklas Korz | * antrz: this is the smallest working override I could come up with:
pkgs.zed-editor.overrideAttrs (
finalAttrs: prevAttrs: {
version = "0.168.0";
src = prevAttrs.src.override {
tag = "v${finalAttrs.version}-pre";
hash = "sha256-GcsK64tJrEp1QVcLJV2xTWAzupmNXsMgzzW5KOEFqTI=";
};
postPatch = ''
substituteInPlace ../${finalAttrs.pname}-${finalAttrs.version}-vendor/webrtc-sys-*/build.rs \
--replace-fail "cargo:rustc-link-lib=static=webrtc" "cargo:rustc-link-lib=dylib=webrtc"
'';
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
inherit (finalAttrs) pname version src;
hash = "sha256-EuQhqTz200P5xfJGowP1jZxbyJbE2Nl3hm2wVubdOOM=";
};
env = prevAttrs.env // {
RELEASE_VERSION = finalAttrs.version;
};
}
)
| 23:11:53 |
Niklas Korz | * antrz: this is the smallest working override I could come up with:
pkgs.zed-editor.overrideAttrs (
finalAttrs: prevAttrs: {
version = "0.168.0";
src = prevAttrs.src.override {
tag = "v${finalAttrs.version}-pre";
hash = "sha256-GcsK64tJrEp1QVcLJV2xTWAzupmNXsMgzzW5KOEFqTI=";
};
postPatch =
builtins.replaceStrings [ prevAttrs.version ] [ finalAttrs.version ]
prevAttrs.postPatch;
cargoDeps = pkgs.rustPlatform.fetchCargoVendor {
inherit (finalAttrs) pname version src;
hash = "sha256-EuQhqTz200P5xfJGowP1jZxbyJbE2Nl3hm2wVubdOOM=";
};
env = prevAttrs.env // {
RELEASE_VERSION = finalAttrs.version;
};
}
)
| 23:22:37 |
Niklas Korz | * version has to be 0.168.0 without -pre (otherwise install check fails) | 23:23:02 |
3 Jan 2025 |
antrz | In reply to @niklaskorz:korz.dev version has to be 0.168.0 without -pre (otherwise install check fails) Thanks a lot, but aaaah wasted a lot of time compiling 😅 | 00:16:53 |
antrz | Works like a charm, btw. Appreciate it :) | 08:44:27 |
Toma | Redacted or Malformed Event | 14:33:20 |
Toma | 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:35:41 |