Skip to content

Conversation

@BoleynSu
Copy link
Contributor

@BoleynSu BoleynSu commented Dec 15, 2024

@github-actions github-actions bot added the awaiting-review PR is awaiting review from an assigned reviewer label Dec 15, 2024
wstring jar_manifest_file_path =
binary_base_path + rand_id + L".jar_manifest";
blaze_util::AddUncPrefixMaybe(&jar_manifest_file_path);
#if (__cplusplus >= 201703L)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

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:

bazel/.bazelrc

Line 45 in 16f08cb

build:linux --cxxopt=-std=c++17

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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

@sgowroji sgowroji added the team-Rules-Java Issues for Java rules label Dec 16, 2024
Copy link
Collaborator

@fmeum fmeum left a 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?

wstring jar_manifest_file_path =
binary_base_path + rand_id + L".jar_manifest";
blaze_util::AddUncPrefixMaybe(&jar_manifest_file_path);
#if (__cplusplus >= 201703L)
Copy link
Collaborator

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:

bazel/.bazelrc

Line 45 in 16f08cb

build:linux --cxxopt=-std=c++17

@fmeum fmeum requested a review from meteorcloudy December 16, 2024 16:01
@meteorcloudy meteorcloudy added awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally and removed awaiting-review PR is awaiting review from an assigned reviewer labels Dec 16, 2024
@fmeum
Copy link
Collaborator

fmeum commented Dec 16, 2024

@bazel-io fork 7.5.0

@fmeum
Copy link
Collaborator

fmeum commented Dec 16, 2024

@bazel-io fork 8.1.0

@github-actions github-actions bot removed the awaiting-PR-merge PR has been approved by a reviewer and is ready to be merge internally label Dec 17, 2024
bazel-io pushed a commit to bazel-io/bazel that referenced this pull request Dec 17, 2024
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
github-merge-queue bot pushed a commit that referenced this pull request Dec 18, 2024
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 <[email protected]>
Co-authored-by: Yun Peng <[email protected]>
@BoleynSu
Copy link
Contributor Author

@fmeum should it be cherry picked to 8.0.1 instead of 8.1.0?

@meteorcloudy
Copy link
Member

This is not a fix for a regression, so no need to cherry picked to 8.0.1

@BoleynSu
Copy link
Contributor Author

Should the other PR be cherry picked to the same branch, i.e. 8.1.0, then? I was worried about the merge conflict.

iancha1992 pushed a commit that referenced this pull request Dec 19, 2024
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
bazel-io pushed a commit to bazel-io/bazel that referenced this pull request Jan 18, 2025
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
github-merge-queue bot pushed a commit that referenced this pull request Jan 20, 2025
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 <[email protected]>
@iancha1992
Copy link
Member

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.
If you're using Bazelisk, you can point to the latest RC by setting USE_BAZEL_VERSION=7.5.0rc2. Thanks!

fmeum pushed a commit to fmeum/bazel that referenced this pull request Jan 29, 2025
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
@meteorcloudy
Copy link
Member

Looks like this caused some breakages for the java_launcher with clang:

ERROR: C:/users/pcloudy/workdir/bazel/src/tools/launcher/BUILD:38:15: Compiling src/tools/launcher/java_launcher.cc failed: (Exit 1): clang-cl.exe failed: error executing CppCompile command (from target //src/tools/launcher:java_launcher) C:\Program Files\LLVM\bin\clang-cl.exe @bazel-out/x64_windows-fastbuild/bin/src/tools/launcher/_objs/java_launcher/java_launcher.obj.params
src/tools/launcher/java_launcher.cc(257,31): error: 'std::filesystem::path' is an incomplete type
  257 |   wofstream jar_manifest_file{std::filesystem::path(jar_manifest_file_path)};
      |                               ^
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include\__msvc_filebuf.hpp(30,23): note: forward declaration of 'std::filesystem::path'
   30 |     _EXPORT_STD class path;
      |                       ^
In file included from src/tools/launcher/java_launcher.cc:15:
In file included from .\src/tools/launcher/java_launcher.h:21:
In file included from .\src/tools/launcher/launcher.h:22:
In file included from .\src/tools/launcher/util/data_parser.h:18:
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include\fstream(213,31): error: member access into incomplete type 'const std::filesystem::path'
  213 |         : basic_ofstream(_Path.c_str(), _Mode, _Prot) {} // _Prot is an extension
      |                               ^
src/tools/launcher/java_launcher.cc(257,13): note: in instantiation of function template specialization 'std::basic_ofstream<wchar_t>::basic_ofstream<std::filesystem::path, 0>' requested here
  257 |   wofstream jar_manifest_file{std::filesystem::path(jar_manifest_file_path)};
      |             ^
C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\VC\Tools\MSVC\14.39.33519\include\__msvc_filebuf.hpp(30,23): note: forward declaration of 'std::filesystem::path'
   30 |     _EXPORT_STD class path;
      |                       ^
2 errors generated.
Target //src/tools/launcher:java_launcher failed to build                                                                                                                                                                                                                         
Use --verbose_failures to see the command lines of failed build steps.                                                                                                                                                                                                            
INFO: Elapsed time: 0.858s, Critical Path: 0.65s  

Are we missing

#if (__cplusplus >= 201703L)
#include <filesystem>
#endif

This is blocking tensorflow/tensorflow#87159 since TF is built with clang on windows.

copybara-service bot pushed a commit that referenced this pull request Feb 19, 2025
Addresses: #24703 (comment)
PiperOrigin-RevId: 728571293
Change-Id: Ic1a292b6a6394e1c996cdaa1189e33431eb6f6d2
bazel-io pushed a commit to bazel-io/bazel that referenced this pull request Feb 20, 2025
Addresses: bazelbuild#24703 (comment)
PiperOrigin-RevId: 728571293
Change-Id: Ic1a292b6a6394e1c996cdaa1189e33431eb6f6d2
bazel-io pushed a commit to bazel-io/bazel that referenced this pull request Feb 20, 2025
Addresses: bazelbuild#24703 (comment)
PiperOrigin-RevId: 728571293
Change-Id: Ic1a292b6a6394e1c996cdaa1189e33431eb6f6d2
meteorcloudy added a commit that referenced this pull request Feb 20, 2025
Addresses:
#24703 (comment)
PiperOrigin-RevId: 728571293
Change-Id: Ic1a292b6a6394e1c996cdaa1189e33431eb6f6d2

Commit
77137d4

Co-authored-by: Googler <[email protected]>
github-merge-queue bot pushed a commit that referenced this pull request Feb 24, 2025
Addresses:
#24703 (comment)
PiperOrigin-RevId: 728571293
Change-Id: Ic1a292b6a6394e1c996cdaa1189e33431eb6f6d2

Commit
77137d4

Co-authored-by: Googler <[email protected]>
bazel-io pushed a commit to bazel-io/bazel that referenced this pull request Mar 4, 2025
Addresses: bazelbuild#24703 (comment)
PiperOrigin-RevId: 728571293
Change-Id: Ic1a292b6a6394e1c996cdaa1189e33431eb6f6d2
iancha1992 pushed a commit that referenced this pull request Mar 5, 2025
… clang-cl (#25467)

Addresses:
#24703 (comment)
PiperOrigin-RevId: 728571293
Change-Id: Ic1a292b6a6394e1c996cdaa1189e33431eb6f6d2

Commit
77137d4

Co-authored-by: Googler <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team-Rules-Java Issues for Java rules

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants