Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ASwBazel build errors with Bazel 0.28 #976

Closed
jin opened this issue Jul 11, 2019 · 9 comments
Closed

ASwBazel build errors with Bazel 0.28 #976

jin opened this issue Jul 11, 2019 · 9 comments
Assignees

Comments

@jin
Copy link
Member

jin commented Jul 11, 2019

Usage of android_common without --experimental_google_legacy_api.

$ bazel build //aswb:aswb_bazel_zip --define=ij_product=android-studio-latest
INFO: Build option --define has changed, discarding analysis cache.
ERROR: /Users/jingwen/code/intellij/aspect/intellij_info_impl.bzl:105:25: android_common is experimental and thus unavailable with the current flags. It may be enabled by setting --experimental_google_legacy_api
ERROR: /Users/jingwen/code/intellij/aswb/BUILD:212:1: error loading package 'aspect': Extension 'aspect/intellij_info_impl.bzl' has errors and referenced by '//aswb:aspect_directory'
ERROR: Analysis of target '//aswb:aswb_bazel_zip' failed; build aborted: Analysis failed
INFO: Elapsed time: 0.470s
INFO: 0 processes.
FAILED: Build did NOT complete successfully (1 packages loaded, 19 targets configured)
    currently loading: java ... (2 packages)
    Fetching @local_config_sh; Restarting.

Running zip_plugin_files.py with host Python 3:

$ bazel build //aswb:aswb_bazel_zip --define=ij_product=android-studio-latest --experimental_google_legacy_api
INFO: Analyzed target //aswb:aswb_bazel_zip (62 packages loaded, 2243 targets configured).
INFO: Found 1 target...
ERROR: /Users/jingwen/code/intellij/aswb/BUILD:234:1: Creating final plugin zip archive failed (Exit 1) zip_plugin_files failed: error executing command bazel-out/host/bin/build_defs/zip_plugin_files --output bazel-out/darwin-fastbuild/bin/aswb/aswb_bazel.zip aspect/WORKSPACE aswb/aspect/WORKSPACE aspect/artifacts.bzl aswb/aspect/artifacts.bzl ... (remaining 20 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
Traceback (most recent call last):
  File "/private/var/tmp/_bazel_jingwen/a7f9cfb321ff8f053a43633ca4d90cc9/sandbox/darwin-sandbox/379/execroot/intellij_with_bazel/bazel-out/host/bin/build_defs/zip_plugin_files.runfiles/intellij_with_bazel/build_defs/zip_plugin_files.py", line 38, in <module>
    main()
  File "/private/var/tmp/_bazel_jingwen/a7f9cfb321ff8f053a43633ca4d90cc9/sandbox/darwin-sandbox/379/execroot/intellij_with_bazel/bazel-out/host/bin/build_defs/zip_plugin_files.runfiles/intellij_with_bazel/build_defs/zip_plugin_files.py", line 35, in main
    outfile.writestr(zipinfo, input_file.read(), zipfile.ZIP_DEFLATED)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xfe in position 39: ordinal not in range(128)
----------------
Note: The failure of target //build_defs:zip_plugin_files (with exit code 1) may have been caused by the fact that it is a Python 2 program that was built in the host configuration, which uses Python 3. You can change the host configuration (for the entire build) to instead use Python 2 by setting --host_force_python=PY2.

If this error started occurring in Bazel 0.27 and later, it may be because the Python toolchain now enforces that targets analyzed as PY2 and PY3 run under a Python 2 and Python 3 interpreter, respectively. See https://github.com/bazelbuild/bazel/issues/7899 for more information.
----------------
Target //aswb:aswb_bazel_zip failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 347.553s, Critical Path: 91.50s
INFO: 370 processes: 348 darwin-sandbox, 22 worker.
FAILED: Build did NOT complete successfully
@jin jin self-assigned this Jul 11, 2019
@jin
Copy link
Member Author

jin commented Jul 11, 2019

This error does not show up with Bazel 0.27.x.

@jin
Copy link
Member Author

jin commented Jul 11, 2019

Reported in bazelbuild/bazel#8571 (comment)

@jin
Copy link
Member Author

jin commented Jul 11, 2019

Keeping this open until the patch release is out.

@jin jin reopened this Jul 11, 2019
ghost pushed a commit that referenced this issue Jul 12, 2019
…import #978)

Bazel 0.27.0 introduced an incompatible change flag that forces the host python to be python3. This changes the way encoding/decoding is done, causing failures as seen in #976 (comment):

```
$ bazel build //aswb:aswb_bazel_zip --define=ij_product=android-studio-latest --experimental_google_legacy_api
INFO: Analyzed target //aswb:aswb_bazel_zip (62 packages loaded, 2243 targets configured).
INFO: Found 1 target...
ERROR: /Users/jingwen/code/intellij/aswb/BUILD:234:1: Creating final plugin zip archive failed (Exit 1) zip_plugin_files failed: error executing command bazel-out/host/bin/build_defs/zip_plugin_files --output bazel-out/darwin-fastbuild/bin/aswb/aswb_bazel.zip aspect/WORKSPACE aswb/aspect/WORKSPACE aspect/artifacts.bzl aswb/aspect/artifacts.bzl ... (remaining 20 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
Traceback (most recent call last):
  File "/private/var/tmp/_bazel_jingwen/a7f9cfb321ff8f053a43633ca4d90cc9/sandbox/darwin-sandbox/379/execroot/intellij_with_bazel/bazel-out/host/bin/build_defs/zip_plugin_files.runfiles/intellij_with_bazel/build_defs/zip_plugin_files.py", line 38, in <module>
    main()
  File "/private/var/tmp/_bazel_jingwen/a7f9cfb321ff8f053a43633ca4d90cc9/sandbox/darwin-sandbox/379/execroot/intellij_with_bazel/bazel-out/host/bin/build_defs/zip_plugin_files.runfiles/intellij_with_bazel/build_defs/zip_plugin_files.py", line 35, in main
    outfile.writestr(zipinfo, input_file.read(), zipfile.ZIP_DEFLATED)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xfe in position 39: ordinal not in range(128)
----------------
Note: The failure of target //build_defs:zip_plugin_files (with exit code 1) may have been caused by the fact that it is a Python 2 program that was built in the host configuration, which uses Python 3. You can change the host configuration (for the entire build) to instead use Python 2 by setting --host_force_python=PY2.

If this error started occurring in Bazel 0.27 and later, it may be because the Python toolchain now enforces that targets analyzed as PY2 and PY3 run under a Python 2 and Python 3 interpreter, respectively. See bazelbuild/bazel#7899 for more information.
----------------
Target //aswb:aswb_bazel_zip failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 347.553s, Critical Path: 91.50s
INFO: 370 processes: 348 darwin-sandbox, 22 worker.
FAILED: Build did NOT complete successfully
```

This PR fixes that breakage by extending the decoder to from using ascii to direct bytes, allowing zip_plugin_files.py to be used with Python 3 directly.

Closes #978

PiperOrigin-RevId: 257788170
irengrig pushed a commit to irengrig/bazel that referenced this issue Jul 15, 2019
…oogle_legacy_api

This should be patched into 0.28.0 to fix bazelbuild/intellij#976

Closes bazelbuild#8860.

PiperOrigin-RevId: 257574106
laurentlb pushed a commit to bazelbuild/bazel that referenced this issue Jul 16, 2019
…oogle_legacy_api

This should be patched into 0.28.0 to fix bazelbuild/intellij#976

Closes #8860.

PiperOrigin-RevId: 257574106
@cgruber
Copy link
Contributor

cgruber commented Jul 17, 2019

Once you get through this, I'm getting a lot of --incompatible_depset_is_not_iterable=false problems, as the intellij starlark stuff apparently tries to iterate over depsets.

@jin
Copy link
Member Author

jin commented Jul 17, 2019

@cgruber all the instances of that issue have been resolved on master. What's the version of the your plugin?

@neakor
Copy link

neakor commented Jul 18, 2019

We are experiencing this issue as well. When will the 0.28 patch version be released?

@jin
Copy link
Member Author

jin commented Jul 18, 2019

@neakor 0.28.1rc1 is available. I've requested for rc1 to be promoted to a release: bazelbuild/bazel#8571 (comment)

@jin
Copy link
Member Author

jin commented Jul 19, 2019

0.28.1 is now available. If you're running into --experimental_google_legacy_api issues, please update to 0.28.1 and not 0.28.0.

@jin jin closed this as completed Jul 19, 2019
@neakor
Copy link

neakor commented Jul 20, 2019

Thank you!

liucijus pushed a commit to wix-playground/intellij that referenced this issue Aug 21, 2019
…import bazelbuild#978)

Bazel 0.27.0 introduced an incompatible change flag that forces the host python to be python3. This changes the way encoding/decoding is done, causing failures as seen in bazelbuild#976 (comment):

```
$ bazel build //aswb:aswb_bazel_zip --define=ij_product=android-studio-latest --experimental_google_legacy_api
INFO: Analyzed target //aswb:aswb_bazel_zip (62 packages loaded, 2243 targets configured).
INFO: Found 1 target...
ERROR: /Users/jingwen/code/intellij/aswb/BUILD:234:1: Creating final plugin zip archive failed (Exit 1) zip_plugin_files failed: error executing command bazel-out/host/bin/build_defs/zip_plugin_files --output bazel-out/darwin-fastbuild/bin/aswb/aswb_bazel.zip aspect/WORKSPACE aswb/aspect/WORKSPACE aspect/artifacts.bzl aswb/aspect/artifacts.bzl ... (remaining 20 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
Traceback (most recent call last):
  File "/private/var/tmp/_bazel_jingwen/a7f9cfb321ff8f053a43633ca4d90cc9/sandbox/darwin-sandbox/379/execroot/intellij_with_bazel/bazel-out/host/bin/build_defs/zip_plugin_files.runfiles/intellij_with_bazel/build_defs/zip_plugin_files.py", line 38, in <module>
    main()
  File "/private/var/tmp/_bazel_jingwen/a7f9cfb321ff8f053a43633ca4d90cc9/sandbox/darwin-sandbox/379/execroot/intellij_with_bazel/bazel-out/host/bin/build_defs/zip_plugin_files.runfiles/intellij_with_bazel/build_defs/zip_plugin_files.py", line 35, in main
    outfile.writestr(zipinfo, input_file.read(), zipfile.ZIP_DEFLATED)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xfe in position 39: ordinal not in range(128)
----------------
Note: The failure of target //build_defs:zip_plugin_files (with exit code 1) may have been caused by the fact that it is a Python 2 program that was built in the host configuration, which uses Python 3. You can change the host configuration (for the entire build) to instead use Python 2 by setting --host_force_python=PY2.

If this error started occurring in Bazel 0.27 and later, it may be because the Python toolchain now enforces that targets analyzed as PY2 and PY3 run under a Python 2 and Python 3 interpreter, respectively. See bazelbuild/bazel#7899 for more information.
----------------
Target //aswb:aswb_bazel_zip failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 347.553s, Critical Path: 91.50s
INFO: 370 processes: 348 darwin-sandbox, 22 worker.
FAILED: Build did NOT complete successfully
```

This PR fixes that breakage by extending the decoder to from using ascii to direct bytes, allowing zip_plugin_files.py to be used with Python 3 directly.

Closes bazelbuild#978

PiperOrigin-RevId: 257788170
krlvi pushed a commit to krlvi/intellij that referenced this issue Sep 20, 2019
…import bazelbuild#978)

Bazel 0.27.0 introduced an incompatible change flag that forces the host python to be python3. This changes the way encoding/decoding is done, causing failures as seen in bazelbuild#976 (comment):

```
$ bazel build //aswb:aswb_bazel_zip --define=ij_product=android-studio-latest --experimental_google_legacy_api
INFO: Analyzed target //aswb:aswb_bazel_zip (62 packages loaded, 2243 targets configured).
INFO: Found 1 target...
ERROR: /Users/jingwen/code/intellij/aswb/BUILD:234:1: Creating final plugin zip archive failed (Exit 1) zip_plugin_files failed: error executing command bazel-out/host/bin/build_defs/zip_plugin_files --output bazel-out/darwin-fastbuild/bin/aswb/aswb_bazel.zip aspect/WORKSPACE aswb/aspect/WORKSPACE aspect/artifacts.bzl aswb/aspect/artifacts.bzl ... (remaining 20 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
Traceback (most recent call last):
  File "/private/var/tmp/_bazel_jingwen/a7f9cfb321ff8f053a43633ca4d90cc9/sandbox/darwin-sandbox/379/execroot/intellij_with_bazel/bazel-out/host/bin/build_defs/zip_plugin_files.runfiles/intellij_with_bazel/build_defs/zip_plugin_files.py", line 38, in <module>
    main()
  File "/private/var/tmp/_bazel_jingwen/a7f9cfb321ff8f053a43633ca4d90cc9/sandbox/darwin-sandbox/379/execroot/intellij_with_bazel/bazel-out/host/bin/build_defs/zip_plugin_files.runfiles/intellij_with_bazel/build_defs/zip_plugin_files.py", line 35, in main
    outfile.writestr(zipinfo, input_file.read(), zipfile.ZIP_DEFLATED)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xfe in position 39: ordinal not in range(128)
----------------
Note: The failure of target //build_defs:zip_plugin_files (with exit code 1) may have been caused by the fact that it is a Python 2 program that was built in the host configuration, which uses Python 3. You can change the host configuration (for the entire build) to instead use Python 2 by setting --host_force_python=PY2.

If this error started occurring in Bazel 0.27 and later, it may be because the Python toolchain now enforces that targets analyzed as PY2 and PY3 run under a Python 2 and Python 3 interpreter, respectively. See bazelbuild/bazel#7899 for more information.
----------------
Target //aswb:aswb_bazel_zip failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 347.553s, Critical Path: 91.50s
INFO: 370 processes: 348 darwin-sandbox, 22 worker.
FAILED: Build did NOT complete successfully
```

This PR fixes that breakage by extending the decoder to from using ascii to direct bytes, allowing zip_plugin_files.py to be used with Python 3 directly.

Closes bazelbuild#978

PiperOrigin-RevId: 257788170
aradchykov pushed a commit to aradchykov/intellij that referenced this issue Oct 6, 2019
…import bazelbuild#978)

Bazel 0.27.0 introduced an incompatible change flag that forces the host python to be python3. This changes the way encoding/decoding is done, causing failures as seen in bazelbuild#976 (comment):

```
$ bazel build //aswb:aswb_bazel_zip --define=ij_product=android-studio-latest --experimental_google_legacy_api
INFO: Analyzed target //aswb:aswb_bazel_zip (62 packages loaded, 2243 targets configured).
INFO: Found 1 target...
ERROR: /Users/jingwen/code/intellij/aswb/BUILD:234:1: Creating final plugin zip archive failed (Exit 1) zip_plugin_files failed: error executing command bazel-out/host/bin/build_defs/zip_plugin_files --output bazel-out/darwin-fastbuild/bin/aswb/aswb_bazel.zip aspect/WORKSPACE aswb/aspect/WORKSPACE aspect/artifacts.bzl aswb/aspect/artifacts.bzl ... (remaining 20 argument(s) skipped)

Use --sandbox_debug to see verbose messages from the sandbox
Traceback (most recent call last):
  File "/private/var/tmp/_bazel_jingwen/a7f9cfb321ff8f053a43633ca4d90cc9/sandbox/darwin-sandbox/379/execroot/intellij_with_bazel/bazel-out/host/bin/build_defs/zip_plugin_files.runfiles/intellij_with_bazel/build_defs/zip_plugin_files.py", line 38, in <module>
    main()
  File "/private/var/tmp/_bazel_jingwen/a7f9cfb321ff8f053a43633ca4d90cc9/sandbox/darwin-sandbox/379/execroot/intellij_with_bazel/bazel-out/host/bin/build_defs/zip_plugin_files.runfiles/intellij_with_bazel/build_defs/zip_plugin_files.py", line 35, in main
    outfile.writestr(zipinfo, input_file.read(), zipfile.ZIP_DEFLATED)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/encodings/ascii.py", line 26, in decode
    return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xfe in position 39: ordinal not in range(128)
----------------
Note: The failure of target //build_defs:zip_plugin_files (with exit code 1) may have been caused by the fact that it is a Python 2 program that was built in the host configuration, which uses Python 3. You can change the host configuration (for the entire build) to instead use Python 2 by setting --host_force_python=PY2.

If this error started occurring in Bazel 0.27 and later, it may be because the Python toolchain now enforces that targets analyzed as PY2 and PY3 run under a Python 2 and Python 3 interpreter, respectively. See bazelbuild/bazel#7899 for more information.
----------------
Target //aswb:aswb_bazel_zip failed to build
Use --verbose_failures to see the command lines of failed build steps.
INFO: Elapsed time: 347.553s, Critical Path: 91.50s
INFO: 370 processes: 348 darwin-sandbox, 22 worker.
FAILED: Build did NOT complete successfully
```

This PR fixes that breakage by extending the decoder to from using ascii to direct bytes, allowing zip_plugin_files.py to be used with Python 3 directly.

Closes bazelbuild#978

PiperOrigin-RevId: 257788170
luca-digrazia pushed a commit to luca-digrazia/DatasetCommitsDiffSearch that referenced this issue Sep 4, 2022
…google_legacy_api

    This should be patched into 0.28.0 to fix bazelbuild/intellij#976

    Closes #8860.

    PiperOrigin-RevId: 257574106
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants