Skip to content

Commit 3fb879e

Browse files
committed
linux building
1 parent 61e8c3c commit 3fb879e

File tree

7 files changed

+99
-281
lines changed

7 files changed

+99
-281
lines changed

recipe/build-core.bat

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,11 @@ cd python
3434
echo startup --output_user_root=D:/tmp >> ..\.bazelrc
3535
echo build --jobs=1 >> ..\.bazelrc
3636
echo build --subcommands=pretty_print >> ..\.bazelrc
37-
"%PYTHON%" -m pip install . -vv --no-deps
37+
"%PYTHON%" -m pip install . -vv --no-deps --no-build-isolation
3838

3939
rem remember the return code
4040
set RETCODE=%ERRORLEVEL%
4141

42-
rem Now clean everything up so subsequent builds (for potentially
43-
rem different Python version) do not stumble on some after-effects.
44-
"%PYTHON%" setup.py clean --all
45-
4642
rem setup.py uses D:\bazel-root and D:\b-o since ray 2.10.0.
4743
rem Get the drive for SRC_DIR, in case it changes from D:
4844
@for %%G in ("%SRC_DIR%") DO @SET DRIVE=%%~dG

recipe/build-core.sh

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -42,18 +42,9 @@ echo '----------------------------------------------------'
4242
cd python/
4343
export SKIP_THIRDPARTY_INSTALL_CONDA_FORGE=1
4444

45-
"${PYTHON}" -m pip install . -vv --no-deps
46-
# bazel by default makes everything read-only,
47-
# which leads to patchelf failing to fix rpath in binaries.
48-
# find all ray binaries and make them writable
49-
grep -lR ELF build/ | xargs chmod +w
50-
5145
# now install the thing so conda could pick it up
52-
"${PYTHON}" setup.py install --single-version-externally-managed --root=/
46+
"${PYTHON}" -m pip install . -vv --no-deps --no-build-isolation
5347

54-
# now clean everything up so subsequent builds (for potentially
55-
# different Python version) do not stumble on some after-effects
56-
"${PYTHON}" setup.py clean --all
5748
bazel "--output_user_root=$SRC_DIR/../bazel-root" "--output_base=$SRC_DIR/../b-o" clean
5849
bazel "--output_user_root=$SRC_DIR/../bazel-root" "--output_base=$SRC_DIR/../b-o" shutdown
5950
rm -rf "$SRC_DIR/../b-o" "$SRC_DIR/../bazel-root"

recipe/meta.yaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ source:
1010
patches:
1111
- patches/0001-Disable-making-entry-scripts.patch
1212
- patches/0002-Ignore-warnings-in-event.cc-and-logging.cc.patch
13-
- patches/0003-remove-dependencies.patch
13+
- patches/0003-Newer-hermetic-python.patch
1414
# This needs modification for each release
1515
- patches/0004-update-commit-sha.patch
1616
# See https://github.com/conda-forge/ray-packages-feedstock/issues/136
@@ -27,8 +27,6 @@ source:
2727
- patches/0010-patch-bundled-fmt-in-spdlog-for-invalid-char8_type.patch
2828
# Avoid building openssl-1.1.1f and redis, not needed in the shipped package
2929
- patches/0011-do-not-build-redis-openssl.patch
30-
# Ray patches grpc, update the patch for 1.67
31-
- patches/0012-update-patch-for-grpc-1.67.patch
3230

3331
build:
3432
number: 0
@@ -96,6 +94,7 @@ outputs:
9694
- libgrpc
9795
- openjdk =11
9896
- setuptools
97+
- cython >=3.0.12
9998
run:
10099
- python
101100
- aiohttp >=3.7
@@ -109,7 +108,6 @@ outputs:
109108
- psutil
110109
- pyyaml
111110
- requests
112-
run_constrained:
113111

114112
test:
115113
imports:
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
From e9922231ab7cdd7a6bba7eedb7ee38c42ae4d057 Mon Sep 17 00:00:00 2001
2+
From: Austin Morton <austin.morton@aquatic.com>
3+
Date: Fri, 29 Aug 2025 10:49:09 -0500
4+
Subject: [PATCH] Newer hermetic python
5+
6+
---
7+
BUILD.bazel | 4 ++--
8+
WORKSPACE | 8 ++++----
9+
2 files changed, 6 insertions(+), 6 deletions(-)
10+
11+
diff --git a/BUILD.bazel b/BUILD.bazel
12+
index 804a9591b9..8a4772704e 100644
13+
--- a/BUILD.bazel
14+
+++ b/BUILD.bazel
15+
@@ -10,7 +10,7 @@ load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
16+
load("@com_github_grpc_grpc//bazel:cc_grpc_library.bzl", "cc_grpc_library")
17+
load("@com_github_grpc_grpc//bazel:cython_library.bzl", "pyx_library")
18+
load("@hedron_compile_commands//:refresh_compile_commands.bzl", "refresh_compile_commands")
19+
-load("@python3_9//:defs.bzl", python39 = "interpreter")
20+
+load("@python3_12//:defs.bzl", python312 = "interpreter")
21+
load("@rules_cc//cc:defs.bzl", "cc_proto_library")
22+
load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_files")
23+
load("@rules_pkg//pkg:zip.bzl", "pkg_zip")
24+
@@ -26,7 +26,7 @@ package(
25+
26+
py_runtime(
27+
name = "python3_runtime",
28+
- interpreter = python39,
29+
+ interpreter = python312,
30+
python_version = "PY3",
31+
visibility = ["//visibility:private"],
32+
)
33+
diff --git a/WORKSPACE b/WORKSPACE
34+
index e56c6a109b..32e30da344 100644
35+
--- a/WORKSPACE
36+
+++ b/WORKSPACE
37+
@@ -61,12 +61,12 @@ http_archive(
38+
load("@rules_python//python:repositories.bzl", "python_register_toolchains")
39+
40+
python_register_toolchains(
41+
- name = "python3_9",
42+
- python_version = "3.9",
43+
+ name = "python3_12",
44+
+ python_version = "3.12",
45+
register_toolchains = False,
46+
)
47+
48+
-load("@python3_9//:defs.bzl", python39 = "interpreter")
49+
+load("@python3_12//:defs.bzl", python312 = "interpreter")
50+
load("@rules_python//python/pip_install:repositories.bzl", "pip_install_dependencies")
51+
52+
pip_install_dependencies()
53+
@@ -75,7 +75,7 @@ load("@rules_python//python:pip.bzl", "pip_parse")
54+
55+
pip_parse(
56+
name = "py_deps_buildkite",
57+
- python_interpreter_target = python39,
58+
+ python_interpreter_target = python312,
59+
requirements_lock = "//release:requirements_buildkite.txt",
60+
)
61+
62+
--
63+
2.43.0
64+

recipe/patches/0003-remove-dependencies.patch

Lines changed: 0 additions & 219 deletions
This file was deleted.

recipe/patches/0005-Vendor-grpc-1.67.1.patch

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,37 @@ index 83dfba2b95..95d59c2279 100644
213213
],
214214
+ patches = [
215215
+ "@io_ray//thirdparty/patches:zlib-fdopen.patch",
216+
diff --git a/thirdparty/patches/grpc-configurable-thread-count.patch b/thirdparty/patches/grpc-configurable-thread-count.patch
217+
index 26387f51a5..f1ae73ec4a 100644
218+
--- a/thirdparty/patches/grpc-configurable-thread-count.patch
219+
+++ b/thirdparty/patches/grpc-configurable-thread-count.patch
220+
@@ -1,7 +1,6 @@
221+
-diff --git src/core/lib/gpr/linux/cpu.cc b/src/core/lib/gpr/linux/cpu.cc
222+
-index 670ca6551c..043021dc4a 100644
223+
---- src/core/lib/gpr/linux/cpu.cc
224+
-+++ src/core/lib/gpr/linux/cpu.cc
225+
+diff --git src/core/util/linux/cpu.cc src/core/util/linux/cpu.cc
226+
+--- src/core/util/linux/cpu.cc
227+
++++ src/core/util/linux/cpu.cc
228+
@@ -24,6 +24,7 @@
229+
230+
#ifdef GPR_CPU_LINUX
231+
@@ -10,7 +9,7 @@ index 670ca6551c..043021dc4a 100644
232+
#include <errno.h>
233+
#include <sched.h>
234+
#include <string.h>
235+
-@@ -49,7 +50,17 @@ static void init_num_cpus() {
236+
+@@ -50,7 +51,17 @@ static void init_num_cpus() {
237+
#endif
238+
// This must be signed. sysconf returns -1 when the number cannot be
239+
// determined
240+
@@ -27,5 +26,5 @@ index 670ca6551c..043021dc4a 100644
241+
+ ncpus = static_cast<int>(sysconf(_SC_NPROCESSORS_CONF));
242+
+ }
243+
if (ncpus < 1) {
244+
- gpr_log(GPR_ERROR, "Cannot determine number of CPUs: assuming 1");
245+
+ LOG(ERROR) << "Cannot determine number of CPUs: assuming 1";
246+
ncpus = 1;
216247
--
217248
2.39.5 (Apple Git-154)
218249

0 commit comments

Comments
 (0)