leleliu008 / ndk-pkg-formula-repository-official-core

the formula repository for ndk-pkg
Apache License 2.0
13 stars 6 forks source link

[+] Tracking Broken Binaries #10

Closed Azathothas closed 1 week ago

Azathothas commented 1 month ago

This issue should serve as tracker for tracking binaries that don't work despite being promoted/included in the ./formula dir.

This issue should also track a list of binaries that won't work if built statically (--fsle) due to the following reasons:

Perhaps this can be later added to the readme to warn people or the formulae itself could be modified to not support --fsle.

The list will be based on prebuilt binaries from:

This comment will be edited based on fixes & solutions suggested.


leleliu008 commented 1 month ago
!# Dynamic Built android-29-arm64-v8a
CANNOT LINK EXECUTABLE "./aria2c": library "libaria2.so" not found: needed by main executable

This is a bug, It will be fixed in next release.

leleliu008 commented 1 month ago
!# Both static / dynamic build exit with the same error
can't find terminfo database

run tmux on termux, you could do this:

export TMUX_TMPDIR="$HOME/tmux-tmp-dir"
ln -s ~/../usr/lib/terminfo ~/.terminfo
leleliu008 commented 1 month ago
!# It seems due to `--disable-all-programs` configure flag, the entire build process produces no binaries in /bin or /sbin

I split util-linux to several sub packages e.g. libuuid, getopt, etc

Azathothas commented 1 month ago

The aria2c dynamic build works perfectly, but the static built has dns issues like always:

❯ ./aria2c-static https://bin.ajam.dev/arm64_v8a_Android/tailscale

05/17 11:40:17 [NOTICE] Downloading 1 item(s)

05/17 11:40:17 [ERROR] CUID#7 - Download aborted. URI=https://bin.ajam.dev/arm64_v8a_Android/tailscale
Exception: [/root/.ndk-pkg/run/225417/android-34-arm64-v8a/aria2/src/src/AbstractCommand.cc:351] errorCode=19 URI=https://bin.ajam.dev/arm64_v8a_Android/tailscale
  -> [/root/.ndk-pkg/run/225417/android-34-arm64-v8a/aria2/src/src/NameResolver.cc:60] errorCode=19 Failed to resolve the hostname bin.ajam.dev, cause: No address associated with hostname

05/17 11:40:17 [NOTICE] Download GID#d7714c172a344d74 not complete:

Download Results:
gid   |stat|avg speed  |path/URI
======+====+===========+=======================================================
d7714c|ERR |        n/a|https://bin.ajam.dev/arm64_v8a_Android/tailscale

Status Legend:
(ERR):error occurred.

aria2 will resume download if the transfer is restarted.
If there are any errors, then see the log file. See '-l' option in help/man page for details.

run tmux on termux, you could do this:

export TMUX_TMPDIR="$HOME/tmux-tmp-dir"
ln -s ~/../usr/lib/terminfo ~/.terminfo

That still doesn't work, I now get

no suitable socket path

I split util-linux to several sub packages e.g. libuuid, getopt, etc

I can only find: https://github.com/leleliu008/ndk-pkg-formula-repository-official-core/blob/master/formula/libuuid.yml https://github.com/leleliu008/ndk-pkg-formula-repository-official-core/blob/master/formula/getopt.yml

Are these missing?

addpart
agetty
blkdiscard
blkid
blkpr
blkzone
blockdev
cal
cfdisk
chcpu
chfn
chmem
choom
chrt
chsh
col
colcrt
colrm
column
ctrlaltdel
delpart
dmesg
eject
fadvise
fallocate
fdisk
fincore
findfs
findmnt
flock
fsck
fsck.cramfs
fsck.minix
fsfreeze
fstrim
hardlink
hexdump
hwclock
i386
ionice
ipcmk
ipcrm
ipcs
irqtop
isosize
kill
last
lastb
ldattach
linux32
linux64
logger
login
look
losetup
lsblk
lscpu
lsfd
lsipc
lsirq
lslocks
lslogins
lsmem
lsns
mcookie
mesg
mkfs
mkfs.bfs
mkfs.cramfs
mkfs.minix
mkswap
more
mount
mountpoint
namei
nologin
nsenter
partx
pipesz
pivot_root
prlimit
readprofile
rename
renice
resizepart
rev
rfkill
rtcwake
runuser
script
scriptlive
scriptreplay
setarch
setpriv
setsid
setterm
sfdisk
sulogin
swaplabel
swapoff
swapon
switch_root
taskset
uclampset
ul
umount
uname26
unshare
utmpdump
uuidd
uuidgen
uuidparse
waitpid
wall
wdctl
whereis
wipefs
write
x86_64
zramctl
leleliu008 commented 1 month ago
!# Dynamic Built android-29-arm64-v8a
CANNOT LINK EXECUTABLE "./aria2c": library "libaria2.so" not found: needed by main executable

This is a bug, It will be fixed in next release.

This has been fixed.

leleliu008 commented 1 month ago

run tmux on termux, you could do this:

export TMUX_TMPDIR="$HOME/tmux-tmp-dir"
ln -s ~/../usr/lib/terminfo ~/.terminfo

That still doesn't work, I now get

no suitable socket path
export TMUX_TMPDIR="$HOME/tmux-tmp-dir"
install -d "$TMUX_TMPDIR"
 ln -s ~/../usr/lib/terminfo ~/.terminfo

you should create TMUX_TMPDIR manully.

Azathothas commented 1 month ago
export TMUX_TMPDIR="$HOME/tmux-tmp-dir"
install -d "$TMUX_TMPDIR"
 ln -s ~/../usr/lib/terminfo ~/.terminfo

Ah yes it works now, thank you!

leleliu008 commented 1 month ago

can only find: https://github.com/leleliu008/ndk-pkg-formula-repository-official-core/blob/master/formula/libuuid.yml https://github.com/leleliu008/ndk-pkg-formula-repository-official-core/blob/master/formula/getopt.yml

Are these missing?

addpart
agetty
blkdiscard
blkid
blkpr
blkzone
blockdev
cal
cfdisk
chcpu
chfn
chmem
choom
chrt
chsh
col
colcrt
colrm
column
ctrlaltdel
delpart
dmesg
eject
fadvise
fallocate
fdisk
fincore
findfs
findmnt
flock
fsck
fsck.cramfs
fsck.minix
fsfreeze
fstrim
hardlink
hexdump
hwclock
i386
ionice
ipcmk
ipcrm
ipcs
irqtop
isosize
kill
last
lastb
ldattach
linux32
linux64
logger
login
look
losetup
lsblk
lscpu
lsfd
lsipc
lsirq
lslocks
lslogins
lsmem
lsns
mcookie
mesg
mkfs
mkfs.bfs
mkfs.cramfs
mkfs.minix
mkswap
more
mount
mountpoint
namei
nologin
nsenter
partx
pipesz
pivot_root
prlimit
readprofile
rename
renice
resizepart
rev
rfkill
rtcwake
runuser
script
scriptlive
scriptreplay
setarch
setpriv
setsid
setterm
sfdisk
sulogin
swaplabel
swapoff
swapon
switch_root
taskset
uclampset
ul
umount
uname26
unshare
utmpdump
uuidd
uuidgen
uuidparse
waitpid
wall
wdctl
whereis
wipefs
write
x86_64
zramctl

only libuuid and getopt sub package is available at this moment. I will patch util-linux later.

Azathothas commented 1 month ago

It would be nice to add comments in the formula.yaml and detail what needs to be done to get them working.

Putting all these in the readme is another option but that would clutter it very quickly.

leleliu008 commented 1 month ago

It would be nice to add comments in the formula.yaml and detail what needs to be done to get them working.

I will add a new mapping called cavates:, this message will be displayed when usr run ndk-pkg info-available and ndk-pkg install

Azathothas commented 1 month ago

and for the binaries if they can work statically etc or not, maybe something like this as an additional field in the formula.yaml

KEY required? overview
be_static optional Value true OR false (or even yes OR No), shows if a pkg can be built statically + works (after testing)
leleliu008 commented 1 month ago

pkgtype: pie will do the trick.

Azathothas commented 1 month ago

I saw

pkgtype | optional | indicates what type of this package. value shall be any one of exe, pie, lib, exe+lib.To exe type package, ndk-pkg would add --static -static options to LDFLAGS if --fsle install option is given.To pie type package, it means that it doesn't support fully statically linking, it is supposed to be dynamically linked.If this mapping is not present, ndk-pkg will determine the package type by package name, if a package name starts/ends with lib, it would be recognized as type lib, otherwise, it would be recognized as type exe

but pie can also be static-pie no?

leleliu008 commented 1 month ago

static-pie is not considered right now.

leleliu008 commented 1 month ago

I only consider traditional static right now. static-pie would be tested later.

Azathothas commented 1 month ago

I meant as a sort of future proofing, as the pkgtype serves entirely different purpose

Is it possible to have arbitrary foo:bar entries in the formula.yaml? Would non existing keys break ndk or they would be silently ignored...

I tried to fork this repo to test but alas, Github seems to allow only one fork..

leleliu008 commented 1 month ago

Is it possible to have arbitrary foo:bar entries in the formula.yaml? Would non existing keys break ndk or they would be silently ignored...

I can't quite catch this. a bit more clear?

leleliu008 commented 1 month ago

Would non existing keys break ndk ?

Would non existing keys break ndk-pkg

leleliu008 commented 1 month ago

unrecognized keys would be ignored, it would not break ndk-pkg.

Azathothas commented 1 month ago

Is it possible to have arbitrary foo:bar entries in the formula.yaml? Would non existing keys break ndk or they would be silently ignored...

I can't quite catch this. a bit more clear?

I meant can I add additional entries in formula.yaml which aren't real keys supported by ndk-pkg

can I do this

summary: Run your GitHub Actions locally
git-url: https://github.com/nektos/act
src-url: https://github.com/nektos/act/archive/refs/tags/v0.2.62.tar.gz
src-sha: 2b0231d02d57d5edbcc070b7c4802acf16110a0582ffb40181aaa695f2b7bf5c
license: MIT
install: gow -X main.version="$PACKAGE_VERSION" -o act main.go
summary: Run your GitHub Actions locally
git-url: https://github.com/nektos/act
src-url: https://github.com/nektos/act/archive/refs/tags/v0.2.62.tar.gz
src-sha: 2b0231d02d57d5edbcc070b7c4802acf16110a0582ffb40181aaa695f2b7bf5c
license: MIT
install: gow -X main.version="$PACKAGE_VERSION" -o act main.go
foo: bar #This doesn't actually exist
leleliu008 commented 1 month ago
Screenshot 2024-05-17 at 18 15 19
leleliu008 commented 1 month ago

curl wget aria2 are built with libcares, so fully statically linked executables can use specified DNS servers. I also add the caveats for these formula.

Screenshot 2024-06-10 at 15 01 54 Screenshot 2024-06-10 at 15 02 27 Screenshot 2024-06-10 at 15 02 47