Giter VIP home page Giter VIP logo

Comments (7)

mustiikhalil avatar mustiikhalil commented on June 2, 2024

Hej, thanks for opening the issue.

No, Swift isn't a prerequisite to building with Bazel. I would say it's mainly for macOS and Linux.

Unfortunately, my knowledge with Bazel is none-existing to solve this actually.

from flatbuffers.

peakschris avatar peakschris commented on June 2, 2024

This can be fixed with these two changes:

build_grpc_with_cxx14.patch:

diff --git a/bazel/copts.bzl b/bazel/copts.bzl
index 10be944f25..879518b92f 100644
--- a/bazel/copts.bzl
+++ b/bazel/copts.bzl
@@ -59,4 +59,7 @@ GRPC_LLVM_WARNING_FLAGS = [
 GRPC_DEFAULT_COPTS = select({
     "//:use_strict_warning": GRPC_LLVM_WARNING_FLAGS + ["-DUSE_STRICT_WARNING=1"],
     "//conditions:default": [],
-})
+}) + select({
+        "@bazel_tools//src/conditions:windows": ["/std:c++14"],
+        "//conditions:default": ["-std=c++14"],
+})

.bazelrc:

# As of bazel 6.3.0, common supports all options
common --deleted_packages=tests/bazel_repository_test_dir,tests/ts/bazel_repository_test_dir
# Workaround https://github.com/bazelbuild/bazel/issues/21712 until bazel 7.2.0 is out
common --experimental_worker_for_repo_fetching=off
# Point tools such as coursier (used in rules_jvm_external) to Bazel's internal JDK
# suggested in https://github.com/bazelbuild/rules_jvm_external/issues/445
common --repo_env=JAVA_HOME=../bazel_tools/jdk
common --action_env=JAVA_HOME=../bazel_tools/jdk
# Workaround "Error: need --enable_runfiles on Windows for to support rules_js"
common:windows --enable_runfiles
# Swift is not required on Windows
common:windows --deleted_packages=swift

The windows build command is then: bazel build //... --config=windows

from flatbuffers.

peakschris avatar peakschris commented on June 2, 2024

Would you be able to upstream this?

from flatbuffers.

mustiikhalil avatar mustiikhalil commented on June 2, 2024

Well, not anytime this week, but I can look at it on Monday. Would that be fine?

cc: @dbaileychess

from flatbuffers.

peakschris avatar peakschris commented on June 2, 2024

Amazing! Thanks :-)

I'm also looking at whether we can add the bazel extensions to the conan package, so people using bazel can consume flatbuffers from conan. I'll followup on that one separately if successful.

from flatbuffers.

mustiikhalil avatar mustiikhalil commented on June 2, 2024

@peakschris I wonder what would this code below fix:

diff --git a/bazel/copts.bzl b/bazel/copts.bzl
index 10be944f25..879518b92f 100644
--- a/bazel/copts.bzl
+++ b/bazel/copts.bzl
@@ -59,4 +59,7 @@ GRPC_LLVM_WARNING_FLAGS = [
 GRPC_DEFAULT_COPTS = select({
     "//:use_strict_warning": GRPC_LLVM_WARNING_FLAGS + ["-DUSE_STRICT_WARNING=1"],
     "//conditions:default": [],
-})
+}) + select({
+        "@bazel_tools//src/conditions:windows": ["/std:c++14"],
+        "//conditions:default": ["-std=c++14"],
+})

Since I know we are having an issue building with Xcode 15.0 as well with gRPC that was fixed by limiting Xcode to 14.2 which isn't optimal commit. CI issue https://buildkite.com/bazel/flatbuffers/builds/9316#018e2ff5-e5ca-46e5-afc1-74d96b161517

from flatbuffers.

peakschris avatar peakschris commented on June 2, 2024

All I've changed in that patch file is to use /std:c++14 on windows, whilst the default option used is -std=c++14.

Original patch file:

+}) + ["-std=c++14"]

Modified patch file:

+}) + select({
+        "@bazel_tools//src/conditions:windows": ["/std:c++14"],
+        "//conditions:default": ["-std=c++14"],
+})

It looks like a different issue to the Xcode one.

from flatbuffers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.