goreleaser / nfpm

nFPM is Not FPM - a simple deb, rpm, apk, ipk, and arch linux packager written in Go
https://nfpm.goreleaser.com/
MIT License
2.18k stars 159 forks source link

ipk package generated by nfpm is invalid #859

Closed nekohasekai closed 2 months ago

nekohasekai commented 2 months ago

What happened?

https://github.com/goreleaser/nfpm/blob/fa30aa2d34eed942c5cc902433e1cb684d4f1460/ipk/ipk.go#L33-L45

You just can't do this, openwrt uses a completely different set of architecture naming.

Ref:

To make matters more difficult, there are many architecture subdivisions that Go does not have, and there is no fallback to a common version, which means you will need to create multiple packages for a single Go binary.

For example:

amd64 -> x86_64 (The only correct one) i386 -> i386_pentium4
i386 GO386=softfloat -> i386_pentium-mmx
arm64 -> aarch64_cortex-generic aarch64_cortex-a53 aarch64_cortex-a72 aarch64_cortex-a76

...

How can we reproduce this?

opkg install ./your-ipk-file

Unknown package 'my-pkg'. Collected errors:

nfpm version

____       ____      _                            ____
 / ___| ___ |  _ \ ___| | ___  __ _ ___  ___ _ __  |  _ \ _ __ ___
| |  _ / _ \| |_) / _ \ |/ _ \/ _` / __|/ _ \ '__| | |_) | '__/ _ \
| |_| | (_) |  _ <  __/ |  __/ (_| \__ \  __/ |    |  __/| | | (_) |
 \____|\___/|_| \_\___|_|\___|\__,_|___/\___|_|    |_|   |_|  \___/
goreleaser-pro: Deliver Go Binaries as fast and easily as possible
https://goreleaser.com/pro

GitVersion:    2.3.2-pro
GitCommit:     7470a5eeee3f6a26734f6cebcbcc1401cb9e8aad
GitTreeState:  clean
BuildDate:     2024-09-17T17:20:07Z
BuiltBy:       goreleaser
GoVersion:     go1.23.1
Compiler:      gc
ModuleSum:     unknown
Platform:      darwin/arm64

Search

Code of Conduct

Additional context

No response

caarlos0 commented 2 months ago

you can set your custom arch with the arch field in your nfpm.yaml.

the arches there are used only if you pass a GOARCH instead... we know this is not 100% accurate for this format, but not much we can do...

nekohasekai commented 2 months ago

I misunderstood, this should be a goreleaser problem.