Skip to content

Commit fa6bb7d

Browse files
committed
Allow building onnxruntime as root user
1 parent ad2cd3e commit fa6bb7d

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

graalpython/lib-graalpython/patches/onnxruntime-1.17.1.patch

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,3 +140,12 @@ index 31f242c..300211b 100644
140140
if args.use_gdk:
141141
cmake_args += [
142142
"-DCMAKE_TOOLCHAIN_FILE=" + os.path.join(source_dir, "cmake", "gdk_toolchain.cmake"),
143+
@@ -2485,7 +2490,7 @@ def main():
144+
args.use_cache = True
145+
146+
if not is_windows():
147+
- if not args.allow_running_as_root:
148+
+ if False and not args.allow_running_as_root:
149+
is_root_user = os.geteuid() == 0
150+
if is_root_user:
151+
raise BuildError(

graalpython/lib-graalpython/patches/onnxruntime-1.22.1.patch

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,3 +93,12 @@ index 2a06916..c790a21 100644
9393
if args.use_gdk:
9494
cmake_args += [
9595
"-DCMAKE_TOOLCHAIN_FILE=" + os.path.join(source_dir, "cmake", "gdk_toolchain.cmake"),
96+
@@ -2167,7 +2173,7 @@ def main():
97+
os.environ["ANDROID_NDK_HOME"] = args.android_ndk_path
98+
99+
if not is_windows() and not is_macOS():
100+
- if not args.allow_running_as_root:
101+
+ if False and not args.allow_running_as_root:
102+
is_root_user = os.geteuid() == 0
103+
if is_root_user:
104+
raise BuildError(

0 commit comments

Comments
 (0)