guix-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#47006] [WIP PATCH v2 2/2] gnu: Add zig.


From: Liliana Marie Prikler
Subject: [bug#47006] [WIP PATCH v2 2/2] gnu: Add zig.
Date: Sun, 12 Sep 2021 09:32:15 +0200
User-agent: Evolution 3.34.2

Hi,

Am Samstag, den 11.09.2021, 21:42 -0700 schrieb Sarah Morgensen:
> Hi,
> 
> I finally got a chance to run some tests.  I've attached a patch
> below
> that works.  As András pointed out,
> 
> András Vöröskői <voroskoi@gmail.com> writes:
> 
> > Hi,
> > 
> > So zig testing result is the following:
> > -Dskip-libc does not work, my best result is with -Dskip-non-
> > native.
> > 
> > -Dskip-non-native fails with "libc headers note" test from
> > `compile_errors.zig` (I had to comment it around line 2750) and std
> > library tests also fails instantaneously.
> > 
> > So I suggest the following test command for now: `zig build
> > -Dskip-non-native test-toolchain` with a patch to disable that
> > failing
> > test. This will test everything except the std library and docs.
> 
> 'test-toolchain' is probably a good choice because it skips standard
> library tests, which I found out can take a lot of memory
> (>7.5GB)!  I also disabled stage 2 tests since stage 2 is
> experimental and isn't actually installed.
So far, so good.

> Now that I have an output:
> 
> --8<---------------cut here---------------start------------->8---
> $ ./pre-inst-env guix size zig 
> store
> item                                                       total    s
> elf
> /gnu/store/kwjw55f4syys5gg8a9lr6bk6a3jdqw0i-zig-
> 0.8.1              576.6   177.4  30.8%
> /gnu/store/rmc131fpy2hv408a1awd2wm7kiwyf7d7-llvm-
> 12.0.0            234.1   162.7  28.2%
> /gnu/store/rn75fm7adgx3pw5j8pg3bczfqq1y17lk-gcc-
> 7.5.0              178.5   107.3  18.6%
> /gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-
> 2.31              38.4    36.7   6.4%
> /gnu/store/f0ca0lf64bw08srv1bj7gkg6ag0sbdb2-gcc-7.5.0-
> lib           71.0    32.6   5.7%
> /gnu/store/01b4w3m6mp55y531kyi1g8shh722kwqm-gcc-7.5.0-
> lib           71.0    32.6   5.7%
> /gnu/store/nzfhh1rm85lx2p5plbx45qqj82pcv5hp-clang-runtime-
> 12.0.0    95.9    24.9   4.3%
> /gnu/store/mmhimfwmmidf09jw1plw3aw1g1zn2nkh-bash-static-
> 5.0.16       1.6     1.6   0.3%
> /gnu/store/g2s5jfkfd4k973wb58476b1bbv9zpm6m-zlib-
> 1.2.11             38.6     0.2   0.0%
> /gnu/store/rykm237xkmq7rl1p0nwass01p090p88x-zlib-
> 1.2.11             71.2     0.2   0.0%
> /gnu/store/bw15z9kh9c65ycc2vbhl2izwfwfva7p1-libffi-
> 3.3              71.2     0.2   0.0%
> total: 576.6 MiB
> --8<---------------cut here---------------end--------------->8---
> 
> It looks like we're retaining references to the main gcc-7.5.0
> output, but only to its "include/c++" directory, as a single
> reference in the zig binary.  I expect this would cause issues if
> another GCC version were later used with Zig.
Where does that include/c++ come from?  Could it be related to the libc
header thing we talked about in IRC?  I don't see any substitution for
that going on either.

> We're retaining double direct references to gcc-7.5.0-lib, and double
> indirect references to zlib-1.2.11.  This seems to come from clang.
> (Wow, clang is big. Maybe it should have a separate "lib"
> output?  Zig, for example, only needs libclang to build, not the
> binaries.)
> 
> Other than those items, it looks good!
According to `guix refresh', there's only two dependents of Clang 12,
but since we'd have to rebuild all clangs, that might go into core-
updates territory.  We might also want to check with an expert on
X/Mesa, since that seems to be one of our biggest clang dependents.

> +       (patches
> +        (search-patches
> +         "zig-disable-libc-note-test.patch"
Is this test really necessary to skip that test?  If not, let's try to
use the command line for that.
> +         ;; XXX: Remove the following patch when updating LLVM to
> 12.0.1.
> +         "zig-disable-MIPS-tests.patch"
There's a patch for LLVM 12.0.1 waiting in the ML and we could
potentially bump lld to 12.0.1 regardless.  (Can LLVM components be
mix-matched like that?)
> +         "zig-fix-cross-native-execution.patch"
IIUC this is weaker than "-Dskip-non-native".  Is there a reason to
include specifically these non-native tests?
> +         "zig-use-explicit-paths.patch"))))

> +    (native-search-paths
> +     (list
> +      (search-path-specification
> +       (variable "ZIG_INCLUDE_DIRS")
> +       ;; XXX: It doesn't seem as though Zig can distinguish between
> C and C++
> +       ;;      include paths, so provide both.
> +       (files '("include/c++" "include")))
> +      (search-path-specification
> +       ;; TODO: Might be confused with "ZIG_LIB_DIR"... Maybe use
> +       ;;       "ZIG_INCLUDE_PATH" and "ZIG_LIBRARY_PATH"?
> +       (variable "ZIG_LIB_DIRS")
> +       (files '("lib" "lib64")))))
You can rewrite "zig-use-explicit-paths.patch" in-place with Emacs'
query-replace and/or sed (or even just manually, there are no lines to
add or remove) if you disagree with my environment variable naming
choice.  Just make sure you don't accidentally break diff by deleting
trailing space.

Regards






reply via email to

[Prev in Thread] Current Thread [Next in Thread]