WillAbides / bindown

MIT License
14 stars 2 forks source link

Handle microarchitectures #161

Open WillAbides opened 1 year ago

WillAbides commented 1 year ago

Make it simpler to handle micro-architectures so that the same dependency can target multiple microarchitectures for the same arch. For instance both binname-linux-armv5 and binname-linux-armv6.

Considerations

Systems

Currently a system is "os/arch". I think we will need to expand this to "os/arch[/microarch]" with unspecified microarch defaulting to go's default when unspecified. So linux/arm/v5 will download binname-linux-armv5 while both linux/arm and linux/arm/v6 will download binname-linux-armv6.

Multiple types of microarchitecture.

Go defines microarchitecture with different variables depending on the GOARCH. Those vars are currently:

var arches values default
GO386 386 softfloat, sse2 sse2
GOARM arm 5, 6, 7 6
GOAMD64 amd64 v1, v2, v3, v4 v1
GOMIPS mips, mipsle hardfloat, softfloat hardfloat
GOPPC64 ppc64 power8, power9 power8

Because no arch has more than one var, we may be able to have one template var for all archs. Something like {{ .microArch }}. We should also populate {{ .go386 }}, {{ .goarm }}, etc.

This assumes there will never by a single GOARCH that can have multiple microarchs. I think that's a safe assumption. If this changes, we may need to make a breaking change.

add-by-*

No more details...just need to remember to consider dependency add-by-urls and dependency add-by-github-release.