Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Busybox compatibility (or come up with another way to make a POSIX-like env) #68

Closed
whiteinge opened this issue Nov 25, 2018 · 2 comments
Labels

Comments

@whiteinge
Copy link
Owner

I used to test this against Busybox installed to a local directory, sandboxed via env -i. I know Busybox isn't exactly POSIX but it's pretty close, and keep the POSIX docs nearby when you're wondering about a particular flag or command. Anyway I can't think of a better way to get a near-POSIX environment set up. (Suggestions very welcome if someone has an idea here.)

It's been a while since I've done that and a few non-compatible things have snuck in. Busybox doesn't seem to have pr (even though it's POSIX), and there's a syntax error (unclosed }) somewhere in the file that Busybox's sh is choking on that dash is otherwise fine with.

So, either:

  • Come up with a different way to make a POSIX env for testing and remove mention of Busybox from the README;
  • or, Fix Busybox compatibility.
@whiteinge whiteinge added the bug label Nov 25, 2018
@dubiouscript
Copy link
Contributor

dubiouscript commented Nov 25, 2018

or, Fix Busybox compatibility.

this appears to work for me ( using nix / nix-shell )
nix-shell -p busybox --command "busybox sh -x ./ok.sh-0.3.0/ok.sh [...ect] "
( BusyBox v1.29.3 from nixpkgs-unstable )
&& ||
nix-shell -p curl -p coreutils -p busybox --command " ./ok.sh-0.3.0/ok.sh [...ect] "

in my case [...ect] = list_issues $repo

Anyway I can't think of a better way to get a near-POSIX environment set up. (Suggestions very welcome if someone has an idea here.)

cant say that i know exactly what near-POSIX env might or might not entail tbh !...
anyway your comments wrt better way to setup an env made me think of

booting up the 'core' from tinycorelinux ( uses busybox )
"toolkit" / distro in some vm like qemu
eg: u=http://tinycorelinux.net/9.x/x86/release/distribution_files; k=vmlinuz ; i=core.gz; [ -f "$k" ] || wget "$u/$k" ; [ -f "$i" ] || wget "$u/$i"; qemu-system-i386 -curses -kernel ./$k -initrd ./$i ;

and adding coreutils for pr dep
tce-load -w coreutils.tcz .. its possible to extract the tcz/squashfs create cpio.gz and concatenate with core.gz :D

or [s]aboriginal linux[/s] landley/mkroot

@whiteinge
Copy link
Owner Author

Thanks for the reply. Nix has been on my list of things to play with for a while. Your comment prompted me to give it a try locally. nix-shell is really slick. I'm going to keep playing around with this.

whiteinge added a commit that referenced this issue Nov 30, 2018
This was causing an error in busybox's awk.

Closes #68
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants