Open xplshn opened 4 months ago
I don't think the bug has to do with the library
weird. This may be an issue with CGO or Musl
so strange. try building from source again with cgo disabled?
Sorry, not currently home, anyways
CGO is disabled on my PC. I always compile with these flags:
# Go options:
export CGO_ENABLED=0
export GOFLAGS="-ldflags=-static -ldflags=-s -ldflags=-w"
export GO_LDFLAGS="-buildmode=pie"
export GOROOT="/usr/local/go"
export GOCACHE="$HOME/.cache/go"
export GOBIN="$HOME/.local/bin"
export GOPATH="$HOME/.cache/go"
# Zig options:
export ZIG_LIBC_TARGET="x86_64-linux-musl"
# Rust options:
export RUSTFLAGS="-C link-arg=-s"
export RUSTUP_HOME="$HOME/.cache/rs_rustup"
export CARGO_HOME="$HOME/.cache/rs_cargo"
# C options:
export LDFLAGS="-static"
export CFLAGS="-fPIE -fPIC -static"
I will rebuild once I get home, I am currently on a school PC, in which I have booted into a barebones Alpine Linux with my USB hard drive.
I decided to just spend some of my mobile data plan, doesn't matter, fresh Golang install from the official Alpine repos also doesn't work.
(I have unset all the GO* vars)
what is line 82? how are you compiling this?
I just built from main to confirm and it works fine
I am running go build -o ./aces ./cmd/aces/main.go
https://github.com/quackduck/aces/blob/82e8e65f81f2446e8b0db9181276a4fd6b5b04a5/cmd/aces/main.go#L82
Could you move this right before that line and then compile?
idk why im using the value before err checking
Well, that's weird... Seems like the library doesn't allow it?
...
The way you're building is a little strange. Try building with just go build
?
Hmmmmmm I just opened up the code and it looks like it's obviously wrong? how the heck does it work for me?
Since its a project that is divided into a library and cli program, it can't be built without specifying which .go file to build, AFAIK...
And yes, I thought the code looked weird, as if something wasn't right. It could have something to do with Go's build cache? I am not sure, but maybe you kept a working version cached at your $GOPATH/$GOCACHE.
Maybe try setting a differrent GOPATH and GOCACHE before building to see if that is true? It'd be weird but maybe, just maybe...
Yeah so I think I was working off an old version
No no my code is wrong lol
alright everything should be fixed now
you can also get bins from here https://github.com/quackduck/aces/releases/tag/v2.2.7
Could you publish releases as statically linked Go binaries? If possible using fPIE? Instead of tarfiles, also, compiling statically means it will run everywhere regardless of the presence of musl, uclibc, uclibc-ng, mlibc or the shitty gnu libc. Thanks!
Can you provide a test case that demonstrates that?
I tried it out just now: https://go.dev/play/p/Lq6W3R4Qk8I