Search code examples
sdkyoctobitbakefish

Source env variables from bitbake-made sdk using Fish


When you compile a SDK using bitbake and have to source like :

source /opt/poky/.../environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi

It can't be accomplished through fish, which is expected as the export sintaxe is different (i.e. set -x ...). I tried even to add #!/bin/bash on the first line, which also doesn't work. Does anyone knows a good way for it?

Workaround: Nowadays I run a bash inside the fish prompt to be able to compile binaries, which is not the best way but works. Don't let those small things push oyu away from fish :)


Solution

  • @charego mentioned some good ideas, thanks! :)

    Fish-bax

    So you can run it as:

    bax 'source /opt/poky/.../environment-setup-cortexa9hf-vfp-neon-poky-linux-gnueabi'

    The only down side is that the auto completion does not work inside quotes, so one will need to write the whole path to the file. Although it's still better to have a fish running on top of a bash.

    Bass

    Bass did not worked, as it crashs with: Fatal Python error: Py_Initialize: Unable to get the locale encoding ImportError: No module named 'encodings'

    Foreign-env

    Foreign-env also didn't work. It's possible to to set the variable, although it threw warning: warning: include location "/usr/local/include" is unsafe for cross-compilation [-Wpoison-system-directories] and it does not compiles, probably it misses a few variables to export.

    TL;DR Go with Fish-bax, at least it works :)


    Edit after 3 years.

    Replay.fish

    Currently, this is my choice.