Closed Vad1mo closed 1 month ago
Hi @Vad1mo,
First of all, thank you very much for your contribution to https://github.com/stoplightio/spectral/pull/2627. We appreciate any participation!
Hover, after doing some research, our team came to the following conclusions:
In all cases, x64 is not a correct suffix for a CPU architecute. It can not be used to determine the right architecture.
To be honest, we can't prove or disprove it. As far as we know architecture names are not standardized. Or we wasn't able to find any enumeration of the supported architectures by dpkg
.
That being said, we decided to resort to sticking to "common practices". And one of the most common packages is JS world nowadays is NodeJS itself. As you can see from the list of compiled binaries for a different architectures node team sticks to x64 variant: node-v22.2.0-linux-x64.tar.gz). To prove that it is compiled for the same architecture as a special binary, here is the result of running the file command for both binaries:
$ file spectral-linux-x64
spectral-linux-x64: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=09cd36297a0e7652945b08ef82c63ce27a10e24b, for GNU/Linux 2.6.32, stripped
$ file node-v22.2.0-linux-x64
node-v22.2.0-linux-x64: ELF 64-bit LSB executable, x86-64, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, BuildID[sha1]=92ee19d9d9ba09d400f3568ec61cc76c683c4618, for GNU/Linux 3.2.0, with debug_info, not stripped, too many notes (256)
To not leave you without any solution to your problem there are some good examples in the search list that you provided on how to add branching to your Dockerfile:
Thanks for creating an issue along with the PR! Let us know if you have any questions.
I see thank you for the detailed explanation.
The generated release assets contain a CPU architecture suffix x64 that is not usable (for automated processing)
Example:
In all cases, x64 is not a correct suffix for a CPU architecute. It can not be used to determine the right architecture.
Example for correct X86 64 bit architecture is AMD64
ARM64 in M2
Because in automation tools and workflows, often
dpkg --print-architecture
is used (see here) Example, DockerfileI suggest to generate the Assets with the
amd64
for the x86 64 bit architecture.