zephyrproject-rtos / meta-zephyr-sdk

Zephyr SDK (obsolete)
MIT License
44 stars 29 forks source link

"~" not working in build env variables #64

Closed zephyrbot closed 5 years ago

zephyrbot commented 8 years ago

Reported by Carles Cufi:

Using "~" in ZEPHYR_BASE and _TOOLCHAIN_PATH does not seem to work. Instead one has to specify "/home/me" for the build system to work. This probably also the case for ZEPHYR_SDK_INSTALL_DIR, although I have not tested it.

(Imported from Jira SDK-45)

zephyrbot commented 8 years ago

by Juro Bystricky:

When installing Zephyr SDK, I install it usually in my home directory first, using "~" to specify the location (ie ~/zephyr-sdk-0.7.5). My .zephyrrc file also works with envars using "~", i.e: export ZEPHYR_SDK_INSTALL_DIR=~/zephyr-sdk-0.7.5 So there are no problems with ZEPHYR_SDK_INSTALL_DIR and "~".

Having said that, I'll have a look at using "~" in ZEPHYR_BASE

zephyrbot commented 8 years ago

by Mark Linkmeyer:

Juro Bystricky , Carles Cufi , is this bug still valid? The question came up today in a backlog grooming session and we'd like to know if this bug is still valid and needs to be prioritized. Thanks! Gajinder Vij

zephyrbot commented 8 years ago

by Juro Bystricky:

ZEPHYR_SDK_INSTALL_DIR works with "~". ZEPHYR_BASE is normally set in zephyr-env.sh, something like this:

export ZEPHYR_BASE=$( builtin cd "$( dirname "$DIR" )" 

When trying to set it to use "~", i.e.

export ZEPHYR_BASE=~/zephyr/zephyr-project

it is expanded automatically to full (absolute) path. Same thing happens when exported from command line:

$ export ZEPHYR_BASE=~/zephyr/zephyr-project/ $ printenv | grep ZEPHYR_BASE ZEPHYR_BASE=/home/juro/zephyr/zephyr-project

In other words, I cannot reproduce the problem and there are no steps describing the problem except for a very generic "does not seem to work". No mentioning of Linux (Windows?) distribution/version either.

zephyrbot commented 8 years ago

by Carles Cufi:

If I remember correctly this was on Ubuntu 14.04 and the environment variable that was problematic was ZEPHYR_SDK_INSTALL_DIR

zephyrbot commented 8 years ago

by Juro Bystricky:

Hmmm.,, the original bug report says: "...probably also the case for ZEPHYR_SDK_INSTALL_DIR, although I have not tested it."

Anyway, it should be rather easy to fix the problem once you provide some steps to reproduce it.

zephyrbot commented 8 years ago

by Carles Cufi:

Sorry I meant _TOOLCHAIN_PATH. If I recall correctly that was the one that gave trouble consistenly. I seem to recall I was using the gccarmemb toolchain. I will try it again as soon as I have access to the machine.

zephyrbot commented 8 years ago

by Juro Bystricky:

Thanks, much appreciated.

zephyrbot commented 8 years ago

by Carles Cufi:

Tried it today.

The commands I was running:

$ source zephyr-env.sh $ cd samples/hello_world/microkernel/ $ export ZEPHYR_GCC_VARIANT=zephyr $ make BOARD=nrf52_pca10040

And with the following variables in my .bashrc it all works well: export ZEPHYR_BASE="/home/cacu/src/nzephyr" export ZEPHYR_SDK_INSTALL_DIR="/home/cacu/prog/zephyr-sdk"

However if I set in my .bashrc: export ZEPHYR_BASE="~/src/nzephyr" export ZEPHYR_SDK_INSTALL_DIR="~/prog/zephyr-sdk"

I get:

LINK zephyr.lnk /home/cacu/prog/zephyr-sdk/sysroots/i686-pokysdk-linux/usr/libexec/arm-poky-eabi/gcc/arm-poky-eabi/5.2.0/real-ld: cannot find -lgcc collect2: error: ld returned 1 exit status make[2]: [.tmp_zephyr.prebuilt] Error 1 make[2]: Leaving directory `/home/cacu/src/nzephyr/samples/hello_world/microkernel/outdir' make[1]: [sub-make] Error 2 make[1]: Leaving directory `/home/cacu/src/nzephyr' make: *** [all] Error 2

zephyrbot commented 8 years ago

by Juro Bystricky:

Thanks. This is very useful. It should be quite straightforward to find a fix.

zephyrbot commented 8 years ago

by Carles Cufi:

Still an issue in 0.8.2

zephyrbot commented 7 years ago

by Mark Linkmeyer:

Per review with Anas and Juro: "Juro to fix before 1.6 released."

zephyrbot commented 7 years ago

by Mark Linkmeyer:

Per review with Juro, the priority is being lowered.

nashif commented 5 years ago

fixed with latest SDK