bug#62820: [core-updates] error building xkeyboard-config

2023-04-13 Thread Brian Cully via Bug reports for GNU Guix



Looks like something changed between 2.34 (on master) and 2.36 (on 
core-updates) which caused ‘share/X11/rules/base’ to generate 
improperly.


On core-updates:
--8<---cut here---start->8---
~/src/guix-core-updates $ ./pre-inst-env guix build 
xkeyboard-config

/gnu/store/0yg8hlbvynr5bq8816srgcyjf50sp54h-xkeyboard-config-2.36
--8<---cut here---end--->8---

Which includes the following broken lines in ‘rules/base’:
--8<---cut here---start->8---
! $inetmediakbds = \
		a4_rfkb23 a4techKB21 a4techKBS8 acer_ferrari4k 
		acer_laptop /
		armada asus_laptop benqx btc5090 btc6301urf 
		btc9019u /

cherrybluea cherryblueb cherrycyboard chicony042 /
compalfl90 compaqik13 compaqik18 creativedw7000 /
		cymotionlinux dellm65 dellusbmm dexxa diamond 
		dtk2000 /
		emachines ennyah_dkb1008 fscaa1667g genius 
		geniuscomfy /
		geniuscomfy2 geniuskb19e hp5xx hpdv5 hpi6 hpxe3gc 
		hpxe3gf /

hpxe4xxx hpxt1000 hpzt11xx inspiron latitude /
		logidinovo logidinovoedge logitech_base 
		logitech_g15 /
		microsoft4000 microsoft7000 microsoftmult 
		microsoftpro /
		microsoftprooem mx1998 mx2500 mx2750 pc105 
		precision_m /
		presario propeller samsung4500 samsung4510 
		scorpius /
		silvercrest sk1300 sk2500 sk7100 sp_inet 
		targa_v811 /

thinkpad thinkpad60 tm2030USB-102 tm2030USB-106 /
		toshiba_s3000 trust trustda trust_slimline 
		unitekkb1925

--8<---cut here---end--->8---

Note the forward slash as a line continuation character, rather 
than a backslash, which is used everywhere. The same file on 
master:

--8<---cut here---start->8---
~/src/guix $ ./pre-inst-env guix build xkeyboard-config
/gnu/store/8mszv7v6kqdyavpvf8zb7kkagaan5vri-xkeyboard-config-2.34
--8<---cut here---end--->8---

This is the equivalent block:
--8<---cut here---start->8---
! $inetmediakbds = acer_ferrari4k acer_laptop btc5090 btc9019u 
 cherryblueb \
		cherrybluea herrycyboard chicony042 compaqik13 
		compaqik18 \
		armada presario dellm65 inspiron dellusbmm diamond 
		\
		ennyah_dkb1008 genius geniuscomfy2 hpi6 hpxe3gc 
		hpxe3gf \
		hpxt1000 hpzt11xx hpdv5 hpxe4xxx hp5xx thinkpad60 
		ogitech_base \
		logidinovo logidinovoedge logitech_g15 mx1998 
		mx2500 mx2750 \
		microsoft4000 microsoft7000 microsoftprooem 
		microsoftmult \
		propeller samsung4500 samsung4510 sk1300 sk2500 
		sk7100 \
		toshiba_s3000 trust trustda cymotionlinux 
		silvercrest \
		emachines benqx unitekkb1925 creativedw7000 
		compalfl90 \
		pc105 a4techKB21 a4techKBS8 a4_rfkb23 asus_laptop 
		btc6301urf \
		dexxa dtk2000 fscaa1667g geniuskb19e geniuscomfy 
		latitude \
		microsoftpro precision_m scorpius sp_inet 
		targa_v811 thinkpad \

tm2030USB-102 tm2030USB-106 trust_slimline
--8<---cut here---end--->8---

This is causing issues when building my system config, as 
‘(keyboard-layout "us")’ with core-updates returns a syntax error 
due to the above.


I'm not sure what's going on here, as it doesn't appear as though 
the package has any custom rules. It did change from 
‘gnu-build-system’ to ‘meson-build-system’ with the version bump, 
though, so maybe there's something in there?


-bjc





bug#62448: [PATCH] doc: Note that `guix shell` should contain base language packages.

2023-04-13 Thread Skyler via Bug reports for GNU Guix
> The later, I'd say; we're all volunteers :-).

Fair enough!





bug#62818: rust-analyzer broken after rustc got bumped

2023-04-13 Thread Steven Roose
The Guix version of rust-analyzer that is in rust-apps.scm is somehow 
dependent on rustc 1.60.0 and seems to use it internally to do 
compilation and checks.



Guix recently published rustc v1.65.0 to the repo and after pulling that 
in, many compilations fail with some very strange error message "this 
crate is not compiled for the right Rust version, please recompile with 
version 1.60".


One possible workaround would probably be to instruct rust-analyzer to 
use a different directory to store its artefacts, but that would mean 
building everything twice and keeping two sets of build artifacts which 
can become quite sizable.



It seems that either rust-analyzer should be make 
rustc-version-independent, no idea how that would work, or rust-analyzer 
should be updated alongside rustc whenever possible.







bug#61879: Patch

2023-04-13 Thread Andreas Enge
Hello,

attached is a new commit in old syntax, mixing both our commits.
I have confirmed that it does not change the gcc-11 build on x86_64 and i686.
But do we need "--force" for patching?

Could you maybe check again whether this builds gcc-11 on powerpc?

If yes, we can push it, and feel free to gexpify it in a separate commit.

Andreas

>From 9900f9e9b86550e7d336b04ad46fba088e28cbd6 Mon Sep 17 00:00:00 2001
From: Andreas Enge 
Date: Thu, 13 Apr 2023 11:46:47 +0200
Subject: [PATCH] gnu: gcc-11: Fix build on powerpc64le.

* gnu/packages/patches/gcc-11-libstdc++-powerpc.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register patch.
* gnu/packages/gcc.scm (make-libstdc++): Apply patch for gcc versions >= 11
and < 12 on ppc64le.

Co-authored-by: Christopher Baines 
---
 gnu/local.mk   |  1 +
 gnu/packages/gcc.scm   | 11 ++-
 .../patches/gcc-11-libstdc++-powerpc.patch | 18 ++
 3 files changed, 29 insertions(+), 1 deletion(-)
 create mode 100644 gnu/packages/patches/gcc-11-libstdc++-powerpc.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index b07811f1cb..1255846462 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1184,6 +1184,7 @@ dist_patch_DATA = 
\
   %D%/packages/patches/gcc-11-libstdc++-hurd-libpthread.patch   \
   %D%/packages/patches/gcc-12-cross-environment-variables.patch \
   %D%/packages/patches/gcc-10-tree-sra-union-handling.patch\
+  %D%/packages/patches/gcc-11-libstdc++-powerpc.patch   \
   %D%/packages/patches/gcolor3-update-libportal-usage.patch\
   %D%/packages/patches/gd-fix-tests-on-i686.patch  \
   %D%/packages/patches/gd-brect-bounds.patch   \
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index a511cdbc45..ae324219d3 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2012-2023 Ludovic Courtès 
 ;;; Copyright © 2014, 2015, 2018 Mark H Weaver 
 ;;; Copyright © 2014, 2015, 2016, 2017, 2019, 2021 Ricardo Wurmus 

-;;; Copyright © 2015 Andreas Enge 
+;;; Copyright © 2015, 2023 Andreas Enge 
 ;;; Copyright © 2015-2018, 2020-2023 Efraim Flashner 
 ;;; Copyright © 2016 Carlos Sánchez de La Lama 
 ;;; Copyright © 2018 Tobias Geerinckx-Rice 
@@ -889,6 +889,15 @@ (define-public (make-libstdc++ gcc)
   ":")
  "\nAM_CXXFLAGS = ")))
'())
+ ,@(let ((version (package-version gcc)))
+(if (and (target-ppc64le?)
+(version>=? version "11")
+(not (version>=? version "12")))
+   `((add-after 'unpack 'patch-powerpc
+   (lambda _
+(invoke "patch" "--force" "-p1" "-i"
+(search-patch "gcc-11-libstdc++-powerpc.patch")
+   '()))
  ;; Force rs6000 (i.e., powerpc) libdir to be /lib and not /lib64.
  (add-before 'chdir 'fix-rs6000-libdir
(lambda _
diff --git a/gnu/packages/patches/gcc-11-libstdc++-powerpc.patch 
b/gnu/packages/patches/gcc-11-libstdc++-powerpc.patch
new file mode 100644
index 00..aff2ef16f1
--- /dev/null
+++ b/gnu/packages/patches/gcc-11-libstdc++-powerpc.patch
@@ -0,0 +1,18 @@
+diff -u -r gcc-11.3.0.alt/libstdc++-v3/src/c++17/floating_from_chars.cc 
gcc-11.3.0/libstdc++-v3/src/c++17/floating_from_chars.cc
+--- gcc-11.3.0.alt/libstdc++-v3/src/c++17/floating_from_chars.cc   
2023-04-13 11:36:08.169841428 +0200
 gcc-11.3.0/libstdc++-v3/src/c++17/floating_from_chars.cc   2023-04-13 
11:36:54.825827304 +0200
+@@ -495,8 +495,14 @@
+ from_chars(const char* first, const char* last, __ieee128& value,
+  chars_format fmt) noexcept
+ {
++#if _GLIBCXX_USE_CXX11_ABI
+   buffer_resource mr;
+   pmr::string buf();
++#else
++  string buf;
++  if (!reserve_string(buf))
++return make_result(first, 0, {}, ec);
++#endif
+   size_t len = 0;
+   errc ec = errc::invalid_argument;
+   __try
-- 
2.39.2



bug#61879: Powerpc on core-updates

2023-04-13 Thread Andreas Enge
Am Thu, Apr 13, 2023 at 02:46:00PM +0100 schrieb Christopher Baines:
> Thanks for figuring this out Andreas! I've managed to apply this change
> in the relevant place, and it appears to work.

Good news, thanks!

> +  #$@(if (and (target-ppc64le?)
> +  (version>=? (package-version gcc) "11"))

The file changed a lot on master, and the patch will not apply and
should not be needed there. I did not check, but I think it is already
not needed for gcc@12 any more. So we should probably check for the
major version being equal to 11.

It should be easy to check that it does not cause any rebuilds on the
other architectures, and we cannot break powerpc more than it already
is, so feel free to push something along these lines to core-updates.

Andreas






bug#61879: Powerpc on core-updates

2023-04-13 Thread Christopher Baines

Andreas Enge  writes:

> In the file
>libstdc++-v3/src/c++17/floating_from_chars.cc
> previous functions have code like this:
> #if _GLIBCXX_USE_CXX11_ABI
>   buffer_resource mr;
>   pmr::string buf();
> #else
>   string buf;
>   if (!reserve_string(buf))
> return make_result(first, 0, {}, ec);
> #endif
>
> while here we only have:
>   buffer_resource mr;
>   pmr::string buf();
>
> So my guess would be that we should simply replace this snippet with the
> one above.
>
> Could someone with access to a powerpc machine try out this change?

Thanks for figuring this out Andreas! I've managed to apply this change
in the relevant place, and it appears to work.

I tried to apply it in a way that only affected powerpc64le-linux, but
I'm not sure I was successful. I've got no idea where it's best to apply
this patch, or how describe it, but at least this is a step forward.

From 382862fc06085ba80380977caf2a1f9c3203a12d Mon Sep 17 00:00:00 2001
From: Christopher Baines 
Date: Thu, 13 Apr 2023 14:45:14 +0100
Subject: [PATCH] WIP

---
 gnu/packages/gcc.scm   | 108 ++---
 gnu/packages/patches/foo.patch |  20 ++
 2 files changed, 80 insertions(+), 48 deletions(-)
 create mode 100644 gnu/packages/patches/foo.patch

diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index a511cdbc45..6f6f2caa5e 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -853,56 +853,68 @@ (define-public (make-libstdc++ gcc)
 (inherit gcc)
 (name "libstdc++")
 (arguments
- `(#:out-of-source? #t
-   #:modules ((srfi srfi-1)
+ (list
+  #:out-of-source? #t
+  #:modules `((srfi srfi-1)
   (srfi srfi-26)
   ,@%gnu-build-system-modules)
-   #:phases
-   (modify-phases %standard-phases
- ,@(if (version>=? (package-version gcc) "11")
-   `((add-after 'unpack 'hide-gcc-headers
-   (lambda* (#:key native-inputs inputs #:allow-other-keys)
- (let ((gcc (assoc-ref (or native-inputs inputs)
-   ,(if (%current-target-system)
-"cross-gcc"
-"gcc"
-   ;; Fix a regression in GCC 11 where the GCC headers
-   ;; shadows glibc headers when building libstdc++.  An
-   ;; upstream fix was added in GCC 11.3.0, but it only
-   ;; hides system include directories, not those on
-   ;; CPLUS_INCLUDE_PATH.  See discussion at
-   ;; 
-   ;; and the similar adjustment in GCC-FINAL.
-   (substitute* "libstdc++-v3/src/c++17/Makefile.in"
- (("AM_CXXFLAGS = ")
-  (string-append ,(if (%current-target-system)
-  "CROSS_CPLUS_INCLUDE_PATH = "
-  "CPLUS_INCLUDE_PATH = ")
- (string-join
-  (remove (cut string-prefix? gcc <>)
-  (string-split
-   (getenv
-,(if (%current-target-system)
- "CROSS_CPLUS_INCLUDE_PATH"
- "CPLUS_INCLUDE_PATH"))
-   #\:))
-  ":")
- "\nAM_CXXFLAGS = ")))
-   '())
- ;; Force rs6000 (i.e., powerpc) libdir to be /lib and not /lib64.
- (add-before 'chdir 'fix-rs6000-libdir
-   (lambda _
- (when (file-exists? "gcc/config/rs6000")
-   (substitute* (find-files "gcc/config/rs6000")
- (("/lib64") "/lib")
- (add-before 'configure 'chdir
-   (lambda _
- (chdir "libstdc++-v3"
-
-   #:configure-flags `("--disable-libstdcxx-pch"
-   ,(string-append "--with-gxx-include-dir="
-   (assoc-ref %outputs "out")
-   "/include"
+  #:phases
+  #~(modify-phases %standard-phases
+  #$@(if (and (target-ppc64le?)
+  (version>=? (package-version gcc) "11"))
+ #~((add-after 'unpack 'patch-foo
+  (lambda _
+(define patch
+  #$(local-file
+ (search-patch "foo.patch")))
+(peek "CWD" (getcwd))
+(invoke "patch" "--force" "-p1" "-i" patch
+  

bug#61879: Powerpc on core-updates

2023-04-13 Thread Andreas Enge
I may as well try to provide a patch. It is untested even on x86_64,
since it requires quite a few rebuilds. If it works on powerpc, it should
probably be made conditional on the architecture to avoid a world rebuild.
I do not know whether this is possible in the patches field in an origin.

Andreas

>From 5eb50bdc34759d4c917f2143e037fad62bc08ed7 Mon Sep 17 00:00:00 2001
From: Andreas Enge 
Date: Thu, 13 Apr 2023 11:46:47 +0200
Subject: [PATCH] gnu: gcc-11: Fix build on powerpc64le.

* gnu/packages/patches/gcc-11-libstdc++-powerpc.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register patch.
* gnu/packages/gcc.scm (gcc-11)[origin]: Use patch.
---
 gnu/local.mk   |  1 +
 gnu/packages/gcc.scm   |  5 +++--
 .../patches/gcc-11-libstdc++-powerpc.patch | 18 ++
 3 files changed, 22 insertions(+), 2 deletions(-)
 create mode 100644 gnu/packages/patches/gcc-11-libstdc++-powerpc.patch

diff --git a/gnu/local.mk b/gnu/local.mk
index b07811f1cb..1255846462 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1184,6 +1184,7 @@ dist_patch_DATA = 
\
   %D%/packages/patches/gcc-11-libstdc++-hurd-libpthread.patch   \
   %D%/packages/patches/gcc-12-cross-environment-variables.patch \
   %D%/packages/patches/gcc-10-tree-sra-union-handling.patch\
+  %D%/packages/patches/gcc-11-libstdc++-powerpc.patch   \
   %D%/packages/patches/gcolor3-update-libportal-usage.patch\
   %D%/packages/patches/gd-fix-tests-on-i686.patch  \
   %D%/packages/patches/gd-brect-bounds.patch   \
diff --git a/gnu/packages/gcc.scm b/gnu/packages/gcc.scm
index a511cdbc45..631e08db25 100644
--- a/gnu/packages/gcc.scm
+++ b/gnu/packages/gcc.scm
@@ -2,7 +2,7 @@
 ;;; Copyright © 2012-2023 Ludovic Courtès 
 ;;; Copyright © 2014, 2015, 2018 Mark H Weaver 
 ;;; Copyright © 2014, 2015, 2016, 2017, 2019, 2021 Ricardo Wurmus 

-;;; Copyright © 2015 Andreas Enge 
+;;; Copyright © 2015, 2023 Andreas Enge 
 ;;; Copyright © 2015-2018, 2020-2023 Efraim Flashner 
 ;;; Copyright © 2016 Carlos Sánchez de La Lama 
 ;;; Copyright © 2018 Tobias Geerinckx-Rice 
@@ -703,7 +703,8 @@ (define-public gcc-11
   "0fdclcwf728wbq52vphfcjywzhpsjp3kifzj3pib3xcihs0z4z5l"))
 (patches (search-patches "gcc-9-strmov-store-file-names.patch"
  "gcc-5.0-libvtv-runpath.patch"
- "gcc-10-tree-sra-union-handling.patch"))
+ "gcc-10-tree-sra-union-handling.patch"
+ "gcc-11-libstdc++-powerpc.patch"))
 (modules '((guix build utils)))
 (snippet gcc-canadian-cross-objdump-snippet)))
(arguments
diff --git a/gnu/packages/patches/gcc-11-libstdc++-powerpc.patch 
b/gnu/packages/patches/gcc-11-libstdc++-powerpc.patch
new file mode 100644
index 00..aff2ef16f1
--- /dev/null
+++ b/gnu/packages/patches/gcc-11-libstdc++-powerpc.patch
@@ -0,0 +1,18 @@
+diff -u -r gcc-11.3.0.alt/libstdc++-v3/src/c++17/floating_from_chars.cc 
gcc-11.3.0/libstdc++-v3/src/c++17/floating_from_chars.cc
+--- gcc-11.3.0.alt/libstdc++-v3/src/c++17/floating_from_chars.cc   
2023-04-13 11:36:08.169841428 +0200
 gcc-11.3.0/libstdc++-v3/src/c++17/floating_from_chars.cc   2023-04-13 
11:36:54.825827304 +0200
+@@ -495,8 +495,14 @@
+ from_chars(const char* first, const char* last, __ieee128& value,
+  chars_format fmt) noexcept
+ {
++#if _GLIBCXX_USE_CXX11_ABI
+   buffer_resource mr;
+   pmr::string buf();
++#else
++  string buf;
++  if (!reserve_string(buf))
++return make_result(first, 0, {}, ec);
++#endif
+   size_t len = 0;
+   errc ec = errc::invalid_argument;
+   __try
-- 
2.39.2



bug#61879: Powerpc on core-updates

2023-04-13 Thread Andreas Enge
Hello,

recently I claimed that powerpc was repaired, but I must have made a mistake.
It is still completely broken:
   https://ci.guix.gnu.org/eval/391720/dashboard?system=powerpc64le-linux
due to this:
   https://issues.guix.gnu.org/61879
 
It does not look easy to fix, but might be *the* blocker for a core-updates
merge...

The error is this:
../../../libstdc++-v3/src/c++17/floating_from_chars.cc: In function 
'std::from_chars_result std::from_chars(const char*, const char*, __ieee128&, 
std::chars_format)':
../../../libstdc++-v3/src/c++17/floating_from_chars.cc:499:8: error: 'string' 
is not a member of 'std::pmr'; did you mean 'std::string'?
  499 |   pmr::string buf();
  |^~
In file included from 
/tmp/guix-build-libstdc++-11.3.0.drv-0/gcc-11.3.0/build/include/string:39,
 from ../../../libstdc++-v3/src/c++17/floating_from_chars.cc:34:
/tmp/guix-build-libstdc++-11.3.0.drv-0/gcc-11.3.0/build/include/bits/stringfwd.h:79:33:
 note: 'std::string' declared here
   79 |   typedef basic_stringstring;
  | ^~
../../../libstdc++-v3/src/c++17/floating_from_chars.cc:504:55: error: 'buf' was 
not declared in this scope
  504 |   if (const char* pat = pattern(first, last, fmt, buf)) [[likely]]

In the file
   libstdc++-v3/src/c++17/floating_from_chars.cc
previous functions have code like this:
#if _GLIBCXX_USE_CXX11_ABI
  buffer_resource mr;
  pmr::string buf();
#else
  string buf;
  if (!reserve_string(buf))
return make_result(first, 0, {}, ec);
#endif

while here we only have:
  buffer_resource mr;
  pmr::string buf();

So my guess would be that we should simply replace this snippet with the
one above.

Could someone with access to a powerpc machine try out this change?

Andreas