Skip to content

Fix MSYS-built protoc CLI invokation cases where an arg is an absolute path (#21244) #21575

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

Merged
merged 1 commit into from
May 6, 2025

Conversation

copybara-service[bot]
Copy link

Fix MSYS-built protoc CLI invokation cases where an arg is an absolute path (#21244)

Without these changes, if the protoc binary is compiled from inside MSYS but gets invoked from the outside within the native Windows cmd shell environment, and one of the CLI arguments happens to be supplied as an absolute path string, then the *.pb.* code file generation process will fail with an error similar to the following sample output...

# MSYS:
plbrooks@LAPTOP-DEADBEEF MSYS /c/UserData/Programming
$ git clone https://github.com/protocolbuffers/protobuf.git
plbrooks@LAPTOP-DEADBEEF MSYS /c/UserData/Programming
$ cd protobuf
plbrooks@LAPTOP-DEADBEEF MSYS /c/UserData/Programming/protobuf
$ cd cmake
plbrooks@LAPTOP-DEADBEEF MSYS /c/UserData/Programming/protobuf/cmake
$ mkdir build
plbrooks@LAPTOP-DEADBEEF MSYS /c/UserData/Programming/protobuf/cmake
$ cd build
plbrooks@LAPTOP-DEADBEEF MSYS /c/UserData/Programming/protobuf/cmake/build
$ cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=../install ../..
plbrooks@LAPTOP-DEADBEEF MSYS /c/UserData/Programming/protobuf/cmake/build
$ cmake --build . --target install

# CMD:
C:\UserData\Programming\protobuf\cmake\install\bin>protoc.exe --cpp_out=. --proto_path="C:/UserData/Programming/protobuf/examples/" addressbook.proto
C: warning: directory does not exist.

Closes #21244

COPYBARA_INTEGRATE_REVIEW=#21244 from PierceLBrooks:plb/fix-protoc-absolute-path-arg-calls-outside-msys cde1231
FUTURE_COPYBARA_INTEGRATE_REVIEW=#21244 from PierceLBrooks:plb/fix-protoc-absolute-path-arg-calls-outside-msys cde1231

…e path (#21244)

Without these changes, if the `protoc` binary is compiled from inside MSYS but gets invoked from the outside within the native Windows `cmd` shell environment, and one of the CLI arguments happens to be supplied as an absolute path string, then the `*.pb.*` code file generation process will fail with an error similar to the following sample output...
```
# MSYS:
plbrooks@LAPTOP-DEADBEEF MSYS /c/UserData/Programming
$ git clone https://github.com/protocolbuffers/protobuf.git
plbrooks@LAPTOP-DEADBEEF MSYS /c/UserData/Programming
$ cd protobuf
plbrooks@LAPTOP-DEADBEEF MSYS /c/UserData/Programming/protobuf
$ cd cmake
plbrooks@LAPTOP-DEADBEEF MSYS /c/UserData/Programming/protobuf/cmake
$ mkdir build
plbrooks@LAPTOP-DEADBEEF MSYS /c/UserData/Programming/protobuf/cmake
$ cd build
plbrooks@LAPTOP-DEADBEEF MSYS /c/UserData/Programming/protobuf/cmake/build
$ cmake -G "Unix Makefiles" -DCMAKE_INSTALL_PREFIX=../install ../..
plbrooks@LAPTOP-DEADBEEF MSYS /c/UserData/Programming/protobuf/cmake/build
$ cmake --build . --target install

# CMD:
C:\UserData\Programming\protobuf\cmake\install\bin>protoc.exe --cpp_out=. --proto_path="C:/UserData/Programming/protobuf/examples/" addressbook.proto
C: warning: directory does not exist.
```

Closes #21244

COPYBARA_INTEGRATE_REVIEW=#21244 from PierceLBrooks:plb/fix-protoc-absolute-path-arg-calls-outside-msys cde1231
PiperOrigin-RevId: 755406252
@copybara-service copybara-service bot merged commit c7730a2 into main May 6, 2025
@copybara-service copybara-service bot deleted the test_754377153 branch May 6, 2025 16:42
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