-
-
Notifications
You must be signed in to change notification settings - Fork 453
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upstream overrides #1796
base: master
Are you sure you want to change the base?
Upstream overrides #1796
Conversation
a298ba5
to
f984ba5
Compare
in | ||
{ | ||
inherit src; | ||
cargoDeps = pkgs.rustPlatform.importCargoLock { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is using IFD. Please use cargoVendorHash
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean cargoHash
? I cannot find anything about cargoVendorHash
in nixpkgs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I assume you meant pkgs.rustPlatform.fetchCargoTarball
, but why? importCargoLock
gives an ability to have less maintenance burden because of not having hash for every single release. This would still be reproducible, as hashes are in poetry.lock, but also will make that any new version of libcst is automatically supported:
libcst = prev.libcst.overridePythonAttrs (
old: lib.optionalAttrs (!(old.src.isWheel or false)) (
let
unpackedSrc = stdenv.mkDerivation {
name = "unpacked-${old.src.name}";
inherit (old) src;
buildPhase = "cp -r . $out";
};
in
{
cargoDeps = pkgs.rustPlatform.importCargoLock {
lockFile = "${unpackedSrc.out}/native/Cargo.lock";
};
cargoRoot = "native";
nativeBuildInputs = old.nativeBuildInputs or [ ] ++ [
pkgs.rustPlatform.cargoSetupHook # handles `importCargoLock`
pkgs.rustc
pkgs.cargo
];
}
)
);
There are also multiple other places, where poetry2nix could automatically get dependencies, but instead you chose to manually add them to every package. E.g. if poetry or setuptools are required for build: https://github.com/py-mine/mcstatus/blob/0bbd4842178fa1db252371ce5599651e4b867efd/pyproject.toml#L164
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@adisbladis can you elaborate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I learned about IFD since then and will try to fix the issue
66b64ec
to
46a4c5b
Compare
46a4c5b
to
ce2d9a0
Compare
Should I add an IFD alternative for versions older than 1.0.0? (libcst is not that popular after all)
|
These are overrides I made for my projects, just upstreaming them