FetchContent_makeAvailable produces connection/permissions error?
I am trying to build the ONNX extensions repo using Bazel. I noticed that it seemed to be running into connection/permissions issues when the cmake file tries to download a repo:
-- ONNX Runtime URL: https://github.com/microsoft/onnxruntime/releases/download/v1.16.2/onnxruntime-osx-universal2-1.16.2.tgz
[ 11%] Creating directories for 'onnxruntime-populate'
[ 22%] Performing download step (download, verify and extract) for 'onnxruntime-populate'
-- Downloading...
dst='/private/var/tmp/_bazel_victor/1cabe6594cc48c856544c639052f58cd/sandbox/darwin-sandbox/38/execroot/morris/bazel-out/darwin-fastbuild/bin/external/onnx_runtime_extensions/onnx_extensions.build_tmpdir/_deps/onnxruntime-subbuild/onnxruntime-populate-prefix/src/onnxruntime-osx-universal2-1.16.2.tgz'
timeout='none'
inactivity timeout='none'
-- Using src='https://github.com/microsoft/onnxruntime/releases/download/v1.16.2/onnxruntime-osx-universal2-1.16.2.tgz'
-- Retrying...
-- Using src='https://github.com/microsoft/onnxruntime/releases/download/v1.16.2/onnxruntime-osx-universal2-1.16.2.tgz'
-- Retry after 5 seconds (attempt #2) ...
-- Using src='https://github.com/microsoft/onnxruntime/releases/download/v1.16.2/onnxruntime-osx-universal2-1.16.2.tgz'
-- Retry after 5 seconds (attempt #3) ...
-- Using src='https://github.com/microsoft/onnxruntime/releases/download/v1.16.2/onnxruntime-osx-universal2-1.16.2.tgz'
-- Retry after 15 seconds (attempt #4) ...
-- Using src='https://github.com/microsoft/onnxruntime/releases/download/v1.16.2/onnxruntime-osx-universal2-1.16.2.tgz'
-- Retry after 60 seconds (attempt #5) ...
-- Using src='https://github.com/microsoft/onnxruntime/releases/download/v1.16.2/onnxruntime-osx-universal2-1.16.2.tgz'
CMake Error at onnxruntime-subbuild/onnxruntime-populate-prefix/src/onnxruntime-populate-stamp/download-onnxruntime-populate.cmake:170 (message):
Each download failed!
error: downloading 'https://github.com/microsoft/onnxruntime/releases/download/v1.16.2/onnxruntime-osx-universal2-1.16.2.tgz' failed
status_code: 7
status_string: "Couldn't connect to server"
log:
--- LOG BEGIN ---
Trying 140.82.114.3:443...
Immediate connect fail for 140.82.114.3: Operation not permitted
Closing connection 0
If I'm not mistaken, this comes from these lines in one of the cmake files, which makes use of FetchContent_Declare
. I've validated that the actual release file (https://github.com/microsoft/onnxruntime/releases/download/v1.16.2/onnxruntime-osx-universal2-1.16.2.tgz) exists.
Is this a known issue, and is there a fix for this?
My system: MacOS 13.5 CMake 3.26.4
Edited by Victor M