mirror of
https://github.com/kidfromjupiter/nearby.git
synced 2026-09-14 14:46:12 -04:00
added gloop as submodule. added. did some more stubbing for google internal code
This commit is contained in:
@@ -1,10 +1,16 @@
|
||||
build --action_env=BAZEL_CXXOPTS=-"std=c++20" --repo_env=BAZEL_CONLYOPTS="-std=gnu17"
|
||||
build --action_env=CC=/usr/bin/clang
|
||||
build --action_env=CXX=/usr/bin/clang++
|
||||
build --action_env=CC=/usr/bin/clang-21
|
||||
build --action_env=CXX=/usr/bin/clang++-21
|
||||
build --repo_env=CC=/usr/bin/clang-21
|
||||
build --repo_env=CXX=/usr/bin/clang++-21
|
||||
build --check_visibility=false --spawn_strategy=standalone --verbose_failures
|
||||
build --cxxopt=-std=c++20
|
||||
build --cxxopt='-fvisibility-inlines-hidden'
|
||||
build --host_cxxopt=-std=c++20
|
||||
# Keep Nearby on libstdc++ while applying Gloop's remaining compile
|
||||
# requirements only to sources from the external Gloop module.
|
||||
build --@gloop//gloop:stdlib=libstdc++
|
||||
build --per_file_copt=external/gloop[^/]*/.*@-fno-exceptions,-funsigned-char,-DGLOOP_I_ACKNOWLEDGE_THAT_GLOOP_DOES_NOT_SUPPORT_LIBSTDCXX=1
|
||||
# Definition of --config=memcheck
|
||||
build:memcheck --strip=never --test_timeout=3600
|
||||
common --enable_bzlmod
|
||||
|
||||
@@ -21,7 +21,7 @@ permissions:
|
||||
jobs:
|
||||
build-and-release-appimage:
|
||||
name: Build and Release QuickShare AppImage
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-24.04
|
||||
|
||||
steps:
|
||||
- name: Validate release tag
|
||||
@@ -48,9 +48,16 @@ jobs:
|
||||
- name: Install Linux build dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ca-certificates gnupg wget
|
||||
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key \
|
||||
| gpg --dearmor \
|
||||
| sudo tee /usr/share/keyrings/apt.llvm.org.gpg >/dev/null
|
||||
echo "deb [signed-by=/usr/share/keyrings/apt.llvm.org.gpg] https://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" \
|
||||
| sudo tee /etc/apt/sources.list.d/llvm-21.list
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y \
|
||||
build-essential \
|
||||
clang \
|
||||
clang-21 \
|
||||
cmake \
|
||||
ninja-build \
|
||||
pkg-config \
|
||||
|
||||
@@ -22,7 +22,7 @@ env:
|
||||
jobs:
|
||||
build-linux:
|
||||
name: Build Linux
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6
|
||||
@@ -42,9 +42,16 @@ jobs:
|
||||
- name: Install build dependencies
|
||||
run: |
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y ca-certificates gnupg wget
|
||||
wget -qO- https://apt.llvm.org/llvm-snapshot.gpg.key \
|
||||
| gpg --dearmor \
|
||||
| sudo tee /usr/share/keyrings/apt.llvm.org.gpg >/dev/null
|
||||
echo "deb [signed-by=/usr/share/keyrings/apt.llvm.org.gpg] https://apt.llvm.org/noble/ llvm-toolchain-noble-21 main" \
|
||||
| sudo tee /etc/apt/sources.list.d/llvm-21.list
|
||||
sudo apt-get update
|
||||
sudo apt-get install -y \
|
||||
build-essential \
|
||||
clang \
|
||||
clang-21 \
|
||||
cmake \
|
||||
ninja-build \
|
||||
pkg-config \
|
||||
|
||||
@@ -10,3 +10,6 @@
|
||||
[submodule "third_party/json/json"]
|
||||
path = third_party/json/json
|
||||
url = https://github.com/nlohmann/json
|
||||
[submodule "third_party/gloop"]
|
||||
path = third_party/gloop
|
||||
url = https://github.com/abseil/gloop.git
|
||||
|
||||
+17
-7
@@ -1,16 +1,26 @@
|
||||
bazel_dep(name = "platforms", version = "1.0.0")
|
||||
bazel_dep(name = "platforms", version = "1.1.0")
|
||||
bazel_dep(name = "rules_apple", version = "4.3.3")
|
||||
bazel_dep(name = "rules_cc", version = "0.2.16")
|
||||
bazel_dep(name = "rules_cc", version = "0.2.18")
|
||||
bazel_dep(name = "rules_shell", version = "0.6.1")
|
||||
bazel_dep(name = "rules_rust", version = "0.68.1")
|
||||
single_version_override(
|
||||
module_name = "rules_swift",
|
||||
version = "3.1.2",
|
||||
)
|
||||
bazel_dep(name = "rules_rust", version = "0.69.0")
|
||||
bazel_dep(name = "bazel_skylib", version = "1.9.0")
|
||||
bazel_dep(name = "abseil-cpp", version = "20260107.0", repo_name = "com_google_absl")
|
||||
bazel_dep(name = "abseil-cpp", version = "20260107.1", repo_name = "com_google_absl")
|
||||
|
||||
# version of prebuilt protoc in com_github_protobuf_prebuilt must match this.
|
||||
bazel_dep(name = "protobuf", version = "33.4", repo_name = "com_google_protobuf")
|
||||
bazel_dep(name = "protobuf", version = "35.1", repo_name = "com_google_protobuf")
|
||||
bazel_dep(name = "googletest", version = "1.17.0.bcr.2", repo_name = "com_google_googletest")
|
||||
bazel_dep(name = "boringssl", version = "0.20251124.0")
|
||||
bazel_dep(name = "boringssl", version = "0.20260413.0")
|
||||
bazel_dep(name = "rules_foreign_cc", version = "0.15.1")
|
||||
bazel_dep(name = "gloop", version = "0.0.0")
|
||||
|
||||
local_path_override(
|
||||
module_name = "gloop",
|
||||
path = "third_party/gloop",
|
||||
)
|
||||
|
||||
# for linux TUI
|
||||
# Should update to 7.0.0
|
||||
@@ -162,7 +172,7 @@ filegroup(
|
||||
visibility = ["//visibility:public"],
|
||||
)""",
|
||||
urls = [
|
||||
"https://github.com/protocolbuffers/protobuf/releases/download/v32.0/protoc-32.0-linux-x86_64.zip",
|
||||
"https://github.com/protocolbuffers/protobuf/releases/download/v35.1/protoc-35.1-linux-x86_64.zip",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
Generated
+2530
-69
File diff suppressed because it is too large
Load Diff
@@ -2,9 +2,14 @@ load("@rules_cc//cc:cc_library.bzl", "cc_library")
|
||||
|
||||
licenses(["notice"])
|
||||
|
||||
alias(
|
||||
name = "timestamp",
|
||||
actual = "@com_google_protobuf//:timestamp_proto",
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "timestamp_cc_proto",
|
||||
visibility = ["//visibility:public"],
|
||||
deps = ["@com_google_protobuf//:protobuf"],
|
||||
)
|
||||
|
||||
|
||||
@@ -141,7 +141,21 @@ class QuerySharedCredentialsResponse {
|
||||
};
|
||||
|
||||
class QuerySharedCredentialsWithBindingIdsRequest
|
||||
: public QuerySharedCredentialsRequest {};
|
||||
: public QuerySharedCredentialsRequest {
|
||||
public:
|
||||
bool has_join_binding_time() const { return has_join_binding_time_; }
|
||||
google::protobuf::Timestamp* mutable_join_binding_time() {
|
||||
has_join_binding_time_ = true;
|
||||
return &join_binding_time_;
|
||||
}
|
||||
const google::protobuf::Timestamp& join_binding_time() const {
|
||||
return join_binding_time_;
|
||||
}
|
||||
|
||||
private:
|
||||
bool has_join_binding_time_ = false;
|
||||
google::protobuf::Timestamp join_binding_time_;
|
||||
};
|
||||
|
||||
class QuerySharedCredentialsWithBindingIdsResponse
|
||||
: public QuerySharedCredentialsResponse {};
|
||||
@@ -205,4 +219,3 @@ class GetAccountInfoResponse {
|
||||
} // namespace google::nearby::identity::v1
|
||||
|
||||
#endif // LOCATION_NEARBY_SHARING_LIB_RPC_IDENTITY_RPC_TYPES_H_
|
||||
|
||||
|
||||
@@ -8,6 +8,13 @@ cc_library(
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "sync_config_prefs_cc_proto",
|
||||
hdrs = ["sync_config_prefs.pb.h"],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [":sync_binding_prefs_cc_proto"],
|
||||
)
|
||||
|
||||
cc_library(
|
||||
name = "sync_manager",
|
||||
hdrs = ["sync_manager.h"],
|
||||
@@ -24,4 +31,3 @@ cc_library(
|
||||
"@com_google_absl//absl/strings:string_view",
|
||||
],
|
||||
)
|
||||
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
// Copyright 2026 Google LLC
|
||||
//
|
||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||
// you may not use this file except in compliance with the License.
|
||||
// You may obtain a copy of the License at
|
||||
//
|
||||
// https://www.apache.org/licenses/LICENSE-2.0
|
||||
//
|
||||
// Unless required by applicable law or agreed to in writing, software
|
||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
// See the License for the specific language governing permissions and
|
||||
// limitations under the License.
|
||||
|
||||
#ifndef LOCATION_NEARBY_SHARING_LIB_SYNC_SYNC_CONFIG_PREFS_PB_H_
|
||||
#define LOCATION_NEARBY_SHARING_LIB_SYNC_SYNC_CONFIG_PREFS_PB_H_
|
||||
|
||||
// The GitHub build's hand-written proto stubs currently share an
|
||||
// implementation file. Keep the public include paths aligned with the
|
||||
// separately generated upstream proto headers.
|
||||
#include "location/nearby/sharing/lib/sync/sync_binding_prefs.pb.h"
|
||||
|
||||
#endif // LOCATION_NEARBY_SHARING_LIB_SYNC_SYNC_CONFIG_PREFS_PB_H_
|
||||
+4
-1
@@ -366,6 +366,9 @@ cc_library(
|
||||
],
|
||||
copts = [
|
||||
"-DNEARBY_SHARING_DLL",
|
||||
"-DGLOOP_I_ACKNOWLEDGE_THAT_GLOOP_DOES_NOT_SUPPORT_LIBSTDCXX=1",
|
||||
"-fno-exceptions",
|
||||
"-funsigned-char",
|
||||
],
|
||||
visibility = [
|
||||
"//location/nearby/cpp/sharing:__subpackages__",
|
||||
@@ -428,7 +431,7 @@ cc_library(
|
||||
"//sharing/proto:share_cc_proto",
|
||||
"//sharing/proto:wire_format_cc_proto",
|
||||
"//sharing/scheduling",
|
||||
"//third_party/gloop/util/time:protoutil",
|
||||
"@gloop//gloop/util/time:protoutil",
|
||||
"@com_google_absl//absl/base:core_headers",
|
||||
"@com_google_absl//absl/base:nullability",
|
||||
"@com_google_absl//absl/container:flat_hash_map",
|
||||
|
||||
@@ -40,6 +40,11 @@ cc_library(
|
||||
"nearby_share_encrypted_metadata_key.h",
|
||||
"nearby_share_private_certificate.h",
|
||||
],
|
||||
copts = [
|
||||
"-DGLOOP_I_ACKNOWLEDGE_THAT_GLOOP_DOES_NOT_SUPPORT_LIBSTDCXX=1",
|
||||
"-fno-exceptions",
|
||||
"-funsigned-char",
|
||||
],
|
||||
visibility = ["//visibility:public"],
|
||||
deps = [
|
||||
"//google/nearby/identity/v1:resources_cc_proto",
|
||||
@@ -63,7 +68,7 @@ cc_library(
|
||||
"//sharing/proto:enums_cc_proto",
|
||||
"//sharing/proto:share_cc_proto",
|
||||
"//sharing/scheduling",
|
||||
"//third_party/gloop/util/time:protoutil",
|
||||
"@gloop//gloop/util/time:protoutil",
|
||||
"//util/hash:highway_fingerprint",
|
||||
"@com_google_absl//absl/algorithm",
|
||||
"@com_google_absl//absl/algorithm:container",
|
||||
@@ -126,6 +131,11 @@ cc_test(
|
||||
"nearby_share_decrypted_public_certificate_test.cc",
|
||||
"nearby_share_private_certificate_test.cc",
|
||||
],
|
||||
copts = [
|
||||
"-DGLOOP_I_ACKNOWLEDGE_THAT_GLOOP_DOES_NOT_SUPPORT_LIBSTDCXX=1",
|
||||
"-fno-exceptions",
|
||||
"-funsigned-char",
|
||||
],
|
||||
deps = [
|
||||
":certificates",
|
||||
":test_support",
|
||||
@@ -148,7 +158,7 @@ cc_test(
|
||||
"//sharing/proto:share_cc_proto",
|
||||
"//sharing/scheduling",
|
||||
"//sharing/scheduling:test_support",
|
||||
"//third_party/gloop/util/time:protoutil",
|
||||
"@gloop//gloop/util/time:protoutil",
|
||||
"@com_github_protobuf_matchers//protobuf-matchers",
|
||||
"@com_google_absl//absl/functional:any_invocable",
|
||||
"@com_google_absl//absl/status",
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
#include "absl/synchronization/notification.h"
|
||||
#include "absl/time/time.h"
|
||||
#include "absl/types/span.h"
|
||||
#include "third_party/gloop/util/time/protoutil.h"
|
||||
#include "gloop/util/time/protoutil.h"
|
||||
#include "internal/base/file_path.h"
|
||||
#include "internal/flags/nearby_flags.h"
|
||||
#include "internal/platform/mac_address.h"
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include "absl/strings/string_view.h"
|
||||
#include "absl/time/time.h"
|
||||
#include "absl/types/span.h"
|
||||
#include "third_party/gloop/util/time/protoutil.h"
|
||||
#include "gloop/util/time/protoutil.h"
|
||||
#include "internal/flags/nearby_flags.h"
|
||||
#include "internal/platform/mac_address.h"
|
||||
#include "sharing/certificates/constants.h"
|
||||
|
||||
@@ -53,6 +53,18 @@ void ConfigureFlags() {
|
||||
nearby::connections::config_package_nearby::nearby_connections_feature::
|
||||
kRefactorBleL2cap,
|
||||
true);
|
||||
nearby::NearbyFlags::GetInstance().OverrideBoolFlagValue(
|
||||
nearby::connections::config_package_nearby::nearby_connections_feature::
|
||||
kEnableDynamicRoleSwitch,
|
||||
true);
|
||||
nearby::NearbyFlags::GetInstance().OverrideBoolFlagValue(
|
||||
nearby::connections::config_package_nearby::nearby_connections_feature::
|
||||
kEnableWifiDirect,
|
||||
true);
|
||||
nearby::NearbyFlags::GetInstance().OverrideBoolFlagValue(
|
||||
nearby::connections::config_package_nearby::nearby_connections_feature::
|
||||
kEnableWifiDirectGcOnly,
|
||||
true);
|
||||
}
|
||||
|
||||
std::unique_ptr<nearby::sharing::AttachmentContainer> CreateFileAttachments(
|
||||
|
||||
@@ -69,8 +69,7 @@ std::string GetHostname() {
|
||||
|
||||
void PrintUsage(const char* argv0) {
|
||||
std::cerr << "Usage:\n"
|
||||
<< " " << argv0
|
||||
<< " receive [--name NAME] [--timeout SECONDS]\n"
|
||||
<< " " << argv0 << " receive [--name NAME] [--timeout SECONDS]\n"
|
||||
<< " " << argv0
|
||||
<< " send FILE [--name NAME] [--timeout SECONDS]\n";
|
||||
}
|
||||
@@ -156,7 +155,6 @@ NearbySharingService::StatusCodes WaitForStatus(Invoker invoker) {
|
||||
return *status;
|
||||
}
|
||||
|
||||
|
||||
struct CliState {
|
||||
std::mutex mutex;
|
||||
std::condition_variable cv;
|
||||
@@ -171,9 +169,9 @@ struct CliState {
|
||||
void PrintTransferUpdate(const ShareTarget& share_target,
|
||||
const AttachmentContainer& attachment_container,
|
||||
const TransferMetadata& metadata) {
|
||||
std::cout << "transfer target=\"" << share_target.device_name << "\" id="
|
||||
<< share_target.id << " status="
|
||||
<< TransferMetadata::StatusToString(metadata.status())
|
||||
std::cout << "transfer target=\"" << share_target.device_name
|
||||
<< "\" id=" << share_target.id
|
||||
<< " status=" << TransferMetadata::StatusToString(metadata.status())
|
||||
<< " progress=" << metadata.progress()
|
||||
<< "% bytes=" << metadata.transferred_bytes() << "/"
|
||||
<< attachment_container.GetTotalAttachmentsSize() << std::endl;
|
||||
@@ -263,8 +261,8 @@ class CliApp {
|
||||
Shutdown();
|
||||
return 1;
|
||||
}
|
||||
int result = options_.mode == Options::Mode::kReceive ? RunReceive()
|
||||
: RunSend();
|
||||
int result =
|
||||
options_.mode == Options::Mode::kReceive ? RunReceive() : RunSend();
|
||||
Shutdown();
|
||||
return result;
|
||||
}
|
||||
@@ -274,8 +272,7 @@ class CliApp {
|
||||
std::cout << "device name: " << options_.device_name << std::endl;
|
||||
service_->GetSettings()->SetDataUsage(proto::WIFI_ONLY_DATA_USAGE);
|
||||
service_->GetSettings()->SetDeviceName(
|
||||
options_.device_name,
|
||||
[](DeviceNameValidationResult validation_result) {
|
||||
options_.device_name, [](DeviceNameValidationResult validation_result) {
|
||||
static_cast<void>(validation_result);
|
||||
});
|
||||
auto status = WaitForStatus([&](auto callback) {
|
||||
@@ -292,8 +289,8 @@ class CliApp {
|
||||
|
||||
auto status = WaitForStatus([&](auto callback) {
|
||||
service_->RegisterReceiveSurface(
|
||||
&transfer_callback, NearbySharingService::ReceiveSurfaceState::
|
||||
kForeground,
|
||||
&transfer_callback,
|
||||
NearbySharingService::ReceiveSurfaceState::kForeground,
|
||||
Advertisement::BlockedVendorId::kNone, std::move(callback));
|
||||
});
|
||||
std::cout << "RegisterReceiveSurface: " << StatusCodeToString(status)
|
||||
@@ -447,6 +444,14 @@ int main(int argc, char** argv) {
|
||||
nearby::connections::config_package_nearby::nearby_connections_feature::
|
||||
kRefactorBleL2cap,
|
||||
true);
|
||||
nearby::NearbyFlags::GetInstance().OverrideBoolFlagValue(
|
||||
nearby::connections::config_package_nearby::nearby_connections_feature::
|
||||
kEnableWifiDirect,
|
||||
true);
|
||||
nearby::NearbyFlags::GetInstance().OverrideBoolFlagValue(
|
||||
nearby::connections::config_package_nearby::nearby_connections_feature::
|
||||
kEnableWifiDirectGcOnly,
|
||||
true);
|
||||
|
||||
std::optional<nearby::sharing::linux::Options> options =
|
||||
nearby::sharing::linux::ParseArgs(argc, argv);
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
#include "absl/synchronization/mutex.h"
|
||||
#include "absl/time/time.h"
|
||||
#include "absl/types/span.h"
|
||||
#include "third_party/gloop/util/time/protoutil.h"
|
||||
#include "gloop/util/time/protoutil.h"
|
||||
#include "internal/base/file_path.h"
|
||||
#include "internal/flags/nearby_flags.h"
|
||||
#include "internal/network/url.h"
|
||||
|
||||
+1
Submodule third_party/gloop added at 87b6913dab
Reference in New Issue
Block a user