flipperdevices / flipperzero-ufbt

Compact tool for building and debugging applications for Flipper Zero.
https://pypi.org/project/ufbt/
GNU General Public License v3.0
494 stars 36 forks source link

Received invalid error message: "We only provide toolchain for x86_64 CPUs, sorry..." #34

Closed anoduck closed 4 months ago

anoduck commented 4 months ago

Received invalid error message on my system stating, "We only provide toolchain for x86_64 CPUs, sorry...", when my system is x86_64. The error is believed to be caused by the script not recognizing my Unix operating system, which is of the BSD variety.

Assistance would be great, until then I will have to look for a solution at a later time.

hedger commented 4 months ago

Unfortunately, we only provide pre-packaged toolchains for MacOS, Windows and Linux.

While fbt has FBT_NOENV option to ignore pre-packaged toolchain and allow use of custom tools from PATH, ufbt currently relies on pre-packaged versions only. It is planned to add a variation of that option to ufbt.

anoduck commented 4 months ago

So... This is a toolchain issue, not an issue with ufbt. It is a result of the unavailability of a pre-packaged toolchain for OpenBSD. Therefore, it is a matter of compiling the source code for the toolchain in OpenBSD to create a package for ufbt to use?

hedger commented 4 months ago

No, it's slightly more complicated.

Meanwhile, in this PR I've added support for FBT_NOENV variable to ufbt. Please try it out with ufbt update -b hedger/toochain_29 (only available while the branch is still not merged, afterwards it will be ufbt update -c dev), then run ufbt with FBT_NOENV=1 ufbt (or export FBT_NOENV=1 before calling ufbt).

After that, ufbt will not try to use prebuilt toolchains that are only available for a limited set of configurations, but will instead expect to find all required tools in your PATH.

Bare minimum is arm-none-eabi-gcc 12.3, Python3 with a set of libraries, and openocd.

anoduck commented 4 months ago

@hedger Stupid question. Is that python3 for arm, or MicroPython?

hedger commented 4 months ago

@anoduck it's regular Python. Our pre-built toolchain uses Python 3.11 with packages listed here.

Everything related to packaging of Flipper toolchain can be found in this repo: https://github.com/flipperdevices/flipperzero-toolchain

hedger commented 4 months ago

https://github.com/flipperdevices/flipperzero-firmware/pull/3451 is now merged to dev.

While there are still no pre-built toolchains for *bsd, you can now set FBT_NOENV=1 in environment for ufbt to skip toolchain init. It will use tools available in your PATH instead.

Closing this as partially resolved.

anoduck commented 4 months ago

@hedger Thank you for closing this one out, and thank you for all your help! I had decided it was best to close this one out yesterday, I just hadn't gotten around to doing it. Well done, and good deal, indeed!

Cheers.