Skip to content

Commit

Permalink
fix broken overrides eth-utils bcrypt
Browse files Browse the repository at this point in the history
  • Loading branch information
3ddi committed Dec 1, 2024
1 parent f554d27 commit a80b868
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 41 deletions.
5 changes: 4 additions & 1 deletion mk-poetry-dep.nix
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ let
wheelFiles = builtins.filter (fileEntry: pypa.isWheelFileName fileEntry.file) files;
# Group wheel files by their file name
wheelFilesByFileName = lib.listToAttrs (map (fileEntry: lib.nameValuePair fileEntry.file fileEntry) wheelFiles);
selectedWheels = pypa.selectWheels python.stdenv.targetPlatform python (map (fileEntry: pypa.parseWheelFileName fileEntry.file) wheelFiles);
platform = if python.stdenv.targetPlatform.isDarwin then {
isDarwin=true; darwinArch="arm64"; isWindows=false; isLinux=false; darwinSdkVersion="12.3"; libc="libSystem"; parsed={cpu={name="aarch64";};};
} else python.stdenv.targetPlatform;
selectedWheels = pypa.selectWheels platform python (map (fileEntry: pypa.parseWheelFileName fileEntry.file) wheelFiles);
in
map (wheel: wheelFilesByFileName.${wheel.filename}) selectedWheels
);
Expand Down
41 changes: 1 addition & 40 deletions overrides/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -353,40 +353,6 @@ lib.composeManyExtensions [
'';
});

bcrypt =
let
getCargoHash = version: {
"4.0.0" = "sha256-HvfRLyUhlXVuvxWrtSDKx3rMKJbjvuiMcDY6g+pYFS0=";
"4.0.1" = "sha256-lDWX69YENZFMu7pyBmavUZaalGvFqbHSHfkwkzmDQaY=";
"4.1.1" = "sha256-QYg1+DsZEdXB74vuS4SFvV0n5GXkuwHkOS9j1ogSTjA=";
"4.1.2" = "sha256-fTD1AKvyeni5ukYjK53gueKLey+rcIUjW/0R289xeb0=";
"4.1.3" = "sha256-Uag1pUuis5lpnus2p5UrMLa4HP7VQLhKxR5TEMfpK0s=";
"4.2.0" = "sha256-dOS9A3pTwXYkzPFFNh5emxJw7pSdDyY+mNIoHdwNdmg=";
}.${version} or (
lib.warn "Unknown bcrypt version: '${version}'. Please update getCargoHash." lib.fakeHash
);
in
prev.bcrypt.overridePythonAttrs (
old: {
buildInputs = old.buildInputs or [ ]
++ [ pkgs.libffi ]
++ lib.optionals (lib.versionAtLeast old.version "4" && stdenv.isDarwin)
[ pkgs.darwin.apple_sdk.frameworks.Security pkgs.libiconv ];
nativeBuildInputs = with pkgs;
old.nativeBuildInputs or [ ]
++ lib.optionals (lib.versionAtLeast old.version "4") [ rustc cargo pkgs.rustPlatform.cargoSetupHook final.setuptools-rust ];
} // lib.optionalAttrs (lib.versionAtLeast old.version "4") {
cargoDeps =
pkgs.rustPlatform.fetchCargoTarball
{
inherit (old) src;
sourceRoot = "${old.pname}-${old.version}/src/_bcrypt";
name = "${old.pname}-${old.version}";
sha256 = getCargoHash old.version;
};
cargoRoot = "src/_bcrypt";
}
);
bjoern = prev.bjoern.overridePythonAttrs (
old: {
buildInputs = old.nativeBuildInputs or [ ] ++ [ pkgs.libev ];
Expand Down Expand Up @@ -751,11 +717,6 @@ lib.composeManyExtensions [
propagatedBuildInputs = old.propagatedBuildInputs or [ ] ++ [ final.setuptools ];
});

ddtrace = prev.ddtrace.overridePythonAttrs (old: {
buildInputs = old.buildInputs or [ ] ++
lib.optionals pkgs.stdenv.isDarwin [ pkgs.darwin.IOKit ];
});

deepspeed = prev.deepspeed.overridePythonAttrs (old: rec {
CUDA_HOME = pkgs.symlinkJoin {
name = "deepspeed-cuda-home";
Expand Down Expand Up @@ -882,7 +843,7 @@ lib.composeManyExtensions [
};

# FIXME: this is a workaround for https://github.com/nix-community/poetry2nix/issues/1161
eth-utils = prev.eth-utils.override { preferWheel = true; };
eth-utils = prev.eth-utils.overridePythonAttrs { preferWheel = true; };

evdev = prev.evdev.overridePythonAttrs (_old: {
preConfigure = ''
Expand Down

0 comments on commit a80b868

Please sign in to comment.