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

[arm64] exec format error #4

Open
kzshantonu opened this issue May 29, 2023 · 10 comments
Open

[arm64] exec format error #4

kzshantonu opened this issue May 29, 2023 · 10 comments

Comments

@kzshantonu
Copy link

amd64 works fine

@Lissy93
Copy link
Owner

Lissy93 commented May 29, 2023

Let me look into that... what method were you using to run?

In the meantime,the Cargo crate should work fine on Arm-based systems.

# Get latest version of rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh

# Install AdGuardian
cargo install adguardian

# Start the app
adguardian

@kzshantonu
Copy link
Author

what method were you using to run?

docker container

@Pix13
Copy link

Pix13 commented May 30, 2023

Maybe an issue with the libc, i tried the binary on an OpenWRT running adguardhome, but as adguardian is linked to the libc linker, it won't start on openwrt ( which uses musl libc). I'll see if i can build a musl version of Adguardian ( or maybe if you have time ?)

See:

root@HomeLan:~# /usr/bin/adguardian 
-ash: /usr/bin/adguardian: not found
root@HomeLan:~# cd /lib
root@HomeLan:/lib# ln -s ld-musl-aarch64.so.1 ld-linux-aarch64.so.1
root@HomeLan:/lib# /usr/bin/adguardian 
Error relocating /usr/bin/adguardian: __res_init: symbol not found
Error relocating /usr/bin/adguardian: gnu_get_libc_version: symbol not found
 

@Lissy93
Copy link
Owner

Lissy93 commented May 30, 2023

I've made you ARMv7 and ARM64 binaries, will be in the latest release: https://github.com/Lissy93/AdGuardian-Term/releases/tag/1.2.0

And I'll look into the Docker image this evening....

@Lissy93
Copy link
Owner

Lissy93 commented May 30, 2023

The Dockerfile is pretty minimal, it's more likely an issue with the way the container is built and tagged on the registry, which is done with this workflow.

# Build application - Copy assets, install deps and compile binary
FROM --platform=$BUILDPLATFORM rust:1.69.0-alpine AS builder
RUN apk add --no-cache pkgconfig openssl openssl-dev musl-dev
WORKDIR /usr/src/adguardian
COPY . .
RUN cargo build --release
# Run application - Using lightweight base, execute the binary
FROM scratch
COPY --from=builder /usr/src/adguardian/target/release/adguardian /
ENTRYPOINT ["/adguardian"]

@mrg
Copy link

mrg commented May 30, 2023

If helpful, here is more info from trying to run via Docker on a Raspberry Pi:

[mrg@freya 07:33:49] ~ > docker run -it lissy93/adguardian
Unable to find image 'lissy93/adguardian:latest' locally
latest: Pulling from lissy93/adguardian
b4f5261e49b9: Pull complete 
Digest: sha256:5ca0c82e0d46010579343efe7c115780ede8821a9a81e61cbb565322805171bc
Status: Downloaded newer image for lissy93/adguardian:latest
standard_init_linux.go:219: exec user process caused: exec format error

Hardware/Software:
Screenshot 2023-05-30 at 7 42 08 AM

[mrg@freya 07:41:41] ~ > docker -v
Docker version 20.10.5+dfsg1, build 55c4c88

PS. Neat looking project!

@agneevX
Copy link

agneevX commented Jun 1, 2023

I could be wrong here, but I do not see QEMU in build-docker.yml. IIRC, that's necessary to get multiarch working.

Lissy93 added a commit that referenced this issue Jun 1, 2023
@Lissy93
Copy link
Owner

Lissy93 commented Jun 3, 2023

If anyone's more experienced with Docker and GH actions than me, I could do with some help with this one.
I've played around with a few things, but haven't had much luck so far.

  • Have enabled QEMU and Buildx, no issues with the workflow, but doesn't produce expected output
  • Running locally on an ARMv7 device seems to throw an error from the 1.69.0-alpine base image used for the build stage, although as far as I can see, that should be a multi-arch image
  • Tried enabling all the experimental modes, using buildx and specifying the --platform flag
  • The binary compiles just fine on alternative architectures, so I doubt it's an issue with any of the application code

Using the following Dockerfile on a Raspberry Pi

# Build application - Copy assets, install deps and compile binary
FROM rust:1.69.0-alpine AS builder
RUN apk add --no-cache pkgconfig openssl openssl-dev musl-dev
WORKDIR /usr/src/adguardian
COPY . .
RUN cargo build --release

# Run application - Using lightweight base, execute the binary
FROM scratch
COPY --from=builder /usr/src/adguardian/target/release/adguardian /
ENTRYPOINT ["/adguardian"]

Gives me this output:

Sending build context to Docker daemon    108kB
Step 1/8 : FROM rust:1.69.0-alpine AS builder
1.69.0-alpine: Pulling from library/rust
no matching manifest for linux/arm/v7 in the manifest list entries

@agneevX
Copy link

agneevX commented Jun 4, 2023

That's because the arch does not exist. I think you're better off pulling latest in the builder stage.

Screenshot 2023-06-04 at 11 21 42 AM

@Dan1jel
Copy link

Dan1jel commented Apr 9, 2024

i have the same issue when trying to install with cargo, and when i tried to used git clone:

git clone [email protected]:Lissy93/AdGuardian-Term.git
Cloning into 'AdGuardian-Term'...
[email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists..

but git clone https://github.com/Lissy93/AdGuardian-Term worked.

Also, not to be that kind of person but to use CTRL+C or q to quit faster would be nice as in #6

I did also noticed that Adguardian is taking alot of resources, processor at 20% compared to 3% when not using adguardian, and heat gone up a few Celsius when running adguardian.

Love the idea, just hope this will be improved in the future :)

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

6 participants