File tree 1 file changed +18
-9
lines changed
1 file changed +18
-9
lines changed Original file line number Diff line number Diff line change @@ -145,14 +145,31 @@ if [[ -z "$TOOLCHAIN" ]]; then
145
145
fi
146
146
[[ -f " $TOOLCHAIN " ]] || { echo >&2 " Toolchain file $TOOLCHAIN does not exist." ; exit 1; }
147
147
148
+ BUCK2=$( " $PYTHON " " $SOURCE_ROOT_DIR /tools/cmake/resolve_buck.py" --cache_dir=" $SOURCE_ROOT_DIR /buck2-bin" )
149
+
150
+ if [[ " $BUCK2 " == " buck2" ]]; then
151
+ BUCK2=$( command -v buck2)
152
+ fi
153
+
148
154
check_command () {
149
- command -v " $1 " > /dev/null 2>&1 || { echo >&2 " $1 is not installed" ; exit 1; }
155
+ if [[ " $1 " == * /* ]]; then
156
+ if [[ ! -x " $1 " ]]; then
157
+ echo " Error: Command not found or not executable at '$1 '" >&2
158
+ exit 1
159
+ fi
160
+ else
161
+ if ! command -v " $1 " > /dev/null 2>&1 ; then
162
+ echo " Error: Command '$1 ' not found in PATH" >&2
163
+ exit 1
164
+ fi
165
+ fi
150
166
}
151
167
152
168
check_command cmake
153
169
check_command rsync
154
170
check_command " $PYTHON "
155
171
check_command " $FLATC "
172
+ check_command " $BUCK2 "
156
173
157
174
echo " Building libraries"
158
175
@@ -205,14 +222,6 @@ echo "Exporting headers"
205
222
206
223
mkdir -p " $HEADERS_PATH "
207
224
208
- BUCK2=$( " $PYTHON " " $SOURCE_ROOT_DIR /tools/cmake/resolve_buck.py" --cache_dir=" $SOURCE_ROOT_DIR /buck2-bin" )
209
- if [[ -z " $BUCK2 " ]]; then
210
- echo " Could not find buck2 executable in any buck2-bin directory under $SOURCE_ROOT_DIR "
211
- BUCK2=$( which buck2)
212
- fi
213
-
214
- check_command " $BUCK2 "
215
-
216
225
" $SOURCE_ROOT_DIR " /build/print_exported_headers.py --buck2=$( realpath " $BUCK2 " ) --targets \
217
226
//extension/module: \
218
227
//extension/tensor: \
You can’t perform that action at this time.
0 commit comments