Skip to content

Commit

Permalink
python3Packages.openai-triton: inline bash comments
Browse files Browse the repository at this point in the history
The drawback of this is that the comments now affect outPath's. Hopefully, though, we'll remove this preFixup soon anyway

Co-authored-by: Sandro <sandro.jaeckel@gmail.com>
  • Loading branch information
SomeoneSerge and SuperSandro2000 committed Apr 7, 2023
1 parent 91f2495 commit 24d20fe
Showing 1 changed file with 16 additions and 21 deletions.
37 changes: 16 additions & 21 deletions pkgs/development/python-modules/openai-triton/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -163,31 +163,26 @@ buildPythonPackage {
];

# Avoid GLIBCXX mismatch with other cuda-enabled python packages
preConfigure =
''
export CC="${backendStdenv.cc}/bin/cc";
export CXX="${backendStdenv.cc}/bin/c++";
''
preConfigure = ''
export CC="${backendStdenv.cc}/bin/cc";
export CXX="${backendStdenv.cc}/bin/c++";
# Upstream's setup.py tries to write cache somewhere in ~/
+ ''
export HOME=$TMPDIR
''
export HOME=$TMPDIR
# Upstream's github actions patch setup.cfg to write base-dir. May be redundant
+ ''
echo "" >> python/setup.cfg
echo "[build_ext]" >> python/setup.cfg
echo "base-dir=$PWD" >> python/setup.cfg
''
echo "
[build_ext]
base-dir=$PWD" >> python/setup.cfg
# The rest (including buildPhase) is relative to ./python/
+ ''
cd python/
''
cd python/
# Work around download_and_copy_ptxas()
+ ''
dst_cuda="$PWD/triton/third_party/cuda/bin"
mkdir -p "$dst_cuda"
ln -s "${ptxas}" "$dst_cuda/"
'';
dst_cuda="$PWD/triton/third_party/cuda/bin"
mkdir -p "$dst_cuda"
ln -s "${ptxas}" "$dst_cuda/"
'';

# CMake is run by setup.py instead
dontUseCmakeConfigure = true;
Expand Down

0 comments on commit 24d20fe

Please sign in to comment.