Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .bazeliskrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
USE_BAZEL_VERSION=5.4.1
USE_BAZEL_VERSION=6.5.0
Comment thread
neilconway marked this conversation as resolved.
7 changes: 3 additions & 4 deletions .bazelrc
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Specific Bazel build/test options.
build:macos --cxxopt='-std=c++17' --host_cxxopt='-std=c++17'

build:macos --cxxopt='-std=c++17'
build:linux --cxxopt='-std=c++17' --host_cxxopt='-std=c++17'

build:linux --cxxopt='-std=c++17'

build:windows --cxxopt="/std:c++17"
build:windows --cxxopt="/std:c++17" --host_cxxopt='/std:c++17'

build --enable_platform_specific_config
5 changes: 4 additions & 1 deletion .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Workflow for building and testing flags on macOS and Ubuntu.
# Workflow for building and testing stout on macOS and Ubuntu.
name: Build and Run all tests

# We use action's triggers 'push' and 'pull_request'.
Expand Down Expand Up @@ -31,6 +31,9 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
# TODO: CI on Windows is disabled at the moment, because building
# Protobuf with MSVC and Bazel is not well-supported (#80). Re-enable
# once we have a better build story on Windows.
os: ["macos-latest", "ubuntu-latest"]
defaults:
run:
Expand Down
1 change: 1 addition & 0 deletions BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ cc_library(
"@com_github_google_glog//:glog",
"@com_google_absl//absl/strings",
"@com_google_absl//absl/time",
"@com_google_protobuf//:duration_cc_proto",
],
)

Expand Down
10 changes: 10 additions & 0 deletions bazel/deps.bzl
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"""Dependency specific initialization for stout."""

load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
load("@com_github_3rdparty_bazel_rules_picojson//bazel:deps.bzl", picojson_deps = "deps")
load("@com_github_3rdparty_bazel_rules_rapidjson//bazel:deps.bzl", rapidjson_deps = "deps")
load("@com_github_nelhage_rules_boost//:boost/boost.bzl", "boost_deps")
Expand All @@ -21,4 +22,13 @@ def deps(repo_mapping = {}):
repo_mapping = repo_mapping,
)

# Needed because protobuf_deps brings rules_python 0.26.0 which is broken:
# https://github.com/bazelbuild/rules_python/issues/1543
http_archive(
name = "rules_python",
sha256 = "5868e73107a8e85d8f323806e60cad7283f34b32163ea6ff1020cf27abef6036",
strip_prefix = "rules_python-0.25.0",
Comment thread
onelxj marked this conversation as resolved.
url = "https://github.com/bazelbuild/rules_python/releases/download/0.25.0/rules_python-0.25.0.tar.gz",
)

protobuf_deps()
17 changes: 9 additions & 8 deletions bazel/repos.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,12 @@ def repos(external = True, repo_mapping = {}):
maybe(
http_archive,
name = "com_google_absl",
urls = ["https://github.com/abseil/abseil-cpp/archive/refs/tags/20211102.0.tar.gz"],
strip_prefix = "abseil-cpp-20211102.0",
sha256 = "dcf71b9cba8dc0ca9940c4b316a0c796be8fab42b070bb6b7cab62b48f0e66c4",
repo_mapping = repo_mapping,
sha256 = "f50e5ac311a81382da7fa75b97310e4b9006474f9560ac46f54a9967f07d4ae3",
strip_prefix = "abseil-cpp-20240722.0",
urls = [
"https://storage.googleapis.com/grpc-bazel-mirror/github.com/abseil/abseil-cpp/archive/20240722.0.tar.gz",
"https://github.com/abseil/abseil-cpp/archive/20240722.0.tar.gz",
],
)

maybe(
Expand Down Expand Up @@ -81,12 +83,11 @@ def repos(external = True, repo_mapping = {}):
maybe(
http_archive,
name = "com_google_protobuf",
strip_prefix = "protobuf-3.19.1",
sha256 = "008a11cc56f9b96679b4c285fd05f46d317d685be3ab524b2a310be0fbad987e",
strip_prefix = "protobuf-29.3",
urls = [
"https://mirror.bazel.build/github.com/protocolbuffers/protobuf/archive/v3.19.1.tar.gz",
"https://github.com/protocolbuffers/protobuf/archive/v3.19.1.tar.gz",
"https://github.com/protocolbuffers/protobuf/archive/v29.3.tar.gz",
],
sha256 = "87407cd28e7a9c95d9f61a098a53cf031109d451a7763e7dd1253abf8b4df422",
repo_mapping = repo_mapping,
)

Expand Down
14 changes: 7 additions & 7 deletions include/stout/flags/flags.cc
Original file line number Diff line number Diff line change
Expand Up @@ -678,19 +678,19 @@ void Parser::SetFieldMessageOrAggregateErrors(
// error for us to print out later.
struct ErrorCollector : public google::protobuf::io::ErrorCollector {
// TODO(artur): include also 'line' and 'column' for easier debugging.
void AddError(
void RecordError(
int /* line */,
int /* column */,
const std::string& message) override {
google::protobuf::io::ColumnNumber /* column */,
absl::string_view message) override {
error += message;
}

void AddWarning(
void RecordWarning(
int line,
int column,
const std::string& message) override {
google::protobuf::io::ColumnNumber column,
absl::string_view message) override {
// For now we treat all warnings as errors.
AddError(line, column, message);
RecordError(line, column, message);
}

std::string error;
Expand Down
4 changes: 2 additions & 2 deletions include/stout/flags/v1/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
load("@rules_cc//cc:defs.bzl", "cc_proto_library")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library")
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")

proto_library(
name = "flag_proto",
Expand Down
6 changes: 4 additions & 2 deletions tests/flags/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
load("@rules_cc//cc:defs.bzl", "cc_proto_library", "cc_test")
load("@rules_proto//proto:defs.bzl", "proto_library")
load("@com_google_protobuf//bazel:cc_proto_library.bzl", "cc_proto_library")
load("@com_google_protobuf//bazel:proto_library.bzl", "proto_library")
load("@rules_cc//cc:defs.bzl", "cc_test")

proto_library(
name = "test_proto",
Expand Down Expand Up @@ -44,6 +45,7 @@ cc_test(
deps = [
":test_proto_library",
"//:flags",
"@com_google_protobuf//:time_util",
"@gtest//:gtest_main",
],
)