From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 22BCB139694 for ; Sun, 23 Apr 2017 21:39:53 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 7BCF3E0D9E; Sun, 23 Apr 2017 21:39:52 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 4F0AEE0D9E for ; Sun, 23 Apr 2017 21:39:52 +0000 (UTC) Received: from oystercatcher.gentoo.org (unknown [IPv6:2a01:4f8:202:4333:225:90ff:fed9:fc84]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 143A833FE49 for ; Sun, 23 Apr 2017 21:39:51 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id AC4F5742C for ; Sun, 23 Apr 2017 21:39:49 +0000 (UTC) From: "Sergei Trofimovich" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sergei Trofimovich" Message-ID: <1492983561.3cf9beab238c015964bb1c8193d9a4394fce3a21.slyfox@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-lang/crystal/files/, dev-lang/crystal/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-lang/crystal/crystal-0.22.0.ebuild dev-lang/crystal/files/crystal-0.22.0-blocking-stdio-hack.patch dev-lang/crystal/metadata.xml X-VCS-Directories: dev-lang/crystal/ dev-lang/crystal/files/ X-VCS-Committer: slyfox X-VCS-Committer-Name: Sergei Trofimovich X-VCS-Revision: 3cf9beab238c015964bb1c8193d9a4394fce3a21 X-VCS-Branch: master Date: Sun, 23 Apr 2017 21:39:49 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Archives-Salt: 91770062-b5a1-4958-8453-22618d6c6536 X-Archives-Hash: d503253aa528c7e13b9f144e166f9046 commit: 3cf9beab238c015964bb1c8193d9a4394fce3a21 Author: Sergei Trofimovich gentoo org> AuthorDate: Sun Apr 23 21:39:02 2017 +0000 Commit: Sergei Trofimovich gentoo org> CommitDate: Sun Apr 23 21:39:21 2017 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3cf9beab dev-lang/crystal: Workaround tty corruption in crystal, bug #616256 Patch restores blocking mode of file desriptors in exchange of potential runtime deadlocks when dealing with stdio. As it's a potentially invasive patch it's not enabled by default and is available only under USE=blocking-stdio-hack Reported-by: Renich Bon Ciric Bug: https://github.com/crystal-lang/crystal/issues/2065 Bug: https://bugs.gentoo.org/616256 Package-Manager: Portage-2.3.5, Repoman-2.3.2 dev-lang/crystal/crystal-0.22.0.ebuild | 8 +++++++- .../files/crystal-0.22.0-blocking-stdio-hack.patch | 20 ++++++++++++++++++++ dev-lang/crystal/metadata.xml | 3 +++ 3 files changed, 30 insertions(+), 1 deletion(-) diff --git a/dev-lang/crystal/crystal-0.22.0.ebuild b/dev-lang/crystal/crystal-0.22.0.ebuild index 91cd89b0f5a..219789c6b1c 100644 --- a/dev-lang/crystal/crystal-0.22.0.ebuild +++ b/dev-lang/crystal/crystal-0.22.0.ebuild @@ -18,7 +18,7 @@ SRC_URI="https://github.com/crystal-lang/crystal/archive/${PV}.tar.gz -> ${P}.ta LICENSE="Apache-2.0" SLOT="0" KEYWORDS="~amd64" -IUSE="doc debug examples +xml +yaml" +IUSE="doc debug examples blocking-stdio-hack +xml +yaml" # dev-libs/boehm-gc[static-libs] dependency problem, check the issue: https://github.com/manastech/crystal/issues/1382 DEPEND=" @@ -41,6 +41,12 @@ PATCHES=( "${FILESDIR}"/${PN}-0.20.5-LDFLAGS.patch ) +src_prepare() { + default + + use blocking-stdio-hack && eapply "${FILESDIR}"/"${PN}"-0.22.0-blocking-stdio-hack.patch +} + src_compile() { emake \ $(usex debug "" release=1) \ diff --git a/dev-lang/crystal/files/crystal-0.22.0-blocking-stdio-hack.patch b/dev-lang/crystal/files/crystal-0.22.0-blocking-stdio-hack.patch new file mode 100644 index 00000000000..07b7dba7be6 --- /dev/null +++ b/dev-lang/crystal/files/crystal-0.22.0-blocking-stdio-hack.patch @@ -0,0 +1,20 @@ +Workaround tty corruption in crystal. + +Patch restores blocking mode of file desriptors +in exchange of potential runtime deadlocks +when dealing with stdio. + +Reported-by: Renich Bon Ciric +Bug: https://github.com/crystal-lang/crystal/issues/2065 +Bug: https://bugs.gentoo.org/616256 +diff --git a/src/compiler/crystal/stdio.cr b/src/compiler/crystal/stdio.cr +new file mode 100644 +index 000000000..e65f65089 +--- /dev/null ++++ b/src/compiler/crystal/stdio.cr +@@ -0,0 +1,5 @@ ++module Crystal ++ STDIN.blocking = true ++ STDOUT.blocking=true ++ STDERR.blocking = true ++end diff --git a/dev-lang/crystal/metadata.xml b/dev-lang/crystal/metadata.xml index 80b55be2293..8c0dacece65 100644 --- a/dev-lang/crystal/metadata.xml +++ b/dev-lang/crystal/metadata.xml @@ -22,6 +22,9 @@ Build each module as a separate object file. Speeds build up. + + Keep STDIO file descriptors in blocking mode. + Use the dev-libs/libyaml library to enable Crystal yaml module