commit | a9b82978acccb7249bcef09637860ec95ce3e48a | [log] [tgz] |
---|---|---|
author | Nikolay Shelukhin <nikola-sh@narod.ru> | Tue Jan 28 07:55:18 2020 -0800 |
committer | Copybara-Service <copybara-worker@google.com> | Tue Jan 28 07:56:10 2020 -0800 |
tree | df4f17c94c567541e36bbb62577ada9ffbe2f9c1 | |
parent | c428ee515380b90c9105df4b88bd397af9a84fd5 [diff] |
Windows environment variable name can contain brackets Bazel cuts off environment variables with brackets in name. It leads to a problem for me. I have Visual Studio 2017 with workloads "Desktop C++ development", "TypeScript 3.1 SDK", "Python Web Support" installed. I use Visual Studio toolchain configuration script similar to `tools/cpp/windows_cc_configure.bzl`. My script in contrast to original finds more tools and checks a result of `VCVARSALL.BAT` also. I noticed that `VCVARSALL.BAT` fails with error: ``` [ERROR:typescript.bat] TypeScript was not added to PATH since a valid installation was not found [ERROR:VsDevCmd.bat] *** VsDevCmd.bat encountered errors. Environment may be incomplete and/or incorrect. *** [ERROR:VsDevCmd.bat] In an uninitialized command prompt, please 'set VSCMD_DEBUG=[value]' and then re-run [ERROR:VsDevCmd.bat] vsdevcmd.bat [args] for additional details. [ERROR:VsDevCmd.bat] Where [value] is: [ERROR:VsDevCmd.bat] 1 : basic debug logging [ERROR:VsDevCmd.bat] 2 : detailed debug logging [ERROR:VsDevCmd.bat] 3 : trace level logging. Redirection of output to a file when using this level is recommended. [ERROR:VsDevCmd.bat] Example: set VSCMD_DEBUG=3 [ERROR:VsDevCmd.bat] vsdevcmd.bat > vsdevcmd.trace.txt 2>&1 ``` It happens because `typescript.bat` can't access `ProgramFiles(x86)` environment variable: **typescript.bat**: ``` ... if exist "%ProgramFiles(x86)%\Microsoft SDKs\TypeScript\3.1" ( set "PATH=%ProgramFiles(x86)%\Microsoft SDKs\TypeScript\3.1;%PATH%" set _TypeScript_Found=1 ) ... ``` Exit code of `VCVARSALL.BAT` is ignored in original `tools/cpp/windows_cc_configure.bzl` so it is not critical bug but it can lead to unobvious errors for users who find external tools (TypeScript compiler, for example) with own scripts. Closes #10605. PiperOrigin-RevId: 291932741
{Fast, Correct} - Choose two
Build and test software of any size, quickly and reliably.
Speed up your builds and tests: Bazel rebuilds only what is necessary. With advanced local and distributed caching, optimized dependency analysis and parallel execution, you get fast and incremental builds.
One tool, multiple languages: Build and test Java, C++, Android, iOS, Go, and a wide variety of other language platforms. Bazel runs on Windows, macOS, and Linux.
Scalable: Bazel helps you scale your organization, codebase, and continuous integration solution. It handles codebases of any size, in multiple repositories or a huge monorepo.
Extensible to your needs: Easily add support for new languages and platforms with Bazel's familiar extension language. Share and re-use language rules written by the growing Bazel community.
Follow our tutorials:
See CONTRIBUTING.md