Message ID | 20201109074500.1.Idd7cf4072510c9da331280890ca7a5505adc2f23@changeid |
---|---|
State | Accepted |
Commit | f31e83d6cf44fccd25be48b67dd69aaff6c5e1f4 |
Delegated to: | Simon Glass |
Headers | show |
Series | binman: Handle tool paths containing '~' correctly | expand |
On 09/11/2020 17:45, Simon Glass wrote: > At present if CROSS_COMPILE contains a tilde, such as > ~/.buildman-toolchains/gcc-7.3.0-nolibc/i386-linux/bin/i386-linux-gcc > then binman gives a confusing error: > > binman: Error 255 running '~/..buildman-toolchains/gcc-7.3.0- ... > > Fix this by expanding it out before running the tool. > > Signed-off-by: Simon Glass <sjg@chromium.org> Arguably, whatever is passing CROSS_COMPILE to binman should have expanded that; how are you passing it? If that's from shell you could use one of CROSS_COMPILE="$HOME/..." or ~/"..." (the "~/..." form isn't expanded), if it's read from e.g. ~/.buildman then the config parser should be expanding it at read-time.
Hi Alper, On Tue, 10 Nov 2020 at 07:45, Alper Nebi Yasak <alpernebiyasak@gmail.com> wrote: > > On 09/11/2020 17:45, Simon Glass wrote: > > At present if CROSS_COMPILE contains a tilde, such as > > ~/.buildman-toolchains/gcc-7.3.0-nolibc/i386-linux/bin/i386-linux-gcc > > then binman gives a confusing error: > > > > binman: Error 255 running '~/..buildman-toolchains/gcc-7.3.0- ... > > > > Fix this by expanding it out before running the tool. > > > > Signed-off-by: Simon Glass <sjg@chromium.org> > > Arguably, whatever is passing CROSS_COMPILE to binman should have > expanded that; how are you passing it? If that's from shell you could > use one of CROSS_COMPILE="$HOME/..." or ~/"..." (the "~/..." form isn't > expanded), if it's read from e.g. ~/.buildman then the config parser > should be expanding it at read-time. This is actually happening in my lab because tbot is set to use the home directory for the toolchains. It is set up in the 'lab.py' Python file and uses ~ to avoid hard-coding it to a particular machine. Regards, Simon
Hi Alper, On Tue, 10 Nov 2020 at 07:45, Alper Nebi Yasak <alpernebiyasak@gmail.com> wrote: > > On 09/11/2020 17:45, Simon Glass wrote: > > At present if CROSS_COMPILE contains a tilde, such as > > ~/.buildman-toolchains/gcc-7.3.0-nolibc/i386-linux/bin/i386-linux-gcc > > then binman gives a confusing error: > > > > binman: Error 255 running '~/..buildman-toolchains/gcc-7.3.0- ... > > > > Fix this by expanding it out before running the tool. > > > > Signed-off-by: Simon Glass <sjg@chromium.org> > > Arguably, whatever is passing CROSS_COMPILE to binman should have > expanded that; how are you passing it? If that's from shell you could > use one of CROSS_COMPILE="$HOME/..." or ~/"..." (the "~/..." form isn't > expanded), if it's read from e.g. ~/.buildman then the config parser > should be expanding it at read-time. This is actually happening in my lab because tbot is set to use the home directory for the toolchains. It is set up in the 'lab.py' Python file and uses ~ to avoid hard-coding it to a particular machine. Regards, Simon Applied to u-boot-dm, thanks!
diff --git a/tools/patman/tools.py b/tools/patman/tools.py index bbb157da873..05b1a1d4b08 100644 --- a/tools/patman/tools.py +++ b/tools/patman/tools.py @@ -333,6 +333,7 @@ def Run(name, *args, **kwargs): elif for_host: name, extra_args = GetHostCompileTool(name) args = tuple(extra_args) + args + name = os.path.expanduser(name) # Expand paths containing ~ all_args = (name,) + args result = command.RunPipe([all_args], capture=True, capture_stderr=True, env=env, raise_on_error=False, binary=binary)
At present if CROSS_COMPILE contains a tilde, such as ~/.buildman-toolchains/gcc-7.3.0-nolibc/i386-linux/bin/i386-linux-gcc then binman gives a confusing error: binman: Error 255 running '~/..buildman-toolchains/gcc-7.3.0- ... Fix this by expanding it out before running the tool. Signed-off-by: Simon Glass <sjg@chromium.org> --- tools/patman/tools.py | 1 + 1 file changed, 1 insertion(+)