-
Notifications
You must be signed in to change notification settings - Fork 15.5k
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
Windows: support long paths in open/mkdir/access #2969
Conversation
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure. |
1 similar comment
Thanks for your pull request. The automated tests will run as soon as one of the admins verifies this change is ok for us to run on our infrastructure. |
@buchgr : FYI |
src/google/protobuf/io/io_win32.cc
Outdated
@@ -0,0 +1,281 @@ | |||
// Protocol Buffers - Google's data interchange format |
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.
Please move this to src/google/protobuf/stubs/.... That's where we put all base (and platform related) dependencies.
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.
Done.
We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for the commit author(s). If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google. |
292fef7 was also my commit (so the CLA should be fine), just using git-bash instead of my usual git-on-msys, and the author wasn't set up properly. |
Update protobuf to @laszlocsomor's fork of protobuf. This is essentially the development version of protobuf 3.2.0 and windows specific fixes from laszlo. Those fixes will be merged into protobuf soon: protocolbuffers/protobuf#2969). For instructions on how to update protobuf for bazel see README.bazel.md. Change-Id: I4f663955b0baeea3232b69ce32d9292427f5274a
Update protobuf to @laszlocsomor's fork of protobuf. This is essentially the development version of protobuf 3.2.0 and windows specific fixes from laszlo. Those fixes will be merged into protobuf soon: protocolbuffers/protobuf#2969). For instructions on how to update protobuf for bazel see README.bazel.md. Change-Id: Ic1daafe30270cb6bcc6231e6c94fb670af0475e7
Gentle ping. |
The travis test and appveyor test are failing (seems related to this PR). Could you fix them? |
Update protobuf to @laszlocsomor's fork of protobuf. This is essentially the development version of protobuf 3.2.0 and windows specific fixes from laszlo. Those fixes will be merged into protobuf soon: protocolbuffers/protobuf#2969. Change-Id: Id88cd7e5b2c27ab74f3ecfa1e127e5a863f2deb3
Update protobuf to @laszlocsomor's fork of protobuf. This is essentially the development version of protobuf 3.2.0 and windows specific fixes from laszlo. Those fixes will be merged into protobuf soon: protocolbuffers/protobuf#2969. Change-Id: Id88cd7e5b2c27ab74f3ecfa1e127e5a863f2deb3
Update protobuf to @laszlocsomor's fork of protobuf. This is essentially the development version of protobuf 3.2.0 and windows specific fixes from laszlo. Those fixes will be merged into protobuf soon: protocolbuffers/protobuf#2969. Change-Id: Id88cd7e5b2c27ab74f3ecfa1e127e5a863f2deb3
Update protobuf to @laszlocsomor's fork of protobuf. This is essentially the development version of protobuf 3.2.0 and windows specific fixes from laszlo. Those fixes will be merged into protobuf soon: protocolbuffers/protobuf#2969. Change-Id: Id88cd7e5b2c27ab74f3ecfa1e127e5a863f2deb3
Update protobuf to @laszlocsomor's fork of protobuf. This is essentially the development version of protobuf 3.2.0 and windows specific fixes from laszlo. Those fixes will be merged into protobuf soon: protocolbuffers/protobuf#2969. Change-Id: Id88cd7e5b2c27ab74f3ecfa1e127e5a863f2deb3
PTAL -- all checks pass and I'm confident there won't be any more changes necessary (unless reviewers request so). |
}; | ||
|
||
template <typename char_type> | ||
bool has_drive_letter(const char_type* ch) { |
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 only work if checked after the long path prefix. I suggest documenting so if intentional.
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.
Yes, intentional. Done.
|
||
template <typename char_type> | ||
bool is_path_absolute(const std::basic_string<char_type>& path) { | ||
return (path.size() > 2 && path[1] == ':') || has_longpath_prefix(path); |
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.
replace with has_drive_letter || has_longpath_prefix?
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.
Done.
static bool is_alpha(wchar_t ch) { return iswalpha(ch); } | ||
}; | ||
|
||
template <typename char_type> |
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.
All those onliner should probably be declared inline (also my C++ is a bit rusty, this might already be the case for some magic).?
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.
I think the compiler would auto-inline them where it can. I added the inline declarations anyway but ran into linker errors that I couldn't resolve and didn't want to spend too much time trying.
… latest changes from protocolbuffers/protobuf#2969 on top of it. Change-Id: Ie49c5dcac06e370c5ab3863dc061513531ec8c0d
… latest changes from protocolbuffers/protobuf#2969 on top of it. Change-Id: Ie49c5dcac06e370c5ab3863dc061513531ec8c0d
… latest changes from protocolbuffers/protobuf#2969 on top of it. Change-Id: Ie49c5dcac06e370c5ab3863dc061513531ec8c0d
gentle ping |
… latest changes from protocolbuffers/protobuf#2969 on top of it. Change-Id: Ie49c5dcac06e370c5ab3863dc061513531ec8c0d
… latest changes from protocolbuffers/protobuf#2969 on top of it. Change-Id: Ie49c5dcac06e370c5ab3863dc061513531ec8c0d
… latest changes from protocolbuffers/protobuf#2969 on top of it. Change-Id: Ie49c5dcac06e370c5ab3863dc061513531ec8c0d
… latest changes from protocolbuffers/protobuf#2969 on top of it. Change-Id: Ie49c5dcac06e370c5ab3863dc061513531ec8c0d
… latest changes from protocolbuffers/protobuf#2969 on top of it. Change-Id: Ie49c5dcac06e370c5ab3863dc061513531ec8c0d
Baseline: f3ae88e Cherry picks: + c58ba09: Release to GCS: put the final release in its own directory + 0acead4: Update protobuf to latest master at a64497c and apply @laszlocsomor's latest changes from protocolbuffers/protobuf#2969 on top of it. + d0242ce: Make symlinks consistent + d953ca8: Clean VanillaJavaBuilder output directories + 755669f: Pass all the environment variable to Bazel during bootstrapping + 6f04166: Do not mark the JDK7 installer -without-jdk-installer + 7205611: Fix #2958: Installer should not overwrite bazelrc + 511c35b: Bootstrap: move the fail function to the top + 8470be1: Clean up javac and Error Prone targets + 4a404de: Update javac version to 9-dev-r4023-2 + 36ce4b4: Update javac version to 9-dev-r4023-2 + 38949b8: Migrate off versioned javac and Error Prone targets + 1a57d29: Re-enabling passing -sourcepath via javacopts. + eb565f4: Make make sure that msys build actually builds msys version + 39f328c: Fix typo. Also do not override host_cpu for msvc. + 6248028: Select correct JDK for windows_msys + c4f271d: Automated g4 rollback of commit 3e5edaf. + 9261809: Remove process-tools.cc which I forgot to delete during the last rollback. + baca6e4: Fix #2982: Bazel installer should not check for installed JDK if using a bundled JDK. + 866ecc8: Disable msys path conversion on Windows. + cc21998: Rollforward #2 of: Basic open-source crosstool to support targeting apple platform types. + 0f0ccc4: Escape % in strings that will appear in Crosstool + 3b08f77: Adding feature for linking C Run-Time library on Windows Incompatible changes: - Bazel's Linux sandbox no longer mounts an empty tmpfs on /tmp, instead the existing /tmp is mounted read-write. If you prefer to have a tmpfs on /tmp for sandboxed actions for increased hermeticity, please use the flag --sandbox_tmpfs_path=/tmp. - Converting artifacts to strings and printing them now return "File" instead of "Artifact" to be consistent with the type name. - The return type of depset.to_list() is now a list rather than a frozen list. (Modifying the list has no effect on the depset.) - Bazel now prints logs in single lines to java.log - --use_dash, --dash_url and --dash_secret are removed. - Remote repositories must define any remote repositories they themselves use (e.g., if @x//:foo depends on @y//:bar, @y must be defined in @x's WORKSPACE file). - Remote repositories must define any remote repositories they themselves use (e.g., if @x//:foo depends on @y//:bar, @y must be defined in @x's WORKSPACE file). - objc_xcodeproj has been removed, use tulsi.bazel.build instead. New features: - If grte_top is a label, it can now follow non-configurable redirects. - Optional coverage_files attribute to cc_toolchain - "query --output=build" now includes select()s - Raw LLVM profiles are now supported. Important changes: - Automatically generate Proguard mapping when resource shrinking and Proguard are enabled. - New rules in Bazel: proto_library, java_lite_proto_library, java_proto_library and cc_proto_library - Activate the "dead_strip" feature if objc binary stripping is enabled. - More stable naming scheme for lambda classes in desugared android code - Convert --use_action_cache to a regular option - Per-architecture dSYM binaries are now propagated by apple_binary's AppleDebugOutputsProvider. - Avoid factory methods when desugaring stateless lambdas for Android - desugar calls to Objects.requireNonNull(Object o) with o.getClass() for android - Add an --copy_bridges_from_classpath argument to android desugaring tool - Change how desugar finds desugared classes to have it working on Windows - Evaluation of commands on TargetsBelowDirectory patterns (e.g. //foo/...) matching packages that fail to load now report more detailed error messages in keep_going mode. - Allow to have several inputs and outputs - Repository context's execute() function can print stdout/stderr while running. To enable, pass quiet=False. - Bazel can now be built with a bundled version of the OpenJDK. This makes it possible to use Bazel on systems without a JDK, or where the installed JDK is too old. - The --jobs flag now defaults to "auto", which causes Bazel to use a reasonable degree of parallelism based on the local machine's capacity. - Bazel benchmark (perf.bazel.build) supports Java and Cpp targets. - no factory methods generated for lambda expressions on android - The Linux sandbox no longer changes the user to 'nobody' by default, instead the current user is used as is. The old behavior can be restored via the --sandbox_fake_username flag. - /tmp and /dev/shm are now writable by default inside the Linux sandbox. - Bazel can now use the process-wrapper + symlink tree based sandbox implementation in FreeBSD. - turn on --experimental_incremental_dexing_error_on_missed_jars by default. - All android_binarys are now signed with both Apk Signature V1 and V2. See https://source.android.com/security/apksigning/v2.html for more details. - Windows MSVC wrappers: Not filtering warning messages anymore, use --copt=-w and --host_copt=-w to suppress them. - A downloader bug was fixed that prevented RFC 7233 Range connection resumes from working with certain HTTP servers - Introduces experimental android_device rule for configuring and launching Android emulators. - For boolean flags, setting them to false using --no_<flag_name> is deprecated. Use --no<flag_name> without the underscore, or --<flag_name>=false instead. - Add --experimental_android_compress_java_resources flag to store java resources as compressed inside the APK. - Removed --experimental_use_jack_for_dexing and libname.jack output of android_library. - blaze canonicalize-flags now takes a --show_warnings flag - Changing --invocation_policy will no longer force a server restart. - Bazel now supports Android NDK14. - android_binary multidex should now work without additional flags. - Use action_config in crosstool for static library archiving, remove ar_flag. - new option for bazel canonicalize-flags, --canonicalize_policy - Use action_config in crosstool for static library archiving, remove ar_flag. - android_library exports_manifest now defaults to True. - Fix select condition intersections. - Adds a --override_repository option that takes a repository name and path. This forces Bazel to use the directory at that path for the repository. Example usage: `--override_repository=foo=/home/user/gitroot/foo`. - fix idempotency issue with desugaring lambdas in interface initializers for android - --experimental_android_use_singlejar_for_multidex is now a no-op and will eventually be removed. - Every local_repository now requires a WORKSPACE file. - Remove jack and jill attributes of the android_sdk rule. - Add Skylark stubs needed to remove sysroot from CppConfiguration. - Desugar try-with-resources so that this language feature is available to deveces with API level under 19. - The flag --worker_max_retries was removed. The WorkerSpawnStrategy no longer retries execution of failed Spawns, the reason being that this just masks compiler bugs and isn't done for any other execution strategy either. - Bazel will no longer gracefully restart workers that crashed / quit, instead this triggers a build failure. - All java resources are now compressed in android_binary APKs by default. - All java resources are now compressed in android_binary APKs by default. - android_ndk_repository now creates a cc_library (@androidndk//:cpufeatures) for the cpufeatures library that is bundled in the Android NDK. See https://developer.android.com/ndk/guides/cpu-features.html for more details. - 'output_groups' and 'instrumented_files' cannot be specified in DefaultInfo. - You can increase the CPU reservation for tests by adding a "cpu:<n>" (e.g. "cpu:4" for four cores) tag to their rule in a BUILD file. This can be used if tests would otherwise overwhelm your system if there's too much parallelism. - Deprecate use_singlejar_for_proguard_libraryjars and force behavior to always on.
… latest changes from protocolbuffers/protobuf#2969 on top of it. Change-Id: Ie49c5dcac06e370c5ab3863dc061513531ec8c0d
Baseline: f3ae88e Cherry picks: + c58ba09: Release to GCS: put the final release in its own directory + 0acead4: Update protobuf to latest master at a64497c and apply @laszlocsomor's latest changes from protocolbuffers/protobuf#2969 on top of it. + d0242ce: Make symlinks consistent + d953ca8: Clean VanillaJavaBuilder output directories + 755669f: Pass all the environment variable to Bazel during bootstrapping + 6f04166: Do not mark the JDK7 installer -without-jdk-installer + 7205611: Fix bazelbuild#2958: Installer should not overwrite bazelrc + 511c35b: Bootstrap: move the fail function to the top + 8470be1: Clean up javac and Error Prone targets + 4a404de: Update javac version to 9-dev-r4023-2 + 36ce4b4: Update javac version to 9-dev-r4023-2 + 38949b8: Migrate off versioned javac and Error Prone targets + 1a57d29: Re-enabling passing -sourcepath via javacopts. + eb565f4: Make make sure that msys build actually builds msys version + 39f328c: Fix typo. Also do not override host_cpu for msvc. + 6248028: Select correct JDK for windows_msys + c4f271d: Automated g4 rollback of commit 3e5edaf. + 9261809: Remove process-tools.cc which I forgot to delete during the last rollback. + baca6e4: Fix bazelbuild#2982: Bazel installer should not check for installed JDK if using a bundled JDK. + 866ecc8: Disable msys path conversion on Windows. + cc21998: Rollforward bazelbuild#2 of: Basic open-source crosstool to support targeting apple platform types. + 0f0ccc4: Escape % in strings that will appear in Crosstool + 3b08f77: Adding feature for linking C Run-Time library on Windows Incompatible changes: - Bazel's Linux sandbox no longer mounts an empty tmpfs on /tmp, instead the existing /tmp is mounted read-write. If you prefer to have a tmpfs on /tmp for sandboxed actions for increased hermeticity, please use the flag --sandbox_tmpfs_path=/tmp. - Converting artifacts to strings and printing them now return "File" instead of "Artifact" to be consistent with the type name. - The return type of depset.to_list() is now a list rather than a frozen list. (Modifying the list has no effect on the depset.) - Bazel now prints logs in single lines to java.log - --use_dash, --dash_url and --dash_secret are removed. - Remote repositories must define any remote repositories they themselves use (e.g., if @x//:foo depends on @y//:bar, @y must be defined in @x's WORKSPACE file). - Remote repositories must define any remote repositories they themselves use (e.g., if @x//:foo depends on @y//:bar, @y must be defined in @x's WORKSPACE file). - objc_xcodeproj has been removed, use tulsi.bazel.build instead. New features: - If grte_top is a label, it can now follow non-configurable redirects. - Optional coverage_files attribute to cc_toolchain - "query --output=build" now includes select()s - Raw LLVM profiles are now supported. Important changes: - Automatically generate Proguard mapping when resource shrinking and Proguard are enabled. - New rules in Bazel: proto_library, java_lite_proto_library, java_proto_library and cc_proto_library - Activate the "dead_strip" feature if objc binary stripping is enabled. - More stable naming scheme for lambda classes in desugared android code - Convert --use_action_cache to a regular option - Per-architecture dSYM binaries are now propagated by apple_binary's AppleDebugOutputsProvider. - Avoid factory methods when desugaring stateless lambdas for Android - desugar calls to Objects.requireNonNull(Object o) with o.getClass() for android - Add an --copy_bridges_from_classpath argument to android desugaring tool - Change how desugar finds desugared classes to have it working on Windows - Evaluation of commands on TargetsBelowDirectory patterns (e.g. //foo/...) matching packages that fail to load now report more detailed error messages in keep_going mode. - Allow to have several inputs and outputs - Repository context's execute() function can print stdout/stderr while running. To enable, pass quiet=False. - Bazel can now be built with a bundled version of the OpenJDK. This makes it possible to use Bazel on systems without a JDK, or where the installed JDK is too old. - The --jobs flag now defaults to "auto", which causes Bazel to use a reasonable degree of parallelism based on the local machine's capacity. - Bazel benchmark (perf.bazel.build) supports Java and Cpp targets. - no factory methods generated for lambda expressions on android - The Linux sandbox no longer changes the user to 'nobody' by default, instead the current user is used as is. The old behavior can be restored via the --sandbox_fake_username flag. - /tmp and /dev/shm are now writable by default inside the Linux sandbox. - Bazel can now use the process-wrapper + symlink tree based sandbox implementation in FreeBSD. - turn on --experimental_incremental_dexing_error_on_missed_jars by default. - All android_binarys are now signed with both Apk Signature V1 and V2. See https://source.android.com/security/apksigning/v2.html for more details. - Windows MSVC wrappers: Not filtering warning messages anymore, use --copt=-w and --host_copt=-w to suppress them. - A downloader bug was fixed that prevented RFC 7233 Range connection resumes from working with certain HTTP servers - Introduces experimental android_device rule for configuring and launching Android emulators. - For boolean flags, setting them to false using --no_<flag_name> is deprecated. Use --no<flag_name> without the underscore, or --<flag_name>=false instead. - Add --experimental_android_compress_java_resources flag to store java resources as compressed inside the APK. - Removed --experimental_use_jack_for_dexing and libname.jack output of android_library. - blaze canonicalize-flags now takes a --show_warnings flag - Changing --invocation_policy will no longer force a server restart. - Bazel now supports Android NDK14. - android_binary multidex should now work without additional flags. - Use action_config in crosstool for static library archiving, remove ar_flag. - new option for bazel canonicalize-flags, --canonicalize_policy - Use action_config in crosstool for static library archiving, remove ar_flag. - android_library exports_manifest now defaults to True. - Fix select condition intersections. - Adds a --override_repository option that takes a repository name and path. This forces Bazel to use the directory at that path for the repository. Example usage: `--override_repository=foo=/home/user/gitroot/foo`. - fix idempotency issue with desugaring lambdas in interface initializers for android - --experimental_android_use_singlejar_for_multidex is now a no-op and will eventually be removed. - Every local_repository now requires a WORKSPACE file. - Remove jack and jill attributes of the android_sdk rule. - Add Skylark stubs needed to remove sysroot from CppConfiguration. - Desugar try-with-resources so that this language feature is available to deveces with API level under 19. - The flag --worker_max_retries was removed. The WorkerSpawnStrategy no longer retries execution of failed Spawns, the reason being that this just masks compiler bugs and isn't done for any other execution strategy either. - Bazel will no longer gracefully restart workers that crashed / quit, instead this triggers a build failure. - All java resources are now compressed in android_binary APKs by default. - All java resources are now compressed in android_binary APKs by default. - android_ndk_repository now creates a cc_library (@androidndk//:cpufeatures) for the cpufeatures library that is bundled in the Android NDK. See https://developer.android.com/ndk/guides/cpu-features.html for more details. - 'output_groups' and 'instrumented_files' cannot be specified in DefaultInfo. - You can increase the CPU reservation for tests by adding a "cpu:<n>" (e.g. "cpu:4" for four cores) tag to their rule in a BUILD file. This can be used if tests would otherwise overwhelm your system if there's too much parallelism. - Deprecate use_singlejar_for_proguard_libraryjars and force behavior to always on.
… latest changes from protocolbuffers/protobuf#2969 on top of it. Change-Id: Ie49c5dcac06e370c5ab3863dc061513531ec8c0d
Baseline: f3ae88e Cherry picks: + c58ba09: Release to GCS: put the final release in its own directory + 0acead4: Update protobuf to latest master at a64497c and apply @laszlocsomor's latest changes from protocolbuffers/protobuf#2969 on top of it. + d0242ce: Make symlinks consistent + d953ca8: Clean VanillaJavaBuilder output directories + 755669f: Pass all the environment variable to Bazel during bootstrapping + 6f04166: Do not mark the JDK7 installer -without-jdk-installer + 7205611: Fix #2958: Installer should not overwrite bazelrc + 511c35b: Bootstrap: move the fail function to the top + 8470be1: Clean up javac and Error Prone targets + 4a404de: Update javac version to 9-dev-r4023-2 + 36ce4b4: Update javac version to 9-dev-r4023-2 + 38949b8: Migrate off versioned javac and Error Prone targets + 1a57d29: Re-enabling passing -sourcepath via javacopts. + eb565f4: Make make sure that msys build actually builds msys version + 39f328c: Fix typo. Also do not override host_cpu for msvc. + 6248028: Select correct JDK for windows_msys + c4f271d: Automated g4 rollback of commit 3e5edaf. + 9261809: Remove process-tools.cc which I forgot to delete during the last rollback. + baca6e4: Fix #2982: Bazel installer should not check for installed JDK if using a bundled JDK. + 866ecc8: Disable msys path conversion on Windows. + cc21998: Rollforward #2 of: Basic open-source crosstool to support targeting apple platform types. + 0f0ccc4: Escape % in strings that will appear in Crosstool + 3b08f77: Adding feature for linking C Run-Time library on Windows + 3566474: Do not use sed -E in bootstrap/compile.sh + c3cf7d9: Reverts non-xcode-available darwin crosstool generation. Important changes: - Fixes regression in 0.5.0 requiring Xcode to build C++ on OSX.
Baseline: f3ae88e Cherry picks: + c58ba09: Release to GCS: put the final release in its own directory + 0acead4: Update protobuf to latest master at a64497c and apply @laszlocsomor's latest changes from protocolbuffers/protobuf#2969 on top of it. + d0242ce: Make symlinks consistent + d953ca8: Clean VanillaJavaBuilder output directories + 755669f: Pass all the environment variable to Bazel during bootstrapping + 6f04166: Do not mark the JDK7 installer -without-jdk-installer + 7205611: Fix bazelbuild#2958: Installer should not overwrite bazelrc + 511c35b: Bootstrap: move the fail function to the top + 8470be1: Clean up javac and Error Prone targets + 4a404de: Update javac version to 9-dev-r4023-2 + 36ce4b4: Update javac version to 9-dev-r4023-2 + 38949b8: Migrate off versioned javac and Error Prone targets + 1a57d29: Re-enabling passing -sourcepath via javacopts. + eb565f4: Make make sure that msys build actually builds msys version + 39f328c: Fix typo. Also do not override host_cpu for msvc. + 6248028: Select correct JDK for windows_msys + c4f271d: Automated g4 rollback of commit 3e5edaf. + 9261809: Remove process-tools.cc which I forgot to delete during the last rollback. + baca6e4: Fix bazelbuild#2982: Bazel installer should not check for installed JDK if using a bundled JDK. + 866ecc8: Disable msys path conversion on Windows. + cc21998: Rollforward #2 of: Basic open-source crosstool to support targeting apple platform types. + 0f0ccc4: Escape % in strings that will appear in Crosstool + 3b08f77: Adding feature for linking C Run-Time library on Windows + 3566474: Do not use sed -E in bootstrap/compile.sh + c3cf7d9: Reverts non-xcode-available darwin crosstool generation. Important changes: - Fixes regression in 0.5.0 requiring Xcode to build C++ on OSX.
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.
Please squash the commits into one (to reduce noise in revision history).
@@ -118,6 +100,14 @@ namespace compiler { | |||
namespace { | |||
#if defined(_WIN32) && !defined(__CYGWIN__) | |||
static const char* kPathSeparator = ";"; | |||
// DO NOT include <io.h>, instead create functions in io_win32.{h,cc} and import | |||
// them like we do below. | |||
using google::protobuf::stubs::access; |
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.
Can you use the google::protobuf::internal namespace? That's what we currently use for most other stubs headers.
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.
Sorry for the long silence. Done, though I moved them to google::protobuf::internal::win32
, because the method names are generic enough that they might collide with similarly named functions.
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.
...if they were in google::protobuf::internal
, that is.
CLAs look good, thanks! |
Re: #2969 (review) :
Done. |
Add implementations of open(2), mkdir(2), stat(2), etc. that support long paths under Windows (paths longer than MAX_PATH in <windows.h>, which is 260 characters). The implementations are in a separate namespace (google::protobuf::internal::win32), so they won't collide with the standard implementations in <io.h>, but after importing them with `using` they can be drop-in replacements. Fixes bazelbuild/bazel#2634 Fixes protocolbuffers#2891
And rebased on top of upstream/master (9ab7c73). |
Unfortunately ci.bazel.io no longer has the logs from that run (@damienmg : FYI) so I'd just go ahead and merge this PR and fix Bazel breakages if there are any. |
Congrats @laszlocsomor 👍 🎆 🍾 |
Hello, Does anybody know in which release this fix was included? I try version 3.4.0 (latest version 3.4.1 doesn't have windows compiler binary) on Windows 10 64bit and still get this error. The error like: D:...\SomeFile.java: No such file or directory The path is 261-characters long. Shortening the path makes the compiler work. I checked the source code zip of version 3.4.0, it seems that it includes this patch. Anybody facing the same problem? What are your solutions apart from shortening the path :) |
I'm not on the Protobuf team, but I assume if the files are in the 3.4.0 zip then they should have been compiled into the release binary. The files' contents and the import statements are surrounded by @tri-bao Have you tried building your own protoc binary? A workaround for path lengths is to create a junction that points to the long path, but the junction itself has a short path. Since junctions are just directories with some extra metadata in the filesystem, and the resolution happens in the kernel (I believe), this workaround works both with Command Prompt and Windows Explorer, as well as with all tools that are not longpath-aware. |
thanks @laszlocsomor , compiling with Visual Studio works! I've created a ticket #3856 for asking why the public precompiled binary was not done with Visual Studio, which makes sense for Windows |
The precompiled protoc was built with mingw32 cross compiled under linux environment for various reasons: mostly for automated building process and eliminating msvc dll dependencies. Is there anyway to support the long path also under non MSVC? The code used to be guarded by #ifdef _WIN32, and I changed it to _MSV_VER as it created redefinition of those POSIX system APIs - linux-like OS for windows also implements those syscalls. I believe it can be fixed by re-organizing the code. i.e. instead of "using io_win32::mkdir" define our own mkdir wrapper and delegate it to the one in io_win32 when _WIN32 is defined. |
Hey folks, sorry for dropping the ball on this issue. I opted for defining new implementations in a C++ namespace but using the POSIX function names for the following benefits:
@pherl : Does it solve the compilation problem with MinGW if you only |
But the downside would be having to #ifdef _WIN32 and add using directives for each new files requires those posix functions. Having the wrapper made it more explicit and avoid the breakage by including posix headers transitively that we cannot control. Anyway this should have been fixed in 3.5.0, with changes like: https://github.com/google/protobuf/blob/3.5.x/src/google/protobuf/compiler/objectivec/objectivec_helpers.cc#L64 |
Windows: support long paths in open/mkdir/access
This PR adds support for long paths on Windows in
open(2), mkdir(2), access(2).
Long paths are the ones longer than
MAX_PATH
(260characters).
By includingio_win32.h
we redefine{open,mkdir,access} to win32_{open,mkdir,access}.
These custom functions transform the path argument
to a format expected by the Windows API, then call
_w{open,mkdir,access} which understand these paths
(apparently they wrap the native widechar Windows
API functions).
This PR upstreams the fix for
bazelbuild/bazel#2634
Fixes #2891