bug#74217: Bootstrapping Zig with no Binary Blobs

2024-11-15 Thread Hilton Chain via Bug reports for GNU Guix
On Fri, 15 Nov 2024 11:29:10 +0800,
Hilton Chain wrote:
>
> Good news: Thanks to this diff, I know how to add libc to RUNPATH now :)
>
> Another forced push, I have ensured consistent behavior for
> (CROSS_)?LIBRARY_PATH and added libc RUNPATH without restoring the behavior
> passing '-lc' to linker.
>
> Who said not going to implement a ld-wrapper within Zig?  :P
> Fortunately it was already there :)
>
> BTW, adding pkg-config to native-inputs works for ncdu.

I have locally made the "use-system-paths" patch larger so that Zig can really
honor "CROSS_" environment variables.

The next issue is cross building with pkg-config.  Zig only invokes
"pkg-config", but we don't have a "pkg-config" with search path for target
inputs.  I can add a pkg-config-for-zig to workaround this, and then... It's
dynamic linker path, I'll look into it soon.

Also for reproducibility, bin/zig is the only file differs and here's the diff,
I don't know about this part so I currently have no idea on fixing it.
--8<---cut here---start->8---
--- /gnu/store/gqdi4drfn3js5cwgfmlpkyfm2xf3l5b0-zig-0.10.1/bin/zig
+++ cuirass/gqdi4drfn3js5cwgfmlpkyfm2xf3l5b0-zig-0.10.1/bin/zig
├── readelf --wide --decompress --string-dump=.rodata {}
│ @@ -77024,14 +77024,16 @@
│[149be0]  +�&
│[149bf9]  )&
│[149c12]  %
│[149c28]  VO$
│[149c40]  D�(
│[149c59]  >$
│[149c70]  8�%
│ +  [149c94]  ;
│ +  [149ca0]  ;
│[149ca8]  '
│[149cb0]  uespemos�odnarodarenegylsetybdet
│[149cf0]  p��
│[149d11]  O'
│[149d21]  5&
│[149d31]  f&
│[149d40]  SJ'
--8<---cut here---end--->8---

--8<---cut here---start->8---
--- /gnu/store/466cm9xpjqg80iqracj4qirsrdha1rnk-zig-0.11.0/bin/zig
+++ cuirass/466cm9xpjqg80iqracj4qirsrdha1rnk-zig-0.11.0/bin/zig
├── readelf --wide --decompress --string-dump=.rodata {}
│ @@ -64905,14 +64905,16 @@
│[ 5ae48]  
xpnt4win2kvistawin10ws2003win8_1win10_th2win10_rs1win10_rs2win10_rs3win10_rs4win10_rs5win10_19h1
│[ 5aef0]
│[ 5aef8]  #
│[ 5af00]  %
│[ 5af08]  %
│[ 5af10]  &
│[ 5af78]  celfhexrawmachospirvdxcontainer
│ +  [ 5afc0]  ;
│ +  [ 5aff8]  ;
│[ 5b070]  E
│[ 5b0b4]  ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_
│[ 5b350]
│[ 5b380]  @
│[ 5b3e0]
│[ 5b420]  ]
│[ 5b5e0]  %
--8<---cut here---end--->8---





bug#74217: Bootstrapping Zig with no Binary Blobs

2024-11-15 Thread Motiejus Jakštys
On Sat, Nov 16, 2024 at 8:55 AM Hilton Chain  wrote:
>
> On Fri, 15 Nov 2024 22:30:40 +0800,
> Hilton Chain wrote:
> >
> > Also for reproducibility, bin/zig is the only file differs and here's the 
> > diff,
> > I don't know about this part so I currently have no idea on fixing it.
>
> This seem to be an upstream issue, Zig is reproducible only on the same 
> machine.
> I'll verify it and report to upstream.

Zig defaults to `-march=native` when building for the host. Try
ZIG_TARGET_MCPU=baseline when building stage3.

Motiejus





bug#74217: Bootstrapping Zig with no Binary Blobs

2024-11-15 Thread Hilton Chain via Bug reports for GNU Guix
On Fri, 15 Nov 2024 22:30:40 +0800,
Hilton Chain wrote:
>
> I have locally made the "use-system-paths" patch larger so that Zig can really
> honor "CROSS_" environment variables.
>
> The next issue is cross building with pkg-config.  Zig only invokes
> "pkg-config", but we don't have a "pkg-config" with search path for target
> inputs.  I can add a pkg-config-for-zig to workaround this, and then... It's
> dynamic linker path, I'll look into it soon.

Adding a file with content like the following and passing --libc  to
zig works, RUNPATH is correct and no need to set CC then.

--8<---cut here---start->8---
include_dir=/gnu/store/dfx90sc16nphh6bd07sjyri6x4s51zni-glibc-cross-aarch64-linux-gnu-2.39/include
sys_include_dir=/gnu/store/dfx90sc16nphh6bd07sjyri6x4s51zni-glibc-cross-aarch64-linux-gnu-2.39/include
crt_dir=/gnu/store/dfx90sc16nphh6bd07sjyri6x4s51zni-glibc-cross-aarch64-linux-gnu-2.39/lib
msvc_lib_dir=
kernel32_lib_dir=
gcc_dir=
--8<---cut here---end--->8---

For cross builds interpreter path like /lib/ld-linux-aarch64.so.1 is used in
output binary, I'll find a way to fix it.

> Also for reproducibility, bin/zig is the only file differs and here's the 
> diff,
> I don't know about this part so I currently have no idea on fixing it.

This seem to be an upstream issue, Zig is reproducible only on the same machine.
I'll verify it and report to upstream.





bug#67241: [PATCH] guix-install.sh: Add message about Info reader.

2024-11-15 Thread Simon Tournier
* etc/guix-install.sh (_info): New procedure.
(_chk_sys_nscd, main_install): Use it.

Change-Id: I2cad8bc2554cd4ea88f30c8a104b7c62f2aa2e0e
---
 etc/guix-install.sh | 18 ++
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/etc/guix-install.sh b/etc/guix-install.sh
index f07b2741bb..08e25de238 100755
--- a/etc/guix-install.sh
+++ b/etc/guix-install.sh
@@ -5,7 +5,7 @@
 # Copyright © 2018 Efraim Flashner 
 # Copyright © 2019–2020, 2022 Tobias Geerinckx-Rice 
 # Copyright © 2020 Morgan Smith 
-# Copyright © 2020 Simon Tournier 
+# Copyright © 2020, 2024 Simon Tournier 
 # Copyright © 2020 Daniel Brooks 
 # Copyright © 2021 Jakub Kądziołka 
 # Copyright © 2021 Chris Marusich 
@@ -129,6 +129,16 @@ die()
 exit 1
 }
 
+_info()
+{
+if [ "$(type -P info)" ]; then
+_msg "$1"
+else
+_msg "${WAR}Please install Info reader; see package 'info-reader'"
+_msg "$1"
+fi
+}
+
 # Return true if user answered yes, false otherwise.  The prompt is
 # yes-biased, that is, when the user simply enter newline, it is equivalent to
 # answering "yes".
@@ -290,11 +300,11 @@ chk_sys_nscd()
 if [ "$(type -P pidof)" ]; then
 if [ ! "$(pidof nscd)" ]; then
 _msg "${WAR}We recommend installing and/or starting your 
distribution 'nscd' service"
-_msg "${WAR}Please read 'info guix \"Application Setup\"' about 
\"Name Service Switch\""
+_info "${WAR}Please read 'info guix \"Application Setup\"' about 
\"Name Service Switch\""
 fi
 else
 _msg "${INF}We cannot determine if your distribution 'nscd' service is 
running"
-_msg "${INF}Please read 'info guix \"Application Setup\"' about \"Name 
Service Switch\""
+_info "${INF}Please read 'info guix \"Application Setup\"' about 
\"Name Service Switch\""
 fi
 }
 
@@ -856,7 +866,7 @@ main_install()
 rm -r "${tmp_path}"
 
 _msg "${PAS}Guix has successfully been installed!"
-_msg "${INF}Run 'info guix' to read the manual."
+_info "${INF}Run 'info guix' to read the manual."
 
 # Required to source /etc/profile in desktop environments.
 _msg "${INF}Please log out and back in to complete the installation."

base-commit: 3e8d3d80f41e016cdfe80e488a78c2351c94fef8
-- 
2.45.2