Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions lib/torch-extension/arch.nix
Original file line number Diff line number Diff line change
Expand Up @@ -5,19 +5,25 @@

lib,
stdenv,
cudaPackages,

# Native build inputs
build2cmake,
cmake,
cmakeNvccThreadsHook,
ninja,
build2cmake,
get-kernel-check,
kernel-abi-check,
ninja,
python3,
remove-bytecode-hook,
rewrite-nix-paths-macho,
rocmPackages,
writeScriptBin,

# Framework packages
cudaPackages,
rocmPackages,
xpuPackages,

# Build inputs
apple-sdk_15,
clr,
oneapi-torch-dev,
Expand Down Expand Up @@ -102,6 +108,7 @@ stdenv.mkDerivation (prevAttrs: {
cmake
ninja
build2cmake
remove-bytecode-hook
]
++ lib.optionals doGetKernelCheck [
get-kernel-check
Expand Down
2 changes: 2 additions & 0 deletions overlay.nix
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ final: prev: {

rewrite-nix-paths-macho = prev.callPackage ./pkgs/rewrite-nix-paths-macho { };

remove-bytecode-hook = prev.callPackage ./pkgs/remove-bytecode-hook { };

stdenvGlibc_2_27 = prev.callPackage ./pkgs/stdenv-glibc-2_27 { };

# Python packages
Expand Down
5 changes: 5 additions & 0 deletions pkgs/remove-bytecode-hook/default.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{ makeSetupHook, python3 }:

makeSetupHook {
name = "remove-bytecode-hook";
} ./remove-bytecode-hook.sh
12 changes: 12 additions & 0 deletions pkgs/remove-bytecode-hook/remove-bytecode-hook.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

echo "Sourcing remove-bytecode-hook.sh"

removeBytecodeHook() {
echo "Removing Python bytecode"
find $out -type d -name '__pycache__' -exec rm -rf {} +
}

if [ -z "${dontRemoveBytecode-}" ]; then
appendToVar preDistPhases removeBytecodeHook
fi
Loading