This repository has been archived by the owner on Sep 15, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix runfile lookup in skydoc/main.py (#108)
* Fix runfile lookup in skydoc/main.py `skydoc/main.py` now uses Bazel's built-in runfiles library to look up data-dependencies. This commit introduces one hack: we use os.path.dirname (actually: posixpath.dirname) on a path returned by the runfiles library. This is wrong, because the runfiles path does not necessarily correlate with the actual path of the file, i.e. the path that the runfiles-lookup library returns. For example, if //foo:a and //foo:generated-b are both data-dependencies, they'll both be under the "foo" runfiles-directory, but will be in different real paths. This is fine on Linux because Bazel generates a runfiles tree with symlinks, but breaks on Windows because there Bazel only generates a runfiles manifest. Fortunately, for now, all files under `skydoc/templates` are source files, so this hack works. If anyone ever adds generated files to //skydoc/templates:templates, this hack will break. See #58
- Loading branch information
1 parent
d34c44c
commit d9b3e3b
Showing
2 changed files
with
40 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters