tock / libtock-rs

Rust userland library for Tock

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Glob copying issue

stevefan1999-personal opened this issue · comments

It seems like

libtock-rs/Makefile

Lines 142 to 143 in ae66d0a

cp target/$(1)/thumbv7em-none-eabi/release/examples/$(EXAMPLE).{tab,tbf} \
target/tbf/$(1)

I guess this may work on zsh but it is not supported on bash.

Easy to mitigate, we can just split the copy into two different command.

No big deal to split, but I run (stock) bash, and it seems to work fine:

$ touch a.b a.c; mkdir d; cp a.{b,c} d/; tree; echo $(BASH_VERSION)
.
├── a.b
├── a.c
└── d
    ├── a.b
    └── a.c

2 directories, 4 files
5.2.15(1)-release

What version doesn't this work on?

The issue is which default shell your system (and make) is using (run ls -l /bin/sh to see).

If you're on Ubuntu, the system shell is dash. You can change this with sudo dpkg-reconfigure dash.

Another option is to define which shell to use in the Makefile by adding SHELL=/bin/bash.

Another option is to define which shell to use in the Makefile by adding SHELL=/bin/bash.

@stevefan1999-personal would you mind testing whether this fixes your issue? My system uses Bash by default and I don't want to change that. If it fixes your issue, please send a PR with the fix.

@jrvanwhy FWIW, I originally tested this fixed the issue for me locally by adding this line to the Makefile, but I'll let @stevefan1999-personal confirm it resolves the issue for him as well.

Another option is to define which shell to use in the Makefile by adding SHELL=/bin/bash.

@stevefan1999-personal would you mind testing whether this fixes your issue? My system uses Bash by default and I don't want to change that. If it fixes your issue, please send a PR with the fix.

Yes, it seems like I was using dash all the time despite echo $0 said I'm using bash