sandreas / tone

tone is a cross platform audio tagger and metadata editor to dump and modify metadata for a wide variety of formats, including mp3, m4b, flac and more. It has no dependencies and can be downloaded as single binary for Windows, macOS, Linux and other common platforms.
https://pilabor.com
Apache License 2.0
418 stars 17 forks source link

error running tone in docker alpine arm64 #31

Closed garlik82 closed 2 years ago

garlik82 commented 2 years ago

Trying to run tone in an alpine arm64 container.

~ # tone --version sh: tone: not found

Using readelf I get: ~ # readelf -l /usr/local/bin/tone

Elf file type is DYN (Shared object file) Entry point 0x280000 There are 12 program headers, starting at offset 64

Program Headers: Type Offset VirtAddr PhysAddr FileSiz MemSiz Flags Align PHDR 0x0000000000000040 0x0000000000000040 0x0000000000000040 0x00000000000002a0 0x00000000000002a0 R 0x8 INTERP 0x00000000000002e0 0x00000000000002e0 0x00000000000002e0 0x000000000000001b 0x000000000000001b R 0x1 [Requesting program interpreter: /lib/ld-linux-aarch64.so.1] LOAD 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x000000000027ffcc 0x000000000027ffcc R 0x10000 LOAD 0x0000000000280000 0x0000000000280000 0x0000000000280000 0x0000000000687ee0 0x0000000000687ee0 R E 0x10000 LOAD 0x0000000000910000 0x0000000000910000 0x0000000000910000 0x0000000000033fa8 0x0000000000033fa8 RW 0x10000 LOAD 0x0000000000950000 0x0000000000950000 0x0000000000950000 0x000000000001c368 0x00000000000685c0 RW 0x10000 TLS 0x0000000000907ee0 0x0000000000907ee0 0x0000000000907ee0 0x0000000000000000 0x00000000000000e0 R 0x10 DYNAMIC 0x0000000000940050 0x0000000000940050 0x0000000000940050 0x0000000000000260 0x0000000000000260 RW 0x8 GNU_RELRO 0x0000000000910000 0x0000000000910000 0x0000000000910000 0x0000000000034000 0x0000000000034000 R 0x1 GNU_EH_FRAME 0x00000000001af070 0x00000000001af070 0x00000000001af070 0x0000000000027924 0x0000000000027924 R 0x4 GNU_STACK 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000 0x0000000000000000 RW 0x0 NOTE 0x00000000000002fc 0x00000000000002fc 0x00000000000002fc 0x0000000000000044 0x0000000000000044 R 0x4

Section to Segment mapping: Segment Sections... 00
01 .interp 02 .interp .note.ABI-tag .note.gnu.build-id .dynsym .gnu.version .gnu.version_d .gnu.version_r .gnu.hash .dynstr .rela.dyn .rela.plt .rodata .gcc_except_table tracepoints_strings .eh_frame_hdr .eh_frame 03 .text .init .fini .plt 04 .jcr .fini_array .init_array .data.rel.ro .dynamic .got .got.plt 05 .data .tm_clone_table tracepoints __tracepoints_ptrs .bss 06 .tbss 07 .dynamic 08 .jcr .fini_array .init_array .data.rel.ro .dynamic .got .got.plt .bss.rel.ro 09 .eh_frame_hdr 10
11 .note.ABI-tag .note.gnu.build-id ~ # ldd /usr/local/bin/tone /lib/ld-linux-aarch64.so.1 (0x7f93fc0000) libpthread.so.0 => /lib/ld-linux-aarch64.so.1 (0x7f93fc0000) libdl.so.2 => /lib/ld-linux-aarch64.so.1 (0x7f93fc0000) libz.so.1 => /lib/libz.so.1 (0x7f935e0000) librt.so.1 => /lib/ld-linux-aarch64.so.1 (0x7f93fc0000) libgcc_s.so.1 => /usr/lib/libgcc_s.so.1 (0x7f935bb000) libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x7f933cb000) libm.so.6 => /lib/ld-linux-aarch64.so.1 (0x7f93fc0000) libc.so.6 => /lib/ld-linux-aarch64.so.1 (0x7f93fc0000) Error loading shared library ld-linux-aarch64.so.1: No such file or directory (needed by /usr/local/bin/tone) Error relocating /usr/local/bin/tone: strdup: symbol not found Error relocating /usr/local/bin/tone: isnan: symbol not found Error relocating /usr/local/bin/tone: __isnanf: symbol not found

Did some research and all I could find was something about having to install glibc.

Don't really know if this is an issue or if I'm doing something wrong,

Thank you for your work.

sandreas commented 2 years ago

Thank you for reporting this. I think the problem is, that alpine is using musl instead of glibc, which results in this image not working as expected.

Unfortunately, in the official runtime id catalogue there is only linux-musl-x64, not linux-musl-arm64. That is the reason I thought for arm64 it is not necessary to build a musl version.

I'll have to check, if this package provides some help, otherwise I would have to switch to a debian based image: https://www.nuget.org/packages/runtime.linux-musl-arm64.Microsoft.NETCore.DotNetAppHost/#readme-body-tab

garlik82 commented 2 years ago

Hi. thank you for your answer. I used that package to compile tone and I can confirm that it is working. Thank you very much for all your work.

sandreas commented 2 years ago

Hi. thank you for your answer. I used that package to compile tone and I can confirm that it is working. Thank you very much for all your work.

Wow, thank you for your quick response to this. I'll add the new target to the CI process - this will be targeted for 1.0.1.

garlik82 commented 2 years ago

Glad I could help.

sandreas commented 2 years ago

Hey @garlik82, would you mind checking the 0.1.1 for arm64 support? I changed the build process and hope it now works out of the box without self compiling stuff?

docker pull sandreas/tone:v0.1.1

If it works, this issue can be closed. If not, I'll have to check again what went wrong.

garlik82 commented 2 years ago

When I pull the image and run tone I get: exec /usr/local/bin/tone: exec format error.

sandreas commented 2 years ago

When I pull the image and run tone I get: exec /usr/local/bin/tone: exec format error.

Ok, thanks for the quick feedback. I think I need to setup a testing device to fix this. Could you please tell me, what device and OS you are running exactly?

garlik82 commented 2 years ago

Raspberry pi 4 with dietpi, it’s a debian based OS.

sandreas commented 2 years ago

Raspberry pi 4 with dietpi, it’s a debian based OS.

Ok, I'll see what I can do...

sandreas commented 2 years ago

Just for info: I published a tone version in musl-arm64 here.

The Dockerfile.release contains a script which should select the correct version for download before publishing the dockerfile. I'm not sure what is going wrong, but I think this will take some time to investigate.

The problem is, that the BUILD_ARG for TARGETPLATFORM is missing here and I don't know how to add this in the build-push-action...

It may also be possible to determine the current platform via shell script within the Dockerfile.release not requiring a BUILD_ARG...

If someone can help out here, I would really appreciate it.

sandreas commented 2 years ago

@garlik82 Could you give the docker image a last try? I think I got it by using apk --print-arch to determine the current docker image architecture to download the correct binary of tone.

docker pull sandreas/tone:v0.1.1
garlik82 commented 2 years ago

@garlik82 Could you give the docker image a last try? I think I got it by using apk --print-arch to determine the current docker image architecture to download the correct binary of tone.

docker pull sandreas/tone:v0.1.1

Success

sandreas commented 2 years ago

Cool thanks. I'm gonna close this issue, since it seems to be resolved (at least partly)

garlik82 commented 2 years ago

Thanks for this :)