Skip to content

Commit

Permalink
[core]Update boost in ray deps (ray-project#32550)
Browse files Browse the repository at this point in the history
Update boost version to the latest ones.

- updated the rules to build boost
- update the bazel version so it can work with the latest rules
- update boost version
  • Loading branch information
fishbone authored Feb 22, 2023
1 parent 11a61ab commit 64c8f43
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 16 deletions.
1 change: 1 addition & 0 deletions .buildkite/pipeline.windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ prelude_commands: &prelude_commands |-
export BUILD="1"
export DL="1"
powershell ci/pipeline/fix-windows-container-networking.ps1
powershell ci/pipeline/fix-windows-bazel.ps1
cleanup() { if [ "${BUILDKITE_PULL_REQUEST}" = "false" ]; then ./ci/build/upload_build_info.sh; fi }; trap cleanup EXIT

upload_wheels_if_needed: &upload_wheels_if_needed |-
Expand Down
2 changes: 1 addition & 1 deletion WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ load("@bazel_skylib//lib:versions.bzl", "versions")

# When the bazel version is updated, make sure to update it
# in setup.py as well.
versions.check(minimum_bazel_version = "4.2.1")
versions.check(minimum_bazel_version = "5.4.0")

# Tools to generate `compile_commands.json` to enable awesome tooling of the C language family.
# Just run `bazel run @hedron_compile_commands//:refresh_all`
Expand Down
14 changes: 4 additions & 10 deletions bazel/ray_deps_setup.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -156,21 +156,15 @@ def ray_deps_setup():
# declaring it here allows us to avoid patching the latter.
name = "boost",
build_file = "@com_github_nelhage_rules_boost//:BUILD.boost",
sha256 = "83bfc1507731a0906e387fc28b7ef5417d591429e51e788417fe9ff025e116b1",
url = "https://boostorg.jfrog.io/artifactory/main/release/1.74.0/source/boost_1_74_0.tar.bz2",
patches = [
"@com_github_ray_project_ray//thirdparty/patches:boost-exception-no_warn_typeid_evaluated.patch",
],
sha256 = "71feeed900fbccca04a3b4f2f84a7c217186f28a940ed8b7ed4725986baf99fa",
url = "https://boostorg.jfrog.io/artifactory/main/release/1.81.0/source/boost_1_81_0.tar.bz2",
)

auto_http_archive(
name = "com_github_nelhage_rules_boost",
# If you update the Boost version, remember to update the 'boost' rule.
url = "https://github.com/nelhage/rules_boost/archive/652b21e35e4eeed5579e696da0facbe8dba52b1f.tar.gz",
sha256 = "c1b8b2adc3b4201683cf94dda7eef3fc0f4f4c0ea5caa3ed3feffe07e1fb5b15",
patches = [
"@com_github_ray_project_ray//thirdparty/patches:rules_boost-windows-linkopts.patch",
],
url = "https://github.com/nelhage/rules_boost/archive/57c99395e15720e287471d79178d36a85b64d6f6.tar.gz",
sha256 = "490d11425393eed068966a4990ead1ff07c658f823fd982fddac67006ccc44ab",
)

auto_http_archive(
Expand Down
2 changes: 1 addition & 1 deletion ci/docker/test.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ RUN rm -rf /ray
RUN mkdir /ray
WORKDIR /ray

# Copy new ray files
# Copy new ray files.
COPY . .

# Install Ray
Expand Down
13 changes: 13 additions & 0 deletions ci/pipeline/fix-windows-bazel.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
$Env:BAZEL_URL="https://github.com/bazelbuild/bazel/releases/download/5.4.0/bazel-5.4.0-windows-x86_64.zip"
Write-Host ('Downloading {0} ...' -f $env:BAZEL_URL);
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12;
Invoke-WebRequest -Uri $env:BAZEL_URL -OutFile 'bazel.zip';
Write-Host 'Expanding ...';
New-Item -ItemType Directory -Path C:\bazel -Force | Out-Null;
Expand-Archive bazel.zip -DestinationPath C:\bazel -Force;
Write-Host 'Removing ...';
Remove-Item bazel.zip -Force;
[Environment]::SetEnvironmentVariable("BAZEL_PATH", "C:\bazel\bazel.exe", [System.EnvironmentVariableTarget]::Machine)
$systemPath = [Environment]::GetEnvironmentVariable('Path', [System.EnvironmentVariableTarget]::Machine)
$systemPath += ';C:\bazel'
[Environment]::SetEnvironmentVariable("PATH", $systemPath, [System.EnvironmentVariableTarget]::Machine)
2 changes: 1 addition & 1 deletion python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# When the bazel version is updated, make sure to update it
# in WORKSPACE file as well.

SUPPORTED_BAZEL = (4, 2, 2)
SUPPORTED_BAZEL = (5, 4, 0)

ROOT_DIR = os.path.dirname(__file__)
BUILD_JAVA = os.getenv("RAY_INSTALL_JAVA") == "1"
Expand Down
2 changes: 1 addition & 1 deletion src/ray/common/test/client_connection_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ class ClientConnectionTest : public ::testing::Test {
public:
ClientConnectionTest()
: io_service_(), in_(io_service_), out_(io_service_), error_message_type_(1) {
#if defined(BOOST_ASIO_HAS_LOCAL_SOCKETS)
#if defined(BOOST_ASIO_HAS_LOCAL_SOCKETS) and !defined(_WIN64)
boost::asio::local::stream_protocol::socket input(io_service_), output(io_service_);
boost::asio::local::connect_pair(input, output);
in_ = std::move(input);
Expand Down
4 changes: 2 additions & 2 deletions src/ray/util/util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ std::string EndpointToUrl(
result = ss.str();
break;
}
#ifdef BOOST_ASIO_HAS_LOCAL_SOCKETS
#if defined(BOOST_ASIO_HAS_LOCAL_SOCKETS) and !defined(_WIN64)
case AF_UNIX:
scheme = "unix://";
result.append(reinterpret_cast<const struct sockaddr_un *>(ep.data())->sun_path,
Expand Down Expand Up @@ -112,7 +112,7 @@ ParseUrlEndpoint(const std::string &endpoint, int default_port) {
scheme = "tcp://";
}
if (scheme == "unix://") {
#ifdef BOOST_ASIO_HAS_LOCAL_SOCKETS
#if defined(BOOST_ASIO_HAS_LOCAL_SOCKETS) and !defined(_WIN64)
size_t maxlen = sizeof(sockaddr_un().sun_path) / sizeof(*sockaddr_un().sun_path) - 1;
RAY_CHECK(address.size() <= maxlen)
<< "AF_UNIX path length cannot exceed " << maxlen << " bytes: " << address;
Expand Down

0 comments on commit 64c8f43

Please sign in to comment.