Skip to content

Commit a28e941

Browse files
authored
Turn off file tracker on Windows (#151)
* Turn off file tracker for windows * Lint * Remove symlink
1 parent 0bcd9f5 commit a28e941

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

.github/workflows/pull.yml

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -48,13 +48,6 @@ jobs:
4848
\$ErrorActionPreference = 'Stop'
4949
\$PSNativeCommandUseErrorActionPreference = \$true
5050
51-
# Create a symbolic link to work around path length limitations. This gives a much shorter
52-
# path, as the default checkout directory is deeply nested.
53-
\$workingDir = \$PWD.Path
54-
cd \$Env:GITHUB_WORKSPACE
55-
New-Item -ItemType SymbolicLink -Path tk -Value \$workingDir
56-
cd tk
57-
5851
# Run C++ unit tests
5952
cmake -DCMAKE_BUILD_TYPE=Debug test -Bbuild/test -T ClangCL
6053
cmake --build build/test -j9 --config Debug

setup.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88

99
import os
1010
import re
11+
import shutil
1112
import subprocess
1213
import sys
13-
import shutil
1414
from pathlib import Path
1515

1616
from setuptools import Extension, find_packages, setup
@@ -53,6 +53,7 @@ def build_extension(self, ext): # noqa C901
5353
"-DCMAKE_POSITION_INDEPENDENT_CODE=ON",
5454
]
5555
build_args = ["--target", "pytorch_tokenizers_cpp"]
56+
build_tool_args: list[str] = []
5657

5758
# Use Clang for Windows builds.
5859
if sys.platform == "win32":
@@ -82,6 +83,7 @@ def build_extension(self, ext): # noqa C901
8283
pass
8384

8485
else:
86+
build_tool_args = ["--", "/p:TrackFileAccess=false"]
8587
# Single config generators are handled "normally"
8688
single_config = any(x in cmake_generator for x in {"NMake", "Ninja"})
8789

@@ -124,7 +126,9 @@ def build_extension(self, ext): # noqa C901
124126
["cmake", ext.sourcedir] + cmake_args, cwd=build_temp, check=True
125127
)
126128
subprocess.run(
127-
["cmake", "--build", "."] + build_args, cwd=build_temp, check=True
129+
["cmake", "--build", "."] + build_args + build_tool_args,
130+
cwd=build_temp,
131+
check=True,
128132
)
129133

130134

0 commit comments

Comments
 (0)