angular: Problems when running bazel commands from this repo

I am having issues to run the following command from this repo on windows:

yarn test-ivy-aot

The command is run in the following folder:

C:\projects\Archive\angular

bazel then complained about space in my user’s folder, so I added the output_user_root into the package.json command, resulting in this now:

"test-ivy-aot": "bazel --output_user_root=C:\\bazel-temp\\ test --config=ivy --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot"

The bazel-temp folder was created. It did not exist.

When I now run yarn test-ivy-aot, I get the below:

PS C:\projects\Archive\angular> yarn test-ivy-aot
yarn run v1.21.1
$ bazel --output_user_root=C:\bazel-temp\ test --config=ivy --build_tag_filters=-no-ivy-aot,-fixme-ivy-aot --test_tag_filters=-no-ivy-aot,-fixme-ivy-aot
Extracting Bazel installation...
Starting local Bazel server and connecting to it...
WARNING: Download from https://mirror.bazel.build/nodejs.org/dist/v12.14.1/node-v12.14.1-win-x64.zip failed: class com.google.devtools.build.lib.bazel.repository.downloader.UnrecoverableHttpException GET returned 404 Not Found
INFO: Analyzed 0 targets (0 packages loaded, 0 targets configured).
INFO: Found 0 test targets...
WARNING: failed to create one or more convenience symlinks for prefix 'dist/':
  cannot create symbolic link dist/bin -> C:/bazel-temp/7lxopdvs/execroot/angular/bazel-out/x64_windows-fastbuild/bin:  Cannot create junction (name=C:\projects\archive\angular\dist\bin, target=C:\bazel-temp\7lxopdvs\execroot\angular\bazel-out\x64_windows-fastbuild\bin): a file or directory already exists at the junction's path
  cannot create symbolic link dist/testlogs -> C:/bazel-temp/7lxopdvs/execroot/angular/bazel-out/x64_windows-fastbuild/testlogs:  Cannot create junction (name=C:\projects\archive\angular\dist\testlogs, target=C:\bazel-temp\7lxopdvs\execroot\angular\bazel-out\x64_windows-fastbuild\testlogs): a file or directory already exists at the junction's path
  cannot create symbolic link bazel-out -> C:/bazel-temp/7lxopdvs/execroot/angular/bazel-out:  Cannot create junction (name=C:\projects\archive\angular\bazel-out, target=C:\bazel-temp\7lxopdvs\execroot\angular\bazel-out): a file or directory already exists at the junction's path
  cannot create symbolic link dist/out -> C:/bazel-temp/7lxopdvs/execroot/angular/bazel-out:  Cannot create junction (name=C:\projects\archive\angular\dist\out, target=C:\bazel-temp\7lxopdvs\execroot\angular\bazel-out): a file or directory already exists at the junction's path
  cannot create symbolic link dist/angular -> C:/bazel-temp/7lxopdvs/execroot/angular:  Cannot create junction (name=C:\projects\archive\angular\dist\angular, target=C:\bazel-temp\7lxopdvs\execroot\angular): a file or directory already exists at the junction's path
INFO: Elapsed time: 110.839s, Critical Path: 0.05s
INFO: 0 processes.
INFO: Build completed successfully, 1 total action
INFO: Build completed successfully, 1 total action
error Command failed with exit code 4.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

I used Windows PowerShell with Administrative privileges to run the commands.

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 32 (30 by maintainers)

Most upvoted comments

@sonukapoor I was following the guidelines in Windows 10 and having similar issues. Then I changed to git bash and another kind of error started.

I then realized that when I ran the python command in git bash a permission denied error appeared, but it was trying to execute something from the WindowsApps folder. Doing an “echo $PATH”, the “/c/Users/Daniel/AppData/Local/Microsoft/WindowsApps” was in it.

After seeing this line on your log, it could be related.

INFO: Options provided by the client: Inherited ‘build’ options: --python_path=C:/Users/Jyoti/AppData/Local/Microsoft/WindowsApps/python.exe

Try installing python 3 (if not already installed) and add the right path to the git bash, like the following: export PATH=“/c/[Path to python executable]:$PATH”

At least this seems to have worked for me. I hope it helps.

@sonukapoor, you need to provide a target of which tests to run, in the above logs it shows that no target was provided and it’s also being logged as Found 0 test targets.

Examples of test targets

yarn test-ivy-aot //...  // Run all tests in the repo
yarn test-ivy-aot //packages/core/...  // Run all tests in the core package

With regards to original symlink issue most likely a stale sandbox wasn’t deleted properly for a reason or another, as the error message is indicated that a junction cannot be created because it already exists. NB: junctions can be created without elevated privileges in Windows.

Can you try to run yarn bazel clean?