-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
java_launcher: Fix non-portable ofstream usage #24703
Conversation
@@ -249,7 +249,11 @@ wstring JavaBinaryLauncher::CreateClasspathJar(const wstring& classpath) { | |||
wstring jar_manifest_file_path = | |||
binary_base_path + rand_id + L".jar_manifest"; | |||
blaze_util::AddUncPrefixMaybe(&jar_manifest_file_path); | |||
#if (__cplusplus >= 201703L) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is vulerable to https://devblogs.microsoft.com/cppblog/msvc-now-correctly-reports-__cplusplus/ but we do not care since under MSVC both versions will work anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bazel already requires C++ 17, so you may not need this conditional:
Line 45 in 16f08cb
build:linux --cxxopt=-std=c++17 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
wofstream cannot be constructed from wstring according to the standard https://en.cppreference.com/w/cpp/io/basic_ofstream/basic_ofstream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The guard is needed to pass the presubmit for MSVC
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain how this non-portable usage manifests in problems in the PR description?
@@ -249,7 +249,11 @@ wstring JavaBinaryLauncher::CreateClasspathJar(const wstring& classpath) { | |||
wstring jar_manifest_file_path = | |||
binary_base_path + rand_id + L".jar_manifest"; | |||
blaze_util::AddUncPrefixMaybe(&jar_manifest_file_path); | |||
#if (__cplusplus >= 201703L) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Bazel already requires C++ 17, so you may not need this conditional:
Line 45 in 16f08cb
build:linux --cxxopt=-std=c++17 |
@bazel-io fork 7.5.0 |
@bazel-io fork 8.1.0 |
wofstream cannot be constructed from wstring according to the standard https://en.cppreference.com/w/cpp/io/basic_ofstream/basic_ofstream. Closes bazelbuild#24703. PiperOrigin-RevId: 707172911 Change-Id: I973f9560c5b20748e4635cd757f53fff9c8ef0c5
wofstream cannot be constructed from wstring according to the standard https://en.cppreference.com/w/cpp/io/basic_ofstream/basic_ofstream. Closes #24703. PiperOrigin-RevId: 707172911 Change-Id: I973f9560c5b20748e4635cd757f53fff9c8ef0c5 Commit 5b35276 Co-authored-by: Boleyn Su <boleyn.su@gmail.com> Co-authored-by: Yun Peng <pcloudy@google.com>
@fmeum should it be cherry picked to 8.0.1 instead of 8.1.0? |
This is not a fix for a regression, so no need to cherry picked to 8.0.1 |
Should the other PR be cherry picked to the same branch, i.e. 8.1.0, then? I was worried about the merge conflict. |
wofstream cannot be constructed from wstring according to the standard https://en.cppreference.com/w/cpp/io/basic_ofstream/basic_ofstream. Closes #24703. PiperOrigin-RevId: 707172911 Change-Id: I973f9560c5b20748e4635cd757f53fff9c8ef0c5
wofstream cannot be constructed from wstring according to the standard https://en.cppreference.com/w/cpp/io/basic_ofstream/basic_ofstream. Closes bazelbuild#24703. PiperOrigin-RevId: 707172911 Change-Id: I973f9560c5b20748e4635cd757f53fff9c8ef0c5
wofstream cannot be constructed from wstring according to the standard https://en.cppreference.com/w/cpp/io/basic_ofstream/basic_ofstream. Closes #24703. PiperOrigin-RevId: 707172911 Change-Id: I973f9560c5b20748e4635cd757f53fff9c8ef0c5 Commit 5b35276 Co-authored-by: Boleyn Su <boleyn.su@gmail.com>
The changes in this PR have been included in Bazel 7.5.0 RC2. Please test out the release candidate and report any issues as soon as possible. |
wofstream cannot be constructed from wstring according to the standard https://en.cppreference.com/w/cpp/io/basic_ofstream/basic_ofstream. Closes bazelbuild#24703. PiperOrigin-RevId: 707172911 Change-Id: I973f9560c5b20748e4635cd757f53fff9c8ef0c5
Looks like this caused some breakages for the java_launcher with clang:
Are we missing
This is blocking tensorflow/tensorflow#87159 since TF is built with clang on windows. |
Addresses: #24703 (comment) PiperOrigin-RevId: 728571293 Change-Id: Ic1a292b6a6394e1c996cdaa1189e33431eb6f6d2
Addresses: bazelbuild#24703 (comment) PiperOrigin-RevId: 728571293 Change-Id: Ic1a292b6a6394e1c996cdaa1189e33431eb6f6d2
Addresses: bazelbuild#24703 (comment) PiperOrigin-RevId: 728571293 Change-Id: Ic1a292b6a6394e1c996cdaa1189e33431eb6f6d2
Addresses: #24703 (comment) PiperOrigin-RevId: 728571293 Change-Id: Ic1a292b6a6394e1c996cdaa1189e33431eb6f6d2 Commit 77137d4 Co-authored-by: Googler <pcloudy@google.com>
wofstream cannot be constructed from wstring according to the standard https://en.cppreference.com/w/cpp/io/basic_ofstream/basic_ofstream.