-
Notifications
You must be signed in to change notification settings - Fork 49
Windows Support #58
Comments
This is also a blocker for Angular rules, my failure looks like
|
@alexeagle : what's an easy, simple way to repro? |
@laszlocsomor run the skydoc examples on windows? |
Note, the protobuf library and rules_sass now both succeed on windows. Now it's skydoc itself that fails because it doesn't handle lack of runfiles symlinks:
|
@alexeagle , could you tell me your repo's github link and what commit you checked out, so I can repro the same error? Which Bazel version did you use? |
rules_nodejs master |
Using Windows 10, Bazel 0.17.1, skydoc at d34c44c, and running
|
@alexeagle , thanks, that helped! I could repro the issue and fix it in Skydoc. I'll send a PR shortly. I can now build |
`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 bazelbuild#58
@filipesilva : With #108 in my local copy of skydoc, and |
I'm using Bazel 0.17.1 on Windows 10 |
@filipesilva : Which Python version are you using? The error in #58 (comment) looks like a python incompatibility issue. |
Yes, indeed the Python version is the issue. I can build when I put Python 2 on the PATH, but I get the same error as #58 (comment) with Python 3. |
@laszlocsomor just checked and I am indeed using Python 3.7.0. Should I be on Python 2? https://docs.bazel.build/versions/master/windows.html#build-python mentions both are supported so I just went with the latest. |
@filipesilva : Bazel can use both major versions of Python, but apparently the Skydoc python scripts were written for 2. I'm not happy to say this, but frankly it's probably less likely to see such breakages if you use Python 2. (That said, from now I'll make sure to always use Py 3 for my own builds to ensure all my scripts are compatible.) |
* 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
As a consequence, Bazel on Windows can now build //docs/... See bazelbuild/skydoc#58
As a consequence, Bazel on Windows can now build //docs/... See bazelbuild/skydoc#58
@laszlocsomor that indeed is unfortunate but personally it makes no difference to use 2.7 or 3.7 so I will use 2.7. I tried running your bazelbuild/rules_typescript#282 PR locally and it does finish successfully on Windows. However, CI shows it seems to fail on everything but windows...
|
I'm looking at the CI failures now. |
Now we can build `//docs/...` in rules_typescript and rules_nodejs on Linux too, where sandboxing is enabled by default and where the previously buggy code path is used. See bazelbuild#58
* Fix off-by-one error in substring creation. Now we can build `//docs/...` in rules_typescript and rules_nodejs on Linux too, where sandboxing is enabled by default and where the previously buggy code path is used. See #58
@laszlocsomor I tried using the updated skydoc on rules_typescript/rules_nodejs (as a followup to your PRs) and also ran into into the python issue there:
This is the same error I saw above when using Python 3.7, which I guess means https://github.com/bazelbuild/continuous-integration is using that version as well. Also cc @meteorcloudy since last time something was needed in the CI setup (bazel-contrib/bazel-gazelle#321 (comment)) he took care of it. |
Skydoc is still using gflag 2.0, which I suppose doesn't support Python 3. |
I got this error after upgrading gflag in Skydoc
Looks like Skydoc itself need to fix Python3 compatibility. |
@meteorcloudy should the bazel CI move to use Python 2.7 then? |
@filipesilva Just confirmed we don't have Python2 installed in Windows slaves on our CI. I think the best way to go here is to make Skydoc Python3 compatible. I can investigate to see how difficult it would be. /cc @c-parsons |
@filipesilva : sorry for late response, I was away. @meteorcloudy , thanks for stepping in! |
* Update skydoc repo to d9b3e3b, to fix skydoc #58 As a consequence, Bazel on Windows can now build //docs/... See bazelbuild/skydoc#58 * Use kysdoc@dbb9034 * Trim spaces from sha256
As a consequence, Bazel on Windows can now build //docs/... See bazelbuild/skydoc#58 Closes #282 PiperOrigin-RevId: 214941694
As a consequence, Bazel on Windows can now build //docs/... See bazelbuild/skydoc#58 Closes bazel-contrib#282 PiperOrigin-RevId: 214941694
As a consequence, Bazel on Windows can now build //docs/... See bazelbuild/skydoc#58 Closes bazel-contrib#282 PiperOrigin-RevId: 214941694
I've run into issues with dependencies pulled in by
skydoc
in several repos I collaborate on, you can see a sample error here.This being clean on Windows is blocking Windows support on at least
google/subpar
andbazelbuild/rules_python
. To be clear: we can comment this stuff out to uncover other issues, but we cannot enable Windows CI or declare support without this working.@davidstanke @davidzchen @dslomov FYI.
The text was updated successfully, but these errors were encountered: