Comments (7)
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.
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.
Would you be able to upstream this?
from flatbuffers.
Well, not anytime this week, but I can look at it on Monday. Would that be fine?
cc: @dbaileychess
from flatbuffers.
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.
@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.
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)
- v24.3.7 of Rust crate not released to crates.io HOT 4
- [v24.3.7] Rust: push_u8_u64_alignment test fails on i686 target (Ubuntu 22.04, CentOS 9)
- How to print nested table using FlatBufferToString?
- [Python] Flatc stub compatibility with gRPC asyncio Interface
- [Rust] Add better support for "crate-per-schema" HOT 2
- [Bazel CI] Swift toolchain analysis failed due to missing 'swift' configuration fragment HOT 1
- [C#][Feature Request] Unity Game Development needs mutate fixed size string value HOT 2
- Generated CreateXDirect with std::span<T> or "T* + size" payloads
- newbie's question.. use in c# / vector struct / adding int64...
- Feature: --gen-object-api support for Kotlin [Kotlin, FlatBuffers 24.3.25]
- [Rust] inconsistent nested_flatbuffers validations
- [.NET] Target .NET Standard 2.0 again
- Missing type annotations in Python Library HOT 1
- [TS] flatc silently crashing (segmentation fault) HOT 1
- Expected behavior for circular includes in .fbs files? [all languages, flatc version 23.5.26, Ubuntu 24.04] HOT 1
- conan integration doesn't use conan2 and doesn't package bazel rules
- When is the next release for the latest change including `GetTemporaryPointer` bug fix?
- Bug: Wrong Condition for Checking the File Identifier [.NET/C#, master]
- TS: segfault/crash with --gen-object-api for array of enums
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from flatbuffers.