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

[+] Tracking Broken Binaries #10

Closed
Azathothas opened this issue May 15, 2024 · 22 comments
Closed

[+] Tracking Broken Binaries #10

Azathothas opened this issue May 15, 2024 · 22 comments

Comments

@Azathothas
Copy link

Azathothas commented May 15, 2024

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.


  • Broken Binaries
❯ aria2c --help
!# Static Built
Exception caught
Exception: [/home/runner/.ndk-pkg/run/2303/android-34-arm64-v8a/aria2/src/src/Platform.cc:125] errorCode=1 OSSL_PROVIDER_load 'legacy' failed.

!# Dynamic Built android-29-arm64-v8a
CANNOT LINK EXECUTABLE "./aria2c": library "libaria2.so" not found: needed by main executable
!# It seems due to `--disable-all-programs` configure flag, the entire build process produces no binaries in /bin or /sbin
!# Both static / dynamic build exit with the same error
can't find terminfo database

 !# I found this: https://github.com/tmux/tmux/issues/743 , but no solution worked

  • Dynamic Only (Static Bin Will Not Work)
Unable to connect to server github.com:443: No address associated with hostname
(null)

!# Dynamic Built android-29-arm64-v8a has certs issues but works with -k | --insecure flag
SSL error: (null)
(null)
!# This is fixed by using SSL_CERT_FILE env variable as stated in the readme
@leleliu008
Copy link
Owner

!# 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
Copy link
Owner

leleliu008 commented May 16, 2024

!# 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
Copy link
Owner

!# 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
Copy link
Author

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
Copy link
Owner

!# 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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

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
Copy link
Author

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
Copy link
Owner

pkgtype: pie will do the trick.

@Azathothas
Copy link
Author

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
Copy link
Owner

static-pie is not considered right now.

@leleliu008
Copy link
Owner

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

@Azathothas
Copy link
Author

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
Copy link
Owner

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
Copy link
Owner

Would non existing keys break ndk ?

Would non existing keys break ndk-pkg

@leleliu008
Copy link
Owner

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

@Azathothas
Copy link
Author

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
Copy link
Owner

Screenshot 2024-05-17 at 18 15 19

@leleliu008
Copy link
Owner

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

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

No branches or pull requests

2 participants