Prepare yourself for a shock then; bootstrapping rustc starts from an already-built version of rustc[1]:
> the only way to build a modern version of rustc is a slightly less modern version.
(There is, at least theoretically, a non-circular bootstrap chain starting with a very old rustc written in OCaml, but the more practical alternative is probably to use mrustc[2] instead.)
Ocaml has a bytecode blob in the sources (even checked into Git). It uses that to resolve its own bootstrap problem. If you aim for a source-only starting point, your journey won't stop at Ocaml.
I mean.. that is absolutely something the bootstrap/reproducibility folks would flag as a problem. Heck, https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-... went to great extremes to bootstrap a C compiler through the all-important gcc 4.9 (which comes up constantly in these efforts because it was the last gcc that builds without a C++ compiler).
The author doesn't mention if they considered switching to a glibc container to fix the lack of glibc. That seems a reasonable solution rather then swapping out the complete assembly compiler.
Keeping a clean, public vcs is a pain in the neck. If you're working on anything less than a large open-source project with many devs and random contributions, it's a pointless hassle. Can you tell me how that makes it any sketchier than leaving a public github?
Public Github with CI means the binary was built unmodified from source. You can turn off issues/PR and push only release branches with squashed commits.
Assuming you trust Github, of course. I think if someone is seriously worried code has been altered between source and maintainer-provided binary, his big concern will be the time it takes to audit the source code (which he also shouldn't trust). The build time will be inconsequential next to that.
The title distracts from the actual conclusion of the blog post, namely that it is apparently hard to build projects that include assembly on something called Alpine Linux.
If all that's missing is 'a nasm compatible assembler', did they try just swapping it out for nasm, which seems to have a readily available alpine package?
> In the same thread from the author, they mention that asmc is a fork of JWasm 4, which was written in C. Maybe it’s as “easy” as swapping out one for the other - using gcc to build jwasm, then using jwasm to build asmc?
You can probably skip that and use one of the nasm-compatible assemblers directly with 7zip's build process instead...
> Even if I did want to use the prebuilt version, it’s dynamically linked to glibc so won’t work on alpine.
I imagine the gcompat package will get it running.
The 7-zip code does admittedly scare me a bit at times, but the fact that it can be a pain to build isn't really that big of an issue. A lot of stuff is a pain to build. Like Chromium.
Don't get me wrong, OSS does not mean it will build in any random configuration on any distro. The source is there.
Maybe 7zip could do better, but still...
It's incredible the number of people who do not know how to read an open-source licence.
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
I also think a more correct title should be "I could not build 7-zip from source", as they correctly acknowledge in the end.
26 comments
[ 2.5 ms ] story [ 52.3 ms ] thread> the only way to build a modern version of rustc is a slightly less modern version.
(There is, at least theoretically, a non-circular bootstrap chain starting with a very old rustc written in OCaml, but the more practical alternative is probably to use mrustc[2] instead.)
[1] https://rustc-dev-guide.rust-lang.org/building/bootstrapping...
[2] https://guix.gnu.org/en/blog/2018/bootstrapping-rust/
https://guix.gnu.org/en/blog/2023/the-full-source-bootstrap-... https://bootstrappable.org/ https://lwn.net/Articles/983340/
https://reproducible-builds.org/
https://pkgs.alpinelinux.org/package/edge/main/x86/nasm
You can probably skip that and use one of the nasm-compatible assemblers directly with 7zip's build process instead...
> Even if I did want to use the prebuilt version, it’s dynamically linked to glibc so won’t work on alpine.
I imagine the gcompat package will get it running.
https://wiki.alpinelinux.org/wiki/Running_glibc_programs
The 7-zip code does admittedly scare me a bit at times, but the fact that it can be a pain to build isn't really that big of an issue. A lot of stuff is a pain to build. Like Chromium.
> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
I also think a more correct title should be "I could not build 7-zip from source", as they correctly acknowledge in the end.
> Ugh. This is a bit beyond my knowledge to fix
> "i'm not going to argue, i can't read assembly and i don't want my built to be slow"
> i'm going to use a highly non-standard distro that's known to have serious build problems because it uses an alternate libc
> "this is a bit beyond my knowledge to fix"
why would igor pavlov do this???
joking aside there's literally a nasm package built for alpine. he could have just aliased asmc to it and 7z probably would have built fine.