Hi all,

Thank you all for the swift replies -- I am really very encouraged by this, and I was **not** aware of zig-team on Salsa! Is there a ML where you discuss all these things? I looked through debian-devel, and thought that there wasn't much Zig work going on at the moment. I am very glad that I was wrong, and happy to join the effort (and zig-team) if you'll have me!

With regards to the things that were mentioned:

I thought that the bootstrap was the real blocker, but it turns out that the vendored code was. That's were my effort should go next then.

@nick black
-----------

> in fact, it got uploaed to NEW, where it was (correctly) shot down by ftpmasters due to missed vendored code (of which there was a tremendous amount; i don't know if this has changed).

If you still have it, could you please share the (gist of the) ftpmasters rejection? Might be useful!

I don't think the amount of vendored code has changed very much. There's some work to do, and some choices to be made.

> you mention debian/copyright is "barely started"; we've got over 1100 lines of it. i'd definitely try to leverage what you can from there

d/copyright: Yes, very happy to continue on your work. Unvendoring first would help a ton, so that's where I'd start. I'm sure ftpmasters or DFSG use tools for quickly checking for licensen vs d/copyright. Would be great to be able to use that.

> this is basically what russ albery proposed in msg00105, no?

That's correct (I could/should have mentioned that). The difference is in the seed: Not the upstream seed, but a seed from source, which was verified to be equal to the one from upstream.

The zig repo on Salsa does exclude some vendored code, but not the upstream blob (it mentions that in the d/copyright file, saying it will therefore be non-free). So, we worked on different issues.

@Maytham Alsudany
-----------------

> I have not been able to build zig0.14 [...] on my own machine, on debusine.debian.net, and on barriere.debian.org (the amd64 porterbox)

Thank you for trying to build this, and I am sorry about the many hours without success. Happy to have a look at build logs if you feel like running it again.

Some things from my notes on the build failures I encountered when going from 0.16 to 0.17.1 (different versions from the one you were trying to build):

- Do not use upstream's cmake path. cmake is good for generating config.h and building zigcpp (libzigcpp.a) and nothing else; the compiler itself has to be built by an existing zig via `zig build`. - Pass -Dversion-string= and -DZIG_VERSION= explicitly. Both paths otherwise run `git describe`, which fails in a release tarball. - Have ZIG_GLOBAL_CACHE_DIR inside the build tree. A stale ~/.cache/zig silently produces a miscompiled compiler that segfaults, with nothing in the output pointing anywhere near the cache. That cost me most of a day... :(
 - -Dcpu=baseline, or the result varies per builder.
 - I looked quite a bit at Fedora's spec file for ideas as well.

@Andrey Rakhmatullin
--------------------

> Even having leaf package on just one architecture for significant amount of time is permissible, even more so if you are going to bootstrap other architectures later.

Thank you, that settles my question 2!

And if we can build a zig-bootstrap source package on buildd, that's great to know as a possible option! Thanks :)

> Consider repacking to remove stuff you won't use (assuming not everything there is needed on Debian).

Yes, I will look into this.

Other packaging efforts have removed all the cross-compilation files (musl, Darwin, mingw, the BSDs). From what I gather, those files never end up in the compiler; they are the sources Zig compiles on demand so that it can cross-compile on a system with no cross packages installed.

I think removing all of these for now would be the best way to get Zig into Debian (much like Jonathan Carter did). It would be a native-only Zig to begin with, and cross-compilation comes in at a later stage. That is also when the path forward would have to be chosen: gcc-style (a separate compiler package per target, target libc in its own package) or clang-style (one multi-target compiler, target libc left to the user to install).

I will do the stripping incrementally against a build that currently works, and see if any removals break anything. I expect that removing lib/include (clang's resource headers) and lib/libtsan might cause issues, since `zig cc` uses those. Perhaps the build issues that Maytham reported are related to that?

And, if this is the way to go, then the abilists I mentioned in my first email will also go (for now).

@Ivan, Jesse
-------------
Thank you both! I had not found jmrx/zig.

On guix and buildds:
You are right, and I think that option (c) isn't very viable currently, also because guix is currently still blocked. None of it affects what I am proposing, where the chain runs once outside the archive, and only its output (seed / blob) is shipped.

On whether a main upload would get through:
Fair enough. I guess we will only find out when an attempt to upload is made, unless ftpmasters also comment on threads like these?

I do not think we are competing, though. Your Files-Excluded removes a lot of work from d/copyright, which is great! What I have is something else: The seed that lets stage1/zig1.wasm be excluded too, so the result can go to main instead of non-free, and ghostty to main instead of contrib. If ftpmaster reject the seed, your non-free package is still there and nothing is lost but my time. Could we just ask them?

Alright! Again, thank you all so much for your input and for your work on getting Zig into Debian!

Kind regards,

Edmund


P.S.: I hope I covered everything. If not, please ping me!


--
Edmund Lodewijks <[email protected]>
TZ: UTC+2 / GMT+2

Reply via email to