Bug#995670: Another zig packaging effort

2022-06-02 Thread Jason Ernst
Yes no problem!

On Thu, Jun 2, 2022, 4:36 PM Bastian Germann  wrote:

> X-Debbugs-Cc: nicholaschasti...@gmail.com
>
> Hi,
>
> Jason, you would have to provide a source package (.dsc + referenced
> files) somewhere,
> which is a complete thing for Debian folks. This is the condition to find
> a sponsor.
> I have not looked at your approach because it is unfamiliar.
>
> I have had a look at what Nick provided and this seems to be reasonable
> enough to take a closer look.
> The build log looks like you took the approach that Andrew described.
>
> Jason, would you be willing to hand over the ITP to Nick so that we can
> make zig happen for bookworm?
> Nick, in case Jason does not reply in three weeks please take this over
> and address this ITP with your changelog.
>
> Thanks,
> Bastian
>


Bug#995670: ITP: zig -- General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software

2021-10-09 Thread Jason Ernst
So far I have a working build from the main zig repo for amd64, using the
llvm, clang and lld from the debian repos (although this is only possible
in sid because version 12 isn't present in the stable releases).
I've been doing it via docker to ensure a clean build environment:
https://github.com/compscidr/zig-deb/tree/debian-pkg/debian-pkg

It generates all of the needed files, and sings the package according to
guides I've been following from the mentors / maintainers websites.

I think I have figured out how to also produce cross-compiled packages for
other arches using pbuilder, but I'll have to abandon my docker approach
since it doesn't seem to work well with it. Planning on abandoning the
docker approach and using a debian VM in virtualbox (I typically use
Ubuntu).

I'm guessing in order to work in non-sid debian, I'll have to pull in the
actual llvm, lld, and clang sources like the bootstrap repo does. I'm
guessing these also need to be packaged in the debian source package too?

One thing I haven't tried is just using zig itself to do the cross
compiling.

Andrew, happy to work with you on this, if you like instead of dev-ing this
in my own repo, I can make a branch in either the main zig repo, or the
bootstrap repo - whichever you'd prefer. Also happy to jump on a quick call
to discuss.

Jason


On Sat, Oct 9, 2021 at 12:42 PM Andrew Kelley  wrote:

> On Tue, 5 Oct 2021 00:20:09 + Paul Wise  wrote:
> > Please make sure the package is built solely from the source from
> > scratch without any existing binaries using the upstream supported
> > bootstrap process:
> >
> > https://github.com/ziglang/zig-bootstrap/
> >
> > Personally, I think merging zig-bootstrap into the zig source repo
> > would make it easier for distros to use, but I hear upstream isn't
> > interested in that.
>
> Hi pabs,
>
> Upstream is definitely interested in cooperating with Debian maintainers
> to the benefit of our shared users :-)
>
> I'm happy to discuss this suggestion. Here is some information to help
> us sort this out:
>
>   * zig-bootstrap contains copy+pasted upstream sources from
> - LLVM, LLD, Clang
>   - There is currently 1 tiny patch to LLD's build script to adjust
> an include directory to depend on something inside zig-bootstrap rather
> than to an external directory
>   - There are also some deleted files which is merely an attempt to
> reduce tarball size; these could be restored to no harmful effect.
> - Zig (no patches)
> - zlib (no patches)
>
>   * Apart from this, the *only* utility that zig-bootstrap provides is a
> short build script, which does the following process:
> - Build LLVM, Clang, LLD, zlib, zig from source, for the host system
> - Using freshly built native zig, use `zig cc`/`zig c++` to rebuild
> LLVM, Clang, LLD, zlib, and zig again, from source, for the target system
>
> This is useful for upstream to provide portable binaries of Zig,
> however, I suspect that there is a better strategy which is more
> compatible with Debian's guidelines. In fact, I have been keeping
> Debian-friendliness in mind since the very beginning. I suspect you will
> actually find the main build process more amenable to packaging.
>
> In the main upstream repository (https://github.com/ziglang/zig/), it is
> a standard cmake build that I believe is already Debian-compatible. I am
> guessing you found the zig-bootstrap repository because you wanted to
> avoid depending on a zig binary to build zig; what you may not realize
> is that the main zig repository *does not utilize a zig binary* to be
> built. In fact, the main cmake build process does the following things:
>
>   * Use the system C++ compiler to build zig0 executable using system
> LLVM, LLD, Clang, zlib libraries
>   * Use the freshly built zig0 executable to build zig1.o
>   * Re-link some of the build artifacts, swapping in zig1.o, producing
> the zig binary
>
> I believe this is exactly what a Debian package wants, because you will
> end up with a binary that
>   * Uses the system LLVM, LLD, Clang, zlib libraries
>   * Was built with the system C/C++ compiler and linker
>
> I suggest to try out the main, standard way of building Zig and let me
> know if you run into any trouble. I suspect the main issues will be:
>
>   * deps/SoftFloat-3e is a vendored library. I would be happy to improve
> the cmake build script to enable an option to prefer the system
> SoftFloat library instead.
>
>   * lib/libcxx, lib/libcxxabi, lib/libunwind, lib/tsan and lib/include
> are copy+pasted (MIT-compatibly licensed) from other upstreams, and
> there are quite a few patches and preprocessing which is part of the zig
> development process. I am hoping that Debian can grant zig an exception
> for these files and not require them to be built by a debian package.
> These files are part of the "magic" that makes zig attractive in the
> first place, and although these files may look like they should be
> provided by other debian packages, I th

Bug#995670: ITP: zig -- General-purpose programming language and toolchain for maintaining robust, optimal, and reusable software

2021-10-03 Thread Jason Ernst
Package: wnpp
Severity: wishlist
Owner: Jason Ernst 
X-Debbugs-Cc: debian-de...@lists.debian.org

* Package name: ziglang
  Version : 0.8.1
  Upstream Author : Andrew Kelley and...@ziglang.org
* URL : https://ziglang.org
* License : MIT
  Programming Lang: Zig
  Description : General-purpose programming language and toolchain for 
maintaining robust, optimal, and reusable software

Zig is quickly become a new hot language, and there is growing demand for it
to be available in mainline repositories.

There is a ticket on the Zig repo: https://github.com/ziglang/zig/issues/7340
which requests for mainline packages to be available, and the upstream
maintainer replied that it is out of scope of their repository. I would like to
volunteer to package this and maintain it so it is available easily. Others are
making similar efforts in other distributions such as Fedora.

I also have a package which pulls the release and packs it using checkinstall
at https://github.com/compscidr/zig-deb which is currently hosted from a 
3rd party gemfury repository.

For now I am happy to maintain myself, but would more than welcome anyone who
would like to form a pkg-zig team (unless people feel there is a more 
appropriate team this could fit into. Co-maintainers are also welcome. I do
need a sponsor, this is my first time participating.