Hello Miles!
Apart from a few bugs, this port is finished. There are two main issues
i've encountered that i haven't been able to patch out. The first
pertains to the command subs issue i described last email in this
thread. Each f_script has the line "shopt -s strict:all" which disallows
command subs. According to Oil's docs, this allows each script to be
bash-compatible [1] but results in scripts erroring that contain command
subs. I see two possible solutions to this, either remove the line
entirely and run the risk of breakage running on bash shells, or
reworking parts of each script to not use command subs. This seems to be
an oil-related issue rather than an arch-specific one, so I'd rather let
you know about this upstream and have it resolved there rather than try
to patch it in my port.
The second issue pertains to Zig packaging, which the Arch Linux ARM
project is now aware of [2] as of June 17. For now, th Zig dependency
needs to be installed manually which works great with the zig_upd.sh
script you previously linked. This is affecting many Zig based projects
on the Arch ARM platform and I hope this can be resolved soon.
After the command subs issue is worked out, I'll mark my pr as ready for
review. Thanks for your continued support in this process and I hope
that framebufferphone will soon be available in the danctnix
repositories.
Thanks,
Bobby
--
[1] https://www.oilshell.org/preview/doc/error-handling.html
[2] https://archlinuxarm.org/forum/viewtopic.php?f=15&t=15952
Hi Bobby,
Thanks for sticking with this and sorry about the delay on my end,
been a bit tied up with other things. Happy to help you work on these
remaining issues.
1) As for the oil 'shopt -s strict:all' issue, can we work out a minimal
test case that works on Alpine's version of oil but doesn't work on Arch?
Can you tell me if the following works on Arch?
#!/usr/bin/env oil
shopt -s strict:all
R=$(echo foo)
echo "$R"
It could be either that Arch's packaging or Alpine's packaging of oil is
improper and needs to be fixed. At first glance the packaging looks pretty
similar, see [1] and [2]. But ultimately we need to identify why there
is a different result with a minimal testcase to identify / demonstrate
how Arch's oil is breaking. This could be an upstream issue for the oil
developer to resolve if the packaging on both distros is indeed correct.
2) As for the second issue regarding Zig packaging that's unfortunate
and thanks for providing the link - it seems they're looking into it
from the response on the Arch Arm forum.
Excited to see framebufferphone come to Arch Arm soon! Thanks again for
all your work on this.
Miles
[1] https://github.com/archlinux/svntogit-community/blob/master/oil/trunk/PKGBUILD
[2] https://git.alpinelinux.org/aports/tree/testing/oil/APKBUILD
Hey Miles,
I'm excited to use framebufferphone daily and glad I can help others on
Arch to do the same, thanks for all your help in getting everything
functional.
The test case you sent works as long as variable "R" is defined using
"const", "var", or "setvar" at the beginning. Otherwise it errors out
due to the strict_errexit option set on line 2. The command subs aren't
an issue at all here it seems.
After further testing it seems that oil errors when the output of
a command sub is fed into another command with the OR operator (||). I
tested a problematic line used in multiple f_scripts, and after a bit of
investigation, I've found that the following origonal line does not work:
#!/usr/bin/env osh
shopt -s strict:all
env | grep -q "$(basename "$0" | tr '[a-z]' '[A-Z]')=" || eval $VAR
Out of curiosity, I changed it to remove the OR operator, and it ran
without error and didn't output anything:
#!/usr/bin/env osh
shopt -s strict:all
env | grep -q "$(basename "$0" | tr '[a-z]' '[A-Z]')="
It seems that the command subs themselves aren't the issue, but how they
are piped into other commands with the OR operator. Oil's justification
for this behavior is that the "status wouldn't be checked". Could you
check this on Alpine, and see if behavior differs from Arch?
I'm travelling and don't have a spare SD card on hand.
Thanks,
Bobby
Hi Bobby,
Finally was able to cut out some time to look into this. I tested on
Alpine once upgraded to latest version of oil (0.11) and it seems the
same issue with strict_errexit existed there too. I believe that the oil
developer changed the base set of options set for strict:all to include
strict_errexit.. which was not previously the case, as these scripts
used to work OOTB with strict:all in earlier versions of oil/osh.
We use osh & strict:all with f_scripts as a good set of defaults which
are backwards compatible with shell; however for now I've decided to
make the default for all scripts to additionally unset strict_errexit
to fix this regression. The eventual plan is to upgrade to oil proper so
these will be systematically reworked in anycase. I've tagged f_scripts
0.5 with this shopt unset of strict_errexit - let me know if there are
any issues remaining!
Also one separate note, I took a look at the Arch packaging, and I'm
not sure how the Danctnix maintainer feels about patches (1) but if
you want to take a shot at integrating these changes into the f_scripts
proper I'd be happy to accept such changes to make f_scripts both Arch
& Alpine compatible by default. The main changes I'd see are checking
for if OpenRC or SystemD is present which should be simple enough for
f_networks/f_phone. Path checks in f_theme should be feasible. And
then for DEP across scripts we could change DEP to be DEP_ALPINE=
and DEP_ARCH= etc. I'm flexible to accept such patches if you want to
send to the framebufferphone mailing list. Happy to have your work on
gen_archpackage directly in f_scripts repo too if these changes are made
to f_scripts. Thanks again for sticking with this. And finally sorry
again about the delay please feel free to bug me on IRC in the future
by the way for issues as well. Let me know if there's anything I can
help with.
Miles
1) https://github.com/dreemurrs-embedded/Pine64-Arch/pull/420/files#diff-9103452a959596b79871ecfb158f6c42f02869fbbea1775fdef2992b34b69dac