wpilibsuite / styleguide

Style guides for wpilibsuite projects
Other
5 stars 16 forks source link

Bazel causes a few tools to fail #293

Closed Gold856 closed 1 day ago

Gold856 commented 1 week ago

Running wpiformat gives me this error:

error: D:/allwpilib\bazel-allwpilib\bazel-out\x64_windows-opt-exec-ST-a828a81199fe\bin\external\rules_jvm_external\private\tools\java\com\github\bazelbuild\rules_jvm_external\zip\_javac\zip\libzip_classes\com\github\bazelbuild\rules_jvm_external\zip\StableZipEntry.class: No such file or directory

Running isort with the --gitignore flag and specifying .\bazel-allwpilib\ causes it to spit out: fatal: not a git repository (or any of the parent directories): .git about 844 times and that it skipped 116 files. Running it without the --gitignore flag causes it spit out this:

C:\Users\gold2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\isort\main.py:104: UserWarning: Unable to parse file .\bazel-allwpilib\bazel-out\x64_windows-opt-exec-ST-a828a81199fe\bin\shared\bazel\rules\gen\gen_resources.temp due to [WinError 5] Access is denied: 'C:\\Users\\gold2\\_bazel_gold2\\himijvnp\\execroot\\__main__\\bazel-out\\x64_windows-opt-exec-ST-a828a81199fe\\bin\\shared\\bazel\\rules\\gen\\gen_resources.temp.isorted'
  warn(f"Unable to parse file {file_name} due to {error}")
C:\Users\gold2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\isort\main.py:104: UserWarning: Unable to parse file .\bazel-allwpilib\bazel-out\x64_windows-opt-exec-ST-a828a81199fe\bin\shared\bazel\rules\gen\gen_resources.temp.isorted due to [WinError 5] Access is denied: 'C:\\Users\\gold2\\_bazel_gold2\\himijvnp\\execroot\\__main__\\bazel-out\\x64_windows-opt-exec-ST-a828a81199fe\\bin\\shared\\bazel\\rules\\gen\\gen_resources.temp.isorted.isorted'
  warn(f"Unable to parse file {file_name} due to {error}")
C:\Users\gold2\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.11_qbz5n2kfra8p0\LocalCache\local-packages\Python311\site-packages\isort\main.py:104: UserWarning: Unable to parse file .\bazel-allwpilib\bazel-out\x64_windows-opt-exec-ST-a828a81199fe\bin\shared\bazel\rules\gen\gen_resources.temp.isorted.isorted due to [WinError 5] Access is denied: 'C:\\Users\\gold2\\_bazel_gold2\\himijvnp\\execroot\\__main__\\bazel-out\\x64_windows-opt-exec-ST-a828a81199fe\\bin\\shared\\bazel\\rules\\gen\\gen_resources.temp.isorted.isorted.isorted'
  warn(f"Unable to parse file {file_name} due to {error}")
Skipped 54 files
calcmogul commented 1 week ago

This is because wpiformat throws errors on broken symlinks.

    # Throw an error if any files or directories don't exist
    for f in files:
        if not os.path.exists(f):
            print(f"error: {f}: No such file or directory")
            sys.exit(1)

This check occurs before gitignored files are filtered out.