Skip to content

fix: resolve build failures on Ubuntu 22.04 with standard toolchain - #9

Open
sohamukute wants to merge 4 commits into
nsb-ucsc:mainfrom
sohamukute:main
Open

sohamukute wants to merge 4 commits into
nsb-ucsc:mainfrom
sohamukute:main

Conversation

@sohamukute

Copy link
Copy Markdown

I was trying to build NSB on a fresh Ubuntu 22.04 install and hit a few issues that blocked the build from completing.

1. proto/nsb.proto - switched from edition 2023 to proto3
The proto file was using edition = "2023" which requires --experimental_editions and isn't supported by standard protoc. Converted to syntax = "proto3" , all the message types are fully compatible so there's no functional change.

2. cpp/include/nsb.h - removed unused <format> include
<format> was included but never used anywhere in the codebase. It also requires GCC 13+ which isn't the default on Ubuntu 22.04 (ships GCC 11), so it was breaking the build for no reason.

3. cpp/src/nsb_daemon.cc - fixed string field checks for proto3
has_src_id() and has_dest_id() don't get generated for scalar string fields in proto3. Replaced with .empty() checks which behave identically.

4. CMakeLists.txt - CONFIG mode for find_package(Protobuf)
Module mode was picking up the outdated system cmake FindProtobuf.cmake instead of protobuf's own config files. Switching to CONFIG mode fixes this.

Tested on Ubuntu 22.04 / GCC 11.4.0, libnsb.so, nsb_daemon, and nsb_test all build successfully.

Soham Kute added 4 commits February 27, 2026 21:28
edition = '2023' requires --experimental_editions and breaks standard
protoc. proto3 is functionally equivalent for all types used here.
<format> was never used in the codebase and requires GCC 13+,
breaking builds on Ubuntu 22.04 LTS which ships GCC 11.
proto3 does not generate has_*() for scalar string fields.
Replace with field.empty() check which is the correct proto3 idiom.
Module mode picks up outdated system cmake FindProtobuf.cmake.
CONFIG mode uses protobuf own cmake config files ensuring
correct targets and protobuf_generate() behavior.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant