From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 0MbLBhDF6V/lawAA0tVLHw (envelope-from ) for ; Mon, 28 Dec 2020 11:44:16 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id 4DXYAhDF6V83aQAA1q6Kng (envelope-from ) for ; Mon, 28 Dec 2020 11:44:16 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 312119403CD for ; Mon, 28 Dec 2020 11:44:10 +0000 (UTC) Received: from localhost ([::1]:44942 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ktqwb-0001GA-6e for larch@yhetil.org; Mon, 28 Dec 2020 06:44:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36638) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ktqwU-0001Fq-5d for bug-guix@gnu.org; Mon, 28 Dec 2020 06:44:02 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:51116) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ktqwT-0007d0-R6 for bug-guix@gnu.org; Mon, 28 Dec 2020 06:44:01 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ktqwT-000083-Oe for bug-guix@gnu.org; Mon, 28 Dec 2020 06:44:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#42771: smalltalk fails to build Resent-From: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 28 Dec 2020 11:44:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 42771 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: Ludovic =?UTF-8?Q?Court=C3=A8s?= Received: via spool by 42771-submit@debbugs.gnu.org id=B42771.1609155799433 (code B ref 42771); Mon, 28 Dec 2020 11:44:01 +0000 Received: (at 42771) by debbugs.gnu.org; 28 Dec 2020 11:43:19 +0000 Received: from localhost ([127.0.0.1]:34429 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ktqvf-00006o-QK for submit@debbugs.gnu.org; Mon, 28 Dec 2020 06:43:19 -0500 Received: from mail-wr1-f47.google.com ([209.85.221.47]:33052) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ktqvb-00006D-Gr for 42771@debbugs.gnu.org; Mon, 28 Dec 2020 06:43:10 -0500 Received: by mail-wr1-f47.google.com with SMTP id t30so11120418wrb.0 for <42771@debbugs.gnu.org>; Mon, 28 Dec 2020 03:43:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=G+6deA5gc/Hwuu6TOMi/OBGGtZxUwHSMIlbUwgZVOPg=; b=XlAWhhjQieIChGGJBWyj+KIW+lRcIwgmixgdB9F9uif3FjP+K68IQBktx22aJ8Xg9a C6+6BVcgfEB63MPz5Ki8h1ZIR/0ZA2j+3rWMBf1usp+cXO1v8kXJ+DxQ8v7MmN6Zvfe0 NxvL9ibXC+wSuh06+m27N3GscM+/mUVJM4Im1tYJK1gNqHkGk/AGadycmHeoaDXktZIk kmCn9p+AsDOav6joouW6XFwGSmaRJWDX0xchGxHe0pn7XZKBXsZN0rnXNe8OPbnNq2Eq EYptjLeXMnt8zH/kPCcT+CVtzrQtLGl5KDY8nP8REtimnqubmTA5NyCW6fcGZUMPQTAf WC0A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=G+6deA5gc/Hwuu6TOMi/OBGGtZxUwHSMIlbUwgZVOPg=; b=SlrA4vMh1zSk3akZ23WINNHIe49L3Exl+5m/Eksf39anEtv3zgWmAVZVVIB9NJ3N4K aX0xjn842by2gC7J9ghOwRXjn2qj0QOPEQoeLdFAHNOEAUFwSgtO8nFpGDwmLOBM+aqB k5JKHXp59NPdSzKnuuCwcqkdoHNuvpzoVCVOtukASWwVp6V3hTW3w6eV2oWXHW6961ok dTG0YCSVyE64QPCk+zSDVbSEjkXWsH88MjOLaWLkbCmV8IZa1GO2nluHOoGizwsY8jg9 WKeIPDZFbwG7TJeS6OsTRjNcLeqJe3OHAUXyOlddZHrEZY6yntPC4XULcw1A8yJ6FeE1 UOPg== X-Gm-Message-State: AOAM5301nKfwYvUBF3pv7zr2bL2IvGFljZcf8I4BteDyIcEa5Th2wsk0 g7n9idHF+YuCOEUFZDfkOEBw6ZFEXxI= X-Google-Smtp-Source: ABdhPJzP0SIniCyAUtUlgefL1z5qugL4oRim/tA71Nu4F/ceQPNkR1d0mrqrEsSXLJ4CYOp/0plBgA== X-Received: by 2002:a5d:6682:: with SMTP id l2mr50131497wru.213.1609155781570; Mon, 28 Dec 2020 03:43:01 -0800 (PST) Received: from unfall (36.193.158.146.dynamic.jazztel.es. [146.158.193.36]) by smtp.gmail.com with ESMTPSA id s20sm18428440wmj.46.2020.12.28.03.43.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 28 Dec 2020 03:43:00 -0800 (PST) From: Miguel =?UTF-8?Q?=C3=81ngel?= Arruga Vivas References: <87sgcxc6lh.fsf@rohleder.de> <20201129084328.545720-1-holger.peters@posteo.de> <87mtys72bw.fsf@gnu.org> Date: Mon, 28 Dec 2020 12:42:56 +0100 In-Reply-To: <87mtys72bw.fsf@gnu.org> ("Ludovic =?UTF-8?Q?Court=C3=A8s?="'s message of "Sat, 05 Dec 2020 15:30:11 +0100") Message-ID: <877dp240n3.fsf_-_@gmail.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.1 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Holger Peters , 42771@debbugs.gnu.org Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.22 Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=gmail.com header.s=20161025 header.b=XlAWhhjQ; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 312119403CD X-Spam-Score: -1.22 X-Migadu-Scanner: scn0.migadu.com X-TUID: Cg3O3zX7uNNU --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, I've been investigating just a bit about this. Ludovic Court=C3=A8s writes: > (1) investigate why the test is failing (I think it=E2=80=99s a single te= st > failure here), Currently there are two main problems with 3.2.5: - Integer multiplication overflow handling invokes undefined behavior, which is "cleaned up" by the compiler. This is why [ 100 fact / 99 fact ] returns 0, and it's solved with the first patch---trimmed down from the upstream patch, to avoid conflicts. - ANSI test suite fails with errors like these: ----------------------------------8<----------------------------------- --- /dev/null 2020-12-24 20:38:33.836725540 +0000 +++ /tmp/guix-build-smalltalk-3.2.5.drv-0/smalltalk-3.2.5/tests/testsuite.d= ir/at-groups/47/stderr 2020-12-28 09:25:57.283891452 +0000 @@ -0,0 +1,13 @@ +gst: Aborted +gst: Error occurred while not in byte code interpreter!! +/tmp/guix-build-smalltalk-3.2.5.drv-0/smalltalk-3.2.5/libgst/.libs/libgst.= so.7(+0x72d97)[0x7ffff7f5ed97] +/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib/libc.so.6(+0x36= b20)[0x7ffff7b3bb20] +/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib/libc.so.6(gsign= al+0xca)[0x7ffff7b3baba] +/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib/libc.so.6(abort= +0x165)[0x7ffff7b3cbf5] +/tmp/guix-build-smalltalk-3.2.5.drv-0/smalltalk-3.2.5/libgst/.libs/libgst.= so.7(+0x2c936)[0x7ffff7f18936] +/gnu/store/yrwirrblml57nwga1aza6rg3l9s8qga0-libsigsegv-2.12/lib/libsigsegv= .so.2(+0x128c)[0x7ffff7ee728c] +/gnu/store/fa6wj5bxkj5ll1d7292a70knmyl7a0cr-glibc-2.31/lib/libc.so.6(+0x36= b20)[0x7ffff7b3bb20] +/tmp/guix-build-smalltalk-3.2.5.drv-0/smalltalk-3.2.5/libgst/.libs/libgst.= so.7(+0x569f0)[0x7ffff7f429f0] +/tmp/guix-build-smalltalk-3.2.5.drv-0/smalltalk-3.2.5/libgst/.libs/libgst.= so.7(+0x72919)[0x7ffff7f5e919] +/tmp/guix-build-smalltalk-3.2.5.drv-0/smalltalk-3.2.5/libgst/.libs/libgst.= so.7(+0x2e4c7)[0x7ffff7f1a4c7] +/tmp/guix-build-smalltalk-3.2.5.drv-0/smalltalk-3.2.5/tests/testsuite.dir/= at-groups/47/test-source: line 20: 21205 Aborted $TIMEOUT g= st $image_path -f $abs_srcdir/AnsiRun.st ArrayANSITest stdout: ./testsuite.at:83: exit code was 134, expected 0 47. testsuite.at:83: 47. ArrayANSITest (testsuite.at:83): FAILED (testsuite= .at:83) ---------------------------------->8----------------------------------- > (2) try to determine whether it=E2=80=99s serious or not, The first one is pretty serious. The second one might as bad as the first one or may be a flaw on the tests and could be omitted. > (3) see if we can work around it with reasonable effort, and if > not, skip just this test. This only should be the case when the problem is on the test side: either it's using something we don't want to provide, as side channels, or the check itself is buggy; never when the test is working properly because we would be delivering buggy software after we have been warned about it. I cannot spot where the second error was fixed, but 3.2.91 as provided with the second patch doesn't manifest it. > 2. I think we should just have =E2=80=98smalltalk=E2=80=99 (latest rele= ase) and > =E2=80=98smalltalk-next=E2=80=99 (VCS snapshot). Having an extra pa= ckage for the > release candidate is not really useful IMO, and not something we > generally do. The last change made to GNU Smalltalk's master branch was more than 2 years ago, the latest change affecting executable paths was February 2017. IMHO, providing a patched release candidate (or even the snapshot) seems the best option until the project release a new version, as in fact we aren't providing currently a useful package. Happy hacking! Miguel PS: Its build isn't reproducible: - gst.im has inside some kind of timestamp. This probably needs changes on the source code. - package.xml and kernel/ folders contain different timestamps inside dot-star files---a wrapper to zip or something like reset-gzip-timestamps could solve this issue. --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-gnu-smalltalk-Fix-integer-multiplication-overflow.patch Content-Description: fix-integer.patch >From c4385abde62bba4c634a7a874c2f431451909ec2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= Date: Mon, 28 Dec 2020 10:36:48 +0100 Subject: [PATCH 1/2] gnu: smalltalk: Fix integer multiplication overflow. * gnu/packages/patches/smalltalk-multiplication-overflow.patch: Patch from upstream commit 72ada189aba0283c551ead16635c1983968080b8. * gnu/packages/smalltalk.scm (smalltalk): Use patch and link with gmp and lightning libraries instead of the included source. --- .../smalltalk-multiplication-overflow.patch | 121 ++++++++++++++++++ gnu/packages/smalltalk.scm | 43 ++++++- 2 files changed, 159 insertions(+), 5 deletions(-) create mode 100644 gnu/packages/patches/smalltalk-multiplication-overflow.patch diff --git a/gnu/packages/patches/smalltalk-multiplication-overflow.patch b/gnu/packages/patches/smalltalk-multiplication-overflow.patch new file mode 100644 index 0000000000..7a0b4d02f7 --- /dev/null +++ b/gnu/packages/patches/smalltalk-multiplication-overflow.patch @@ -0,0 +1,121 @@ +Extracted from this commit without the ChangeLog to avoid conflicts: +http://git.savannah.gnu.org/cgit/smalltalk.git/commit/?id=72ada189aba0283c551ead16635c1983968080b8 + +The upstream commit message is +From 72ada189aba0283c551ead16635c1983968080b8 Mon Sep 17 00:00:00 2001 +From: Holger Hans Peter Freyther +Date: Sat, 7 Nov 2015 18:09:31 +0100 +Subject: libgst: Add alternative multiplication overflow check + +Apple clang on OSX and the version on FreeBSD optimize the +multiplication check away. Clang introduced a family of +builtins to do the multiplication and check for the overflow +and GCC made the API usable. For clang we would need to know +if intptr_t is of type int, long int, long long int and +then use the smul, smull smulll. +Luckily clang is adopting the better interface and this is +what we are starting to use now. This means the new code +will be used on GCC5 (and later) and some future versions of +clang. + +2015-11-07 Holger Hans Peter Freyther + + * build-aux/overflow-builtins.m4: Add new macro. + * configure.ac: Use GST_C_OVERFLOW_BUILTINS macro. + +2015-11-07 Holger Hans Peter Freyther + + * interp.inl: Add alternative mul_with_check implementation. +--- + ChangeLog | 5 +++++ + build-aux/overflow-builtins.m4 | 23 +++++++++++++++++++++++ + configure.ac | 1 + + libgst/ChangeLog | 4 ++++ + libgst/interp.inl | 22 ++++++++++++++++++++++ + 5 files changed, 55 insertions(+) + create mode 100644 build-aux/overflow-builtins.m4 + +diff --git a/build-aux/overflow-builtins.m4 b/build-aux/overflow-builtins.m4 +new file mode 100644 +index 00000000..9d050196 +--- /dev/null ++++ b/build-aux/overflow-builtins.m4 +@@ -0,0 +1,23 @@ ++dnl Check whether the host supports synchronization builtins. ++ ++AC_DEFUN([GST_C_OVERFLOW_BUILTINS], [ ++ AC_REQUIRE([AC_CANONICAL_HOST]) ++ AC_CACHE_CHECK([whether the host supports __builtin_mul_overflow], ++ gst_cv_have_builtin_mul_overflow, [ ++ save_CFLAGS="$CFLAGS" ++ case $host in ++ i?86-apple-darwin*) ;; ++ i?86-*-*) CFLAGS="$CFLAGS -march=i486" ;; ++ esac ++ AC_LINK_IFELSE([AC_LANG_PROGRAM([[int foovar = 0;]], [[ ++if (__builtin_mul_overflow(44444, 55555, &foovar)) ++ return 23;]])], ++ [gst_cv_have_builtin_mul_overflow=yes], ++ [gst_cv_have_builtin_mul_overflow=no]) ++ CFLAGS="$save_CFLAGS" ++ ]) ++ if test $gst_cv_have_builtin_mul_overflow = yes; then ++ AC_DEFINE(HAVE_OVERFLOW_BUILTINS, 1, ++ [Define to 1 if the host supports __builtin_*_overflow builtins]) ++ fi ++]) +diff --git a/configure.ac b/configure.ac +index e789be45..0bac23ef 100644 +--- a/configure.ac ++++ b/configure.ac +@@ -243,6 +243,7 @@ GST_C_SYNC_BUILTINS + if test $gst_cv_have_sync_fetch_and_add = no; then + AC_MSG_ERROR([Synchronization primitives not found, please use a newer compiler.]) + fi ++GST_C_OVERFLOW_BUILTINS + + GST_LOCK + AC_SYS_LARGEFILE +diff --git a/libgst/interp.inl b/libgst/interp.inl +index e18e27c7..dbc631bc 100644 +--- a/libgst/interp.inl ++++ b/libgst/interp.inl +@@ -159,6 +159,27 @@ sub_with_check (OOP op1, OOP op2, mst_Boolean *overflow) + OOP + mul_with_check (OOP op1, OOP op2, mst_Boolean *overflow) + { ++#ifdef HAVE_OVERFLOW_BUILTINS ++ intptr_t a = TO_INT (op1); ++ intptr_t b = TO_INT (op2); ++ intptr_t result; ++ ++ if (__builtin_mul_overflow(a, b, &result)) ++ { ++ *overflow = true; ++ return FROM_INT(0); ++ } ++ ++ ++ if (result < MIN_ST_INT || result > MAX_ST_INT) ++ { ++ *overflow = true; ++ return FROM_INT(0); ++ } ++ ++ *overflow = false; ++ return FROM_INT(result); ++#else + intptr_t a = TO_INT (op1); + intptr_t b = TO_INT (op2); + intmax_t result = (intmax_t)a * b; +@@ -188,6 +209,7 @@ mul_with_check (OOP op1, OOP op2, mst_Boolean *overflow) + } + + return FROM_INT (0); ++#endif + } + + /* State of the random generator. +-- +2.29.2 + diff --git a/gnu/packages/smalltalk.scm b/gnu/packages/smalltalk.scm index 5d35f563e2..8c152cfd04 100644 --- a/gnu/packages/smalltalk.scm +++ b/gnu/packages/smalltalk.scm @@ -26,6 +26,8 @@ #:use-module (guix download) #:use-module (guix build-system cmake) #:use-module (guix build-system gnu) + #:use-module (gnu packages) + #:use-module (gnu packages assembly) #:use-module (gnu packages audio) #:use-module (gnu packages autotools) #:use-module (gnu packages base) @@ -36,6 +38,7 @@ #:use-module (gnu packages libffi) #:use-module (gnu packages libsigsegv) #:use-module (gnu packages linux) + #:use-module (gnu packages multiprecision) #:use-module (gnu packages pkg-config) #:use-module (gnu packages pulseaudio) #:use-module (gnu packages xorg)) @@ -51,18 +54,48 @@ version ".tar.xz")) (sha256 (base32 - "1k2ssrapfzhngc7bg1zrnd9n2vyxp9c9m70byvsma6wapbvib6l1")))) + "1k2ssrapfzhngc7bg1zrnd9n2vyxp9c9m70byvsma6wapbvib6l1")) + ;; XXX: To be removed with the next release of Smalltalk. + (patches (search-patches "smalltalk-multiplication-overflow.patch")))) (build-system gnu-build-system) (native-inputs - `(("libffi" ,libffi) + `(("pkg-config" ,pkg-config) + ;; XXX: To be removed with the next release of Smalltalk. + ("autoconf" ,autoconf) + ("automake" ,automake) + ("libtool" ,libtool))) + ;; XXX: Missing optional dependencies: + ;; - glib + ;; - gtk+-2 + ;; - mesa + ;; - SDL + ;; - sqlite + ;; - zlib + (inputs + `(("gmp" ,gmp) + ("libffi" ,libffi) ("libltdl" ,libltdl) ("libsigsegv" ,libsigsegv) - ("pkg-config" ,pkg-config))) - (inputs - `(("zip" ,zip))) + ("lightning" ,lightning) + ("zip" ,zip))) (arguments `(#:phases (modify-phases %standard-phases + ;; XXX: To be removed with the next release of Smalltalk. + ;; The overflow patch modifies configure.ac, therefore remove + ;; old configure script and enforce an autoreconf. + (add-before 'bootstrap 'remove-unpatched-configure + (lambda _ + (delete-file "configure") + #t)) + ;; XXX: To be removed with the next release of Smalltalk. + ;; We don't want to regenerate the info files. + (add-after 'build 'keep-generated-info-manual + (lambda _ + (for-each (lambda (file) + (invoke "touch" file)) + (find-files "doc" "\\.info")) + #t)) (add-before 'configure 'fix-libc (lambda _ (let ((libc (assoc-ref %build-inputs "libc"))) -- 2.29.2 --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0002-gnu-smalltalk-Update-to-version-3.2.91.patch Content-Description: update-to-91.patch >From 46809e6c265280571ff024c749c448c74af79c1a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel=20Arruga=20Vivas?= Date: Mon, 28 Dec 2020 11:42:31 +0100 Subject: [PATCH 2/2] gnu: smalltalk: Update to version 3.2.91. * gnu/packages/smalltalk.scm (smalltalk): Update to 3.2.91. Co-Authored-By: Holger Peters --- gnu/packages/smalltalk.scm | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gnu/packages/smalltalk.scm b/gnu/packages/smalltalk.scm index 8c152cfd04..c7c56f87b4 100644 --- a/gnu/packages/smalltalk.scm +++ b/gnu/packages/smalltalk.scm @@ -46,15 +46,15 @@ (define-public smalltalk (package (name "smalltalk") - (version "3.2.5") + (version "3.2.91") (source (origin (method url-fetch) - (uri (string-append "mirror://gnu/smalltalk/smalltalk-" + (uri (string-append "https://alpha.gnu.org/gnu/smalltalk/smalltalk-" version ".tar.xz")) (sha256 (base32 - "1k2ssrapfzhngc7bg1zrnd9n2vyxp9c9m70byvsma6wapbvib6l1")) + "1zb2h5cbz1cwybqjl24lflw359lwj7sjvvhwb4x6miypzhwq4qh0")) ;; XXX: To be removed with the next release of Smalltalk. (patches (search-patches "smalltalk-multiplication-overflow.patch")))) (build-system gnu-build-system) -- 2.29.2 --=-=-=--