facebook / buck2

Build system, successor to Buck
https://buck2.build/
Apache License 2.0
3.33k stars 194 forks source link

error: Variable `typing` not found #599

Closed ChristophKarlHeck closed 2 months ago

ChristophKarlHeck commented 2 months ago

Hi guys, I am trying to build the executor_runner of executorch with the current branch (ceb1f1d05ceab420644a3633264f13547dc02411) of https://github.com/pytorch/executorch. Executing the following command:

/tmp/buck2 build //examples/portable/executor_runner:executor_runner --show-output

This leads to the following error:

File changed: root//.buckconfig.swp
File changed: root//.buckconfig.swx
File changed: root//.git/modules/third-party/prelude/index.lock
763 additional file change events
From `load` at implicit location

Caused by:
    0: From `load` at third-party/prelude/prelude.bzl:8:6-29
    1: From `load` at third-party/prelude/native.bzl:15:6-45
    2: From `load` at third-party/prelude/apple/apple_macro_layer.bzl:8:6-32
    3: Error evaluating module: `prelude//apple/apple_bundle_config.bzl`
    4: error: Variable `typing` not found
         --> third-party/prelude/apple/apple_bundle_config.bzl:14:40
          |
       14 | def apple_bundle_config() -> dict[str, typing.Any]:
          |                                        ^^^^^^
          |

Build ID: 9d787df0-2ac3-460c-80ec-7e6a8b5817ba
Jobs completed: 3. Time elapsed: 0.0s.
BUILD FAILED

What is going wrong here?

ndmitchell commented 2 months ago

Older Buck2 doesn't have support for typing module. Can you try with the latest version? It's been present a while, so I suspect the latest binary on the website would be sufficient

ChristophKarlHeck commented 2 months ago

@ndmitchell Thank you, it solved my issue :)