Closed xloem closed 9 months ago
i'm using busybox myself. it appears the issue in your version seems to be that printf must use parens - so the obvious fix would be to just add parens, rather than remodeling the string for print usage. you also modified hbmap.h, which is unrelated to busybox. what is the error you're getting without your modification, and which compiler version are you using ?
as far as "incomplete" goes - the utilities are meant to modify existing ags projects, not to create some from scratch. they also support only functionality that's relevant to the working of each of the tools. since we for example dont offer tools to modify fonts, everything related to fonts is just copied from old to new.
i'm using busybox myself. it appears the issue in your version seems to be that printf must use parens - so the obvious fix would be to just add parens, rather than remodeling the string for print usage.
The problem was that the % escapes were getting output verbatim into the minishilka file, such that %type became %%type and %%\n became %%%%\n, preventing parsing with either minishilka or dino shilka. This was hard for me to find, involving comprehending the shilka format from your code. I have busybox v1.33.1 on alpine linux 3.14.2 .
you also modified hbmap.h, which is unrelated to busybox. what is the error you're getting without your modification, and which compiler version are you using ?
The problem was that the value type was 4 bytes large on this 32-bit platform, preventing calculation of a correct bucket index when shifted left by 32 bits (see changed line). I tried to upcast it to the 64-bit return type to protect any intention of the code.
This gcc 10.3.1_git20210424 . The error presented as a warning but the impacted line seemed significant enough to warrant a fix: all the bits of the bucket index overflow.
I may have done something wrong here, just trying to patch it together.
as far as "incomplete" goes - the utilities are meant to modify existing ags projects, not to create some from scratch. they also support only functionality that's relevant to the working of each of the tools. since we for example dont offer tools to modify fonts, everything related to fonts is just copied from old to new.
Thanks. They do still seem very useful for pursuing this. I tried it a little but ended up needing to make my own .dta encoder (I did make a little progress on this in python).
oh. that build log was really helpful. i fixed the actual bug in c77bca9
now i downloaded an alpine 3.14.2 x86 rootfs, but:
# busybox awk 'BEGIN{printf "%%type short\n%%%%\n";}'
%type short
%%
the output is as expected. maybe you installed a 3rd-party awk that's buggy ?
I tried it a little but ended up needing to make my own .dta encoder (I did make a little progress on this in python)
can you be a little more specific about what you're trying to do ?
oh. that build log was really helpful. i fixed the actual bug in c77bca9
Great!
# busybox awk 'BEGIN{printf "%%type short\n%%%%\n";}' %type short %%
iPad:~/src/agsutils# busybox awk 'BEGIN{printf "%%type short\n%%%%\n";}'
%%type short
%%%%
iPad:~/src/agsutils# sha256sum $(type -p busybox)
cdc8efe04df96dd7d386c6bca0a818874faf1943da493175afca0d89762eb40f /bin/busybox
iPad:~/src/agsutils# apk version busybox
Installed: Available:
busybox-1.33.1-r8 = 1.33.1-r8
Maybe it is a bug in the iSH x86 emulator I am using, or a virus or something.
I'll open an issue with iSH.
I tried it a little but ended up needing to make my own .dta encoder (I did make a little progress on this in python)
can you be a little more specific about what you're trying to do ?
I thought I'd make a hello world game until I found windows somewhere some day. Something with a background picture and a character that moves where clickedM But it seemed it would be more productive to make a small part of a tool or library, unsure.
# apk upgrade busybox
(1/2) Upgrading busybox (1.33.1-r3 -> 1.33.1-r8)
Executing busybox-1.33.1-r8.post-upgrade
(2/2) Upgrading ssl_client (1.33.1-r3 -> 1.33.1-r8)
�Executing busybox-1.33.1-r8.trigger
OK: 6 MiB in 14 packages
pc:/# apk version busybox
Installed: Available:
busybox-1.33.1-r8 = 1.33.1-r8
pc:/# sha256sum $(type -p busybox)
cdc8efe04df96dd7d386c6bca0a818874faf1943da493175afca0d89762eb40f /bin/busybox
pc:/# busybox awk 'BEGIN{printf "%%type short\n%%%%\n";}'
%%type short
%%%%
i updated to 1.33.1-r8 and the bug happens now. seems someone at alpine messed up seriously.
Thanks a bunch for figuring that out.
This is a really old Alpine release that comes bundled with iSH but I asked in discord and they said it is EOL and to install a new image. I’ll probably run my patch locally for now and change my system soon.
i talked to some alpine devs on IRC and since there's still builders for 3.14 i got the recommendation to file a bug report with the details from here on https://gitlab.alpinelinux.org/alpine/aports/-/issues
alternatively you can downgrade your busybox to -r3 like this:
https://www.arvanta.net/2x3d1kfg/x86/busybox-1.33.1-r3.apk
download and `apk add --allow-untrusted busybox-1.33.1-r3.apk
or extract the busybox binary from the 3.14.2 x86 "minimal rootfs" that's available from the alpine download site.
the only commit i can find that potentially fixes it is https://git.alpinelinux.org/aports/commit/main/busybox?id=4ffd996b3f8298c7dd424b912c245864c816e354 it was never applied to busybox 1.33.1 though
These changes get the repository building on 32-bit busybox for me.
~I haven’t tried running it. I was curious to try to make a very simple one-room thing from scratch. Is there a template anywhere?~
The utilities are now working great for me and I understand they are incomplete.