Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

protobuf: std::system_error thrown running protoc on Linux #1082

Closed
dvrogozh opened this issue Jul 14, 2023 · 1 comment · Fixed by #1083
Closed

protobuf: std::system_error thrown running protoc on Linux #1082

dvrogozh opened this issue Jul 14, 2023 · 1 comment · Fixed by #1083

Comments

@dvrogozh
Copy link
Contributor

Consider the following example running on Linux:

$ cat meson.build
project('proto-bug', 'c')

protoc = find_program('protoc')

custom_target('proto',
  input : 'some.proto',
  output : ['som.pb.h', 'some.pb.cc'],
  command : [protoc, '--cpp_out=@OUTDIR@', '-I=@CURRENT_SOURCE_DIR@',
    # We can't use @INPUT@ which would be more correct from meson perspective
    # for the reason that protoc has a requirement that -I or --proto_path
    # must be exact prefix of .proto file names otherwise protoc aborts with
    # an error. Unfortunately meson did not guarantee that for the @CURRENT_SOURCE_DIR@
    # and @INPUT@ pair.
    '@CURRENT_SOURCE_DIR@/some.proto'],
  build_always : true)

$ cat some.proto
syntax = "proto3";
package some;
message SomeMsg { uint64 _some = 1; }

$ meson wrap install protobuf
Installed protobuf version 3.21.12 revision 3

$ meson setup --wrap-mode=forcefallback _build
<...>
$ meson compile -C _build
<...>
[1/1] Generating proto with a custom command
FAILED: som.pb.h some.pb.cc
/home/dvrogozh/bugs/proto-bug/_build/subprojects/protobuf-3.21.12/src/protoc --cpp_out=. -I=../ ..//some.proto
terminate called after throwing an instance of 'std::system_error'
  what():  Unknown error -1
ninja: build stopped: subcommand failed.

I was using meson 1.1.1. I don't think that's Linux OS specific, but formally I was running Cent OS 7 with toolsets as follows:

scl enable devtoolset-9 rh-python38 -- meson <...>
dvrogozh added a commit to dvrogozh/wrapdb that referenced this issue Jul 14, 2023
@dvrogozh
Copy link
Contributor Author

This issue is the same as protocolbuffers/protobuf#4958. It's caused by missing dependency from 'threads' in rules for 'protoc'. I raised PR #1083 to address this. Once applied I don't see the issue anymore and example posted in issue description builds fine.

@dvrogozh dvrogozh changed the title protobuf: std::system_error thrown running protoc protobuf: std::system_error thrown running protoc on Linux Jul 14, 2023
neheb pushed a commit that referenced this issue Jul 14, 2023
willwray pushed a commit to willwray/wrapdb that referenced this issue Apr 22, 2024
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 a pull request may close this issue.

1 participant