| Commit message (Collapse) | Author | Age |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add a simple profiler that can measure function
call counts and durations, and report statistics
by printing to stderr.
Motivation:
I recently needed a profiler for PR #5445 and
PR #5448, so I'm adding the polished code now.
Usage:
1. depend on //src/main/cpp/util:profiler
2. use StopWatch, Task, and ScopedTask objects
as shown in profiler.h's class documentation
See https://github.com/bazelbuild/bazel/issues/5444
Change-Id: I43f0afd124b486c694f451e8455a66ffca8137b6
Closes #5461.
Change-Id: I43f0afd124b486c694f451e8455a66ffca8137b6
PiperOrigin-RevId: 202314319
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Now we have:
bool AsAbsoluteWindowsPath(const std::wstring& path, std::wstring* result, std::string* error);
This change helps making the C++ native launcher work with UTF-16.
See https://github.com/bazelbuild/bazel/issues/4473
Closes #5406.
Change-Id: I7eaf55f9fe5a4d41e3dd09edc2a21e9b3cc9277c
PiperOrigin-RevId: 201352866
|
|
|
|
|
|
|
|
|
|
|
| |
Leave functions that make file accesses in the file library, and general blaze utilities in the blaze_util file, but move the functions that boil down to string manipulation and path formatting to their own file. (With the exception of getCWD, since absolute path syntax is relevant here.)
Doing this largely to consolidate all Windows path control into a single place, so that it's easier to notice inconsistencies. For instance, ConvertPath currently makes Windows paths absolute, but not Posix paths, and MakeAbsolute relies on this behavior. In addition, JoinPath assumes Posix path syntax, which leads to some odd looking paths. These will be fixed in a followup change.
(Found these issues while working on #4502, trying to fix the windows-specific system bazelrc.)
RELNOTES: None.
PiperOrigin-RevId: 199368226
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the half-done C++ runfiles library to
`//tools/cpp/runfiles`. (The Python and
Bash runfiles libraries are already under
`//tools/<language>/runfiles`.)
See https://github.com/bazelbuild/bazel/issues/4460
Change-Id: I1006f7f81462ea0e4b1de1adcdba89e386d4f9e7
Closes #5107.
Change-Id: I1006f7f81462ea0e4b1de1adcdba89e386d4f9e7
PiperOrigin-RevId: 194763392
|
|
|
|
|
|
|
| |
This will mean the messages will make it to the right output stream.
RELNOTES:
PiperOrigin-RevId: 191925662
|
|
|
|
|
|
|
| |
To replace blaze_util::die and blaze_util::pdie as well, FATAL statements need to accept blaze exit codes.
RELNOTES: None.
PiperOrigin-RevId: 190285798
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
breaks building //src:bazel
*** Original change description ***
runfiles,C++: move to //tools/cpp/runfiles
Move the C++ runfiles library to the location of
the rest of the C++ tools.
Also change the C++ namespace to reflect the
directory hierarchy.
We have not yet announced nor released the C++
runfiles library so these refactorings are fine.
See https://github.com/bazelbuild/bazel/issues/4460
Closes #4873.
PiperOrigin-RevId: 189883066
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the C++ runfiles library to the location of
the rest of the C++ tools.
Also change the C++ namespace to reflect the
directory hierarchy.
We have not yet announced nor released the C++
runfiles library so these refactorings are fine.
See https://github.com/bazelbuild/bazel/issues/4460
Closes #4873.
Change-Id: I1732ef1eaff880cae05b7d218a3b1c0461a6b029
PiperOrigin-RevId: 189874201
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement a manifest-based Runfiles object, add
tests and test utils (MockFile).
Subsequent commits will add more feataures:
- creating list of envvars to pass to child
processes
- automatic Runfiles creation based on argv[0] and
the envvars of this process
See https://github.com/bazelbuild/bazel/issues/4460
Change-Id: I4376ede3ac00241688ff16a36ed596fb08f13a72
PiperOrigin-RevId: 187318502
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
1.Deleted config_setting for --cpu=x64_windows_msys, because we don't build
Bazel with MSYS gcc anymore.
2.Deleted config_setting for --cpu=x64_windows_msvc, because it uses exactly
the same toolchain as --cpu=x64_windows, it'll be removed in the future.
This change reduces the complexity of our BUILD files and make them less
confusing.
Change-Id: I939831a6861413b0f745fb1be98aacd4fb780e0a
PiperOrigin-RevId: 181751853
|
|
|
|
|
|
|
| |
This will enable an easier transition from checked-in BUILD files to ones generated by copybara.
RELNOTES: None
PiperOrigin-RevId: 177514519
|
|
|
|
|
| |
Change-Id: I25795c748fa98b9275ae34ead17fce02a57dc8e4
PiperOrigin-RevId: 166816800
|
|
|
|
|
|
| |
from third_party.
PiperOrigin-RevId: 166475827
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move the Windows JNI C++ sources to a separate
package and separate namespace.
This no-op refactoring allows other build rules
than Bazel's client library to depend on file I/O
and/or JNI functionality.
A follow-up commit will split the
//src/main/native/windows:processes library into
:jni-processes and :jni-file.
Change-Id: I33c5f8ebd8961cc440db3b4a95ff78024d7c1d74
PiperOrigin-RevId: 160404298
|
|
|
|
|
|
|
|
|
|
| |
Please refer to patch set 9 and its CI run for usage and test
results. In practice, users should create their own java_toolchain
rule in their project's BUILD file, and set the two attributes like
above instead of modifying //tools/jdk/BUILD.
Change-Id: Ic880f243086b00a58d453a8139ba4c957fe54bc7
PiperOrigin-RevId: 159694649
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After this change, a msys bazel can be built with
a MSVC-default Bazel by adding --cpu=x64_windows_msys --host=x64_windows_msys
See https://github.com/bazelbuild/bazel/issues/2627
--
Change-Id: Iaa82bf4dd911c5740b98d3b2739dfccca6203f79
Reviewed-on: https://cr.bazel.build/9293
PiperOrigin-RevId: 149532274
MOS_MIGRATED_REVID=149532274
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Ijar will use Bazel's file handling logic so that
we don't have to maintain two implementations, and
don't have to copy this code to implement the
Windows/MSVC code path in
third_party/ijar/platform_utils.cc.
See https://github.com/bazelbuild/bazel/issues/2157
--
Change-Id: Iec327febb882aeaabae55216d0d06488f7c151ed
Reviewed-on: https://cr.bazel.build/9068
PiperOrigin-RevId: 148770951
MOS_MIGRATED_REVID=148770951
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is the last function we needed from
file_posix for MSYS, so now we can remove that
from the compilation.
Fixes https://github.com/bazelbuild/bazel/issues/2386
The problem originally was that I used CloseHandle
to close the HANDLE, instead of using FindClose,
so we were holding on to open directory HANDLEs,
so we couldn't rename the installation directory.
See https://github.com/bazelbuild/bazel/issues/2107
--
Change-Id: If6c1b3c99cf386d82e829dbee2323e6bce5f6b46
Reviewed-on: https://cr.bazel.build/8952
PiperOrigin-RevId: 147734165
MOS_MIGRATED_REVID=147734165
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Move `strerror` calls into errors_<platform>.
We have to get rid of direct `errno` reading too,
because it doesn't work on Windows native.
Fixes https://github.com/bazelbuild/bazel/issues/2411
--
Change-Id: I69ff502487d698aa9e9147f02fd0bc5253e94e64
Reviewed-on: https://cr.bazel.build/8490
PiperOrigin-RevId: 145777524
MOS_MIGRATED_REVID=145777524
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Create an IFileMtime class and platform-specific
implementations to deal with mtime handling.
Since epochs and time granularity vary from
platform to platform, and we only care about
setting a file's/directory's mtime to the current
time or to a future time plus querying whether
something is in the future, we can easily create
an interface for these operations and that's
exactly what IFileMtime is.
Implement PosixFileMtime and WindowsFileMtime.
See https://github.com/bazelbuild/bazel/issues/2107
--
PiperOrigin-RevId: 144956966
MOS_MIGRATED_REVID=144956966
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use file_windows.cc and file_posix.cc when
compiling for MSYS/GCC (--cpu=x64_windows).
This way we can implement functions in
file_windows.cc one by one, start using them with
MSYS, and put #ifdef __CYGWIN__ ... #endif around
these functions in file_posix.cc, until all
functions are implemented in file_windows.cc.
The change contains a lot of code deletion, but
nothing should change because of that. The deleted
code was not being used at all: neither with MSVC
(it was behind #else // not COMPILER_MSVC) nor
with MSYS (the file was not in the `select` of the
rule's `srcs`).
See https://github.com/bazelbuild/bazel/issues/2107
--
PiperOrigin-RevId: 142128611
MOS_MIGRATED_REVID=142128611
|
|
|
|
|
|
|
| |
later change.
--
MOS_MIGRATED_REVID=139951184
|
|
|
|
|
|
|
|
|
|
| |
Move the hashed base directory computation logic
into blaze_util_<platform>.cc in order to clean up
the call site and move platform-dependent code out
the client's main file.
--
MOS_MIGRATED_REVID=139319487
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change:
- merges the //src/{main,test}/cpp:file and
//src/{main,test}/cpp:file_platform libraries
because "file" and "file_platform" need each other
and this makes logical sense anyway
- implements a function in file_<platform> to run
a custom function on every child of a directory
- implements a function in file.cc to recursively
traverse a directory tree, based on the previosly
mentioned function
- removes the corresponding logic from the Bazel
client to make it more portable
--
MOS_MIGRATED_REVID=139309562
|
|
|
|
|
|
|
|
|
|
| |
Introduced by commit 9c95196bf21e42bf46df9436a84d263c26e972d2.
Tested:
"bazel build --nobuild //src/{main,test}/cpp/...:all"
--
MOS_MIGRATED_REVID=138855659
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change:
- starts using blaze_util::CanAccess and
blaze_util::PathExists instead of access(2)
- implements and starts using blaze_util::GetCwd
instead of getcwd(2)
- implements and starts using
blaze_util::ChangeDirectory instead of chdir(2)
- adds tests for the new wrapper methods
--
MOS_MIGRATED_REVID=138750297
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit repurposes file_posix.cc to be the
POSIX API file handling implementation, and adds
file_windows.cc for the Win32 API implementations.
Furthermore it introduces file_platform.h that
declares the interface.
Subsequent changes will replace POSIX API calls in
the rest of the C++ code with these abstract
methods.
Motivation: our code is so littered with
POSIX-isms that we need an abstraction layer if we
hope to compile it with MSVC.
--
MOS_MIGRATED_REVID=138615822
|
|
|
|
|
|
|
|
|
|
|
|
| |
Subsequent commits will move methods out of
src/main/cpp/blaze_util.cc and into file.h or
file_<platform>.cc. Many of those methods heavily
rely on the POSIX API, and we need to reimplement
them against the Win32 API to compile Bazel on
Windows using MSVC.
--
MOS_MIGRATED_REVID=135128504
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
*** Reason for rollback ***
Other projects may depend on Ijar without wanting to depend on Bazel.
*** Original change description ***
Ijar: use utilities from Bazel's source
Remove a duplicate implementation of JoinPath.
--
MOS_MIGRATED_REVID=135088616
|
|
|
|
|
|
|
| |
Remove a duplicate implementation of JoinPath.
--
MOS_MIGRATED_REVID=134778185
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This method is only used by blaze_util_linux.cc so
instead of porting it to Windows, I'm moving it to
a separate library.
As part of this change I'm creating separate
libraries for other sources in //src/main/cpp/util
as well, so their dependencies are clearly defined
in the BUILD file, plus we can port them one by
one.
This is part of the effort of compiling Bazel on
Windows with the MSVC toolchain.
--
MOS_MIGRATED_REVID=134636777
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=128195657
|
|
|
|
|
|
|
|
| |
This target include all non tests targets of Bazel to do integration tests of
bootstrapping.
--
MOS_MIGRATED_REVID=115830741
|
|
|
|
|
| |
--
MOS_MIGRATED_REVID=100109450
|
|
--
MOS_MIGRATED_REVID=98918607
|