From patchwork Thu Jan 17 01:29:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?SZEDER_G=C3=A1bor?= X-Patchwork-Id: 10767411 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 555A6139A for ; Thu, 17 Jan 2019 01:29:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 459652F95B for ; Thu, 17 Jan 2019 01:29:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A05A2F97C; Thu, 17 Jan 2019 01:29:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A39D2F983 for ; Thu, 17 Jan 2019 01:29:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727781AbfAQB3g (ORCPT ); Wed, 16 Jan 2019 20:29:36 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:33006 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727769AbfAQB3f (ORCPT ); Wed, 16 Jan 2019 20:29:35 -0500 Received: by mail-wr1-f67.google.com with SMTP id c14so9196007wrr.0 for ; Wed, 16 Jan 2019 17:29:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EaiOYU72uZSTowXDr/hjfGhGERRgKpNTraCkGbK2wnA=; b=KUeoay7kMzUL5gagT8cVp/DI7ldePJy1dIHi1/Uft5DxSN5pBqjo3hUMHF99wyQTro dJpxOyrjaTt2hjDrf5R2nCyQmwqil/SnsjIQyiWPJP9xLkPrjT4atU061jqgT2pKv06V mWynOCURmf4chKiD4k3N7seDZPdcqfFccySBj3VncrOC/e5wATy0MzaqP4DYG61nOMSQ NDk7GDkpcmDEyVyjzFdiCFxuMDTmd8lGTf/IcO7Un3iI3XlMkr4057KP/AVfbOTxEpf1 ZUgxdfC3tRGX97Rd1qcU7UQutqcV3n3obL7rAYPBGbXKfSbiRBaH+xp3BT4POWpgN38B cV5A== 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:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EaiOYU72uZSTowXDr/hjfGhGERRgKpNTraCkGbK2wnA=; b=h8+i2pFoLoaKTKC8ACCJ+rCOMr4M0kYKOe7wROu3MuPnQlYz3DGkL106XJJHcpoA17 OO0Ny3P52oDUDIzin6e6zJ0I7S4Q8rVflm348XS5wL5biwBpN9tcVksvHYjtARBzWCxJ LKzf+j+LqGXQ1wzGECISMc9tr1spC702ezf7S8727eMe4yYkSZB0e3+YN8lXnPIOq6Db hQ+zFnf01dDWDS4ksIUVwndM20tPmwZkafq2U5x5nVDYGiNqpK74yY5EuyDmZR6ZZMTp xz3XHxY15eLUOclp9Dfm/cahJNl51lChHqF/RJ+rrsofbuCvMJyAN5Eau3BDee7KQ0wX +aIA== X-Gm-Message-State: AJcUukeKgyKwjbC1y56It9C0v2w4ECDRqzcFRsi1rHiGznLW0ohiVMAb Lf74EXye1xKkGtIdJoho04k= X-Google-Smtp-Source: ALg8bN73Aa0Ea2RJpHRAsRbtfOHCPvam3MK6+sO9889QBARfoLu0/O3xULgRu5hWVfOQv2wu8dExGQ== X-Received: by 2002:adf:dfd1:: with SMTP id q17mr10246616wrn.27.1547688573404; Wed, 16 Jan 2019 17:29:33 -0800 (PST) Received: from localhost.localdomain (x4db4a994.dyn.telefonica.de. [77.180.169.148]) by smtp.gmail.com with ESMTPSA id y13sm36818272wme.2.2019.01.16.17.29.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Jan 2019 17:29:32 -0800 (PST) From: =?utf-8?q?SZEDER_G=C3=A1bor?= To: Junio C Hamano Cc: Jonathan Nieder , Johannes Schindelin , =?utf-8?b?w4Z2YXIgQXJu?= =?utf-8?b?ZmrDtnLDsCBCamFybWFzb24=?= , git@vger.kernel.org, =?utf-8?q?SZEDER_G=C3=A1bor?= Subject: [PATCH v2 1/5] compat/obstack: fix -Wcast-function-type warnings Date: Thu, 17 Jan 2019 02:29:09 +0100 Message-Id: <20190117012913.30562-2-szeder.dev@gmail.com> X-Mailer: git-send-email 2.20.1.499.gf60de1223c In-Reply-To: <20190117012913.30562-1-szeder.dev@gmail.com> References: <20181220162452.17732-1-szeder.dev@gmail.com> <20190117012913.30562-1-szeder.dev@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP GCC 8 introduced the new -Wcast-function-type warning, which is implied by -Wextra (which, in turn is enabled in our DEVELOPER flags). When building Git with GCC 8 and this warning enabled on a non-glibc platform [1], one is greeted with a screenful of compiler warnings/errors: compat/obstack.c: In function '_obstack_begin': compat/obstack.c:162:17: error: cast between incompatible function types from 'void * (*)(long int)' to 'struct _obstack_chunk * (*)(void *, long int)' [-Werror=cast-function-type] h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun; ^ compat/obstack.c:163:16: error: cast between incompatible function types from 'void (*)(void *)' to 'void (*)(void *, struct _obstack_chunk *)' [-Werror=cast-function-type] h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun; ^ compat/obstack.c:116:8: error: cast between incompatible function types from 'struct _obstack_chunk * (*)(void *, long int)' to 'struct _obstack_chunk * (*)(long int)' [-Werror=cast-function-type] : (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size))) ^ compat/obstack.c:168:22: note: in expansion of macro 'CALL_CHUNKFUN' chunk = h->chunk = CALL_CHUNKFUN (h, h -> chunk_size); ^~~~~~~~~~~~~ 'struct obstack' stores pointers to two functions to allocate and free "chunks", and depending on how obstack is used, these functions take either one parameter (like standard malloc() and free() do; this is how we use it in 'kwset.c') or two parameters. Presumably to reduce memory footprint, a single field is used to store the function pointer for both signatures, and then it's casted to the appropriate signature when the function pointer is accessed. These casts between function pointers with different number of parameters are what trigger those compiler errors. Modify 'struct obstack' to use unions to store function pointers with different signatures, and then use the union member with the appropriate signature when accessing these function pointers. This eliminates the need for those casts, and thus avoids this compiler error. [1] Compiling 'compat/obstack.c' on a platform with glibc is sort of a noop, see the comment before '# define ELIDE_CODE', so this is not an issue on common Linux distros. Signed-off-by: SZEDER Gábor --- compat/obstack.c | 17 +++++++++-------- compat/obstack.h | 18 +++++++++++------- 2 files changed, 20 insertions(+), 15 deletions(-) diff --git a/compat/obstack.c b/compat/obstack.c index 4d1d95beeb..27cd5c1ea1 100644 --- a/compat/obstack.c +++ b/compat/obstack.c @@ -112,15 +112,15 @@ compat_symbol (libc, _obstack_compat, _obstack, GLIBC_2_0); # define CALL_CHUNKFUN(h, size) \ (((h) -> use_extra_arg) \ - ? (*(h)->chunkfun) ((h)->extra_arg, (size)) \ - : (*(struct _obstack_chunk *(*) (long)) (h)->chunkfun) ((size))) + ? (*(h)->chunkfun.extra) ((h)->extra_arg, (size)) \ + : (*(h)->chunkfun.plain) ((size))) # define CALL_FREEFUN(h, old_chunk) \ do { \ if ((h) -> use_extra_arg) \ - (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \ + (*(h)->freefun.extra) ((h)->extra_arg, (old_chunk)); \ else \ - (*(void (*) (void *)) (h)->freefun) ((old_chunk)); \ + (*(h)->freefun.plain) ((old_chunk)); \ } while (0) @@ -159,8 +159,8 @@ _obstack_begin (struct obstack *h, size = 4096 - extra; } - h->chunkfun = (struct _obstack_chunk * (*)(void *, long)) chunkfun; - h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun; + h->chunkfun.plain = chunkfun; + h->freefun.plain = freefun; h->chunk_size = size; h->alignment_mask = alignment - 1; h->use_extra_arg = 0; @@ -206,8 +206,9 @@ _obstack_begin_1 (struct obstack *h, int size, int alignment, size = 4096 - extra; } - h->chunkfun = (struct _obstack_chunk * (*)(void *,long)) chunkfun; - h->freefun = (void (*) (void *, struct _obstack_chunk *)) freefun; + h->chunkfun.extra = (struct _obstack_chunk * (*)(void *,long)) chunkfun; + h->freefun.extra = (void (*) (void *, struct _obstack_chunk *)) freefun; + h->chunk_size = size; h->alignment_mask = alignment - 1; h->extra_arg = arg; diff --git a/compat/obstack.h b/compat/obstack.h index 6bc24b7644..ced94d0118 100644 --- a/compat/obstack.h +++ b/compat/obstack.h @@ -160,11 +160,15 @@ struct obstack /* control current object in current chunk */ void *tempptr; } temp; /* Temporary for some macros. */ int alignment_mask; /* Mask of alignment for each object. */ - /* These prototypes vary based on `use_extra_arg', and we use - casts to the prototypeless function type in all assignments, - but having prototypes here quiets -Wstrict-prototypes. */ - struct _obstack_chunk *(*chunkfun) (void *, long); - void (*freefun) (void *, struct _obstack_chunk *); + /* These prototypes vary based on `use_extra_arg'. */ + union { + void *(*plain) (long); + struct _obstack_chunk *(*extra) (void *, long); + } chunkfun; + union { + void (*plain) (void *); + void (*extra) (void *, struct _obstack_chunk *); + } freefun; void *extra_arg; /* first arg for chunk alloc/dealloc funcs */ unsigned use_extra_arg:1; /* chunk alloc/dealloc funcs take extra arg */ unsigned maybe_empty_object:1;/* There is a possibility that the current @@ -235,10 +239,10 @@ extern void (*obstack_alloc_failed_handler) (void); (void (*) (void *, void *)) (freefun), (arg)) #define obstack_chunkfun(h, newchunkfun) \ - ((h) -> chunkfun = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun)) + ((h)->chunkfun.extra = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun)) #define obstack_freefun(h, newfreefun) \ - ((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun)) + ((h)->freefun.extra = (void (*)(void *, struct _obstack_chunk *)) (newfreefun)) #define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = (achar)) From patchwork Thu Jan 17 01:29:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?SZEDER_G=C3=A1bor?= X-Patchwork-Id: 10767415 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A7D30139A for ; Thu, 17 Jan 2019 01:29:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9819D2F00F for ; Thu, 17 Jan 2019 01:29:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8C4142F821; Thu, 17 Jan 2019 01:29:39 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2B7C32F00F for ; Thu, 17 Jan 2019 01:29:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727795AbfAQB3h (ORCPT ); Wed, 16 Jan 2019 20:29:37 -0500 Received: from mail-wr1-f46.google.com ([209.85.221.46]:32928 "EHLO mail-wr1-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727767AbfAQB3g (ORCPT ); Wed, 16 Jan 2019 20:29:36 -0500 Received: by mail-wr1-f46.google.com with SMTP id c14so9196034wrr.0 for ; Wed, 16 Jan 2019 17:29:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=OwGYCAcnJzEMEfQB+b08TkADzSse7zDZxY/GEE+a5OA=; b=Y72S9Ks5gYRyMA21l4GPVunqa81WoT1OiabsdzPsg+YG+sIpc2FQnNtnPw0lQSNPjc sYDdygEzsFPkv24ACLpxMxevDLJbeMX/RXhLSGM7t89UnlTNsZ0SLHKRJcjy3JTgrwHD 7Qs24gK/SorF4Xm8mvsa/y4qXF0QgvWjjvcE0Id+KajGgR21OlyEK/maweXReUzjp0Tk 0+rBRhrafrzedHucjfhAMBTX6YicgcWPssQi2YMiYkID4sLO/Vrim88V0ccxws+NpsAr 8KUJ3P9eei7AEMGl0ATyZoODmBgRHei7M6MVMS8ftj0LChmtxir6kdSRQCJ1tYmaVyRJ anuQ== 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:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=OwGYCAcnJzEMEfQB+b08TkADzSse7zDZxY/GEE+a5OA=; b=q9lPlXbjxowfmWD5avlBgw3BoTf4DgT+wAPnonKhMB+nG5A3xLG4MPu3jcHZ5P20yW FwuBHPN3pxBzDQD/0diqPDCh+ugtaKEca3sGCftpnfUl3xtdlBp4VSIC9SOO3w9qdUC9 Aa51v+F2Fx9al4ldOrqVaTL3xfHa9j/LkNY2xGoyqdx9AKhRE91hkxGq53gbLw11r5SH w9UP8IfpN3Z6ETZUXxaK6Xu/TuJfL6AHNvfci6zsLxL2Iu/uZLF0mttl3JfC7MP8WKtN r8zMOpm29nhAhm2ttkyJTZ7HQvTXJQDqV6x+xfT1J9nt8yj7xHpSGoZe0LVZ0GAHfr0r SFZA== X-Gm-Message-State: AJcUukfbNp9iLx6UPVH6ZGPv/8M5yB+SimbwNpObvrykqK0k/hFs1BeY ZYlWVsDkgUEAgRYA59MCNPI= X-Google-Smtp-Source: ALg8bN6i1HVSWmoTYnrt+GhABBQX8fOJbYvDvaSnpDPs1Tsq4fxc4kvraOlOLn9octRmUxP7N/L0Rw== X-Received: by 2002:a5d:494a:: with SMTP id r10mr10062954wrs.272.1547688574874; Wed, 16 Jan 2019 17:29:34 -0800 (PST) Received: from localhost.localdomain (x4db4a994.dyn.telefonica.de. [77.180.169.148]) by smtp.gmail.com with ESMTPSA id y13sm36818272wme.2.2019.01.16.17.29.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Jan 2019 17:29:34 -0800 (PST) From: =?utf-8?q?SZEDER_G=C3=A1bor?= To: Junio C Hamano Cc: Jonathan Nieder , Johannes Schindelin , =?utf-8?b?w4Z2YXIgQXJu?= =?utf-8?b?ZmrDtnLDsCBCamFybWFzb24=?= , git@vger.kernel.org, =?utf-8?q?SZEDER_G=C3=A1bor?= Subject: [PATCH v2 2/5] .gitignore: ignore external debug symbols from GCC on macOS Date: Thu, 17 Jan 2019 02:29:10 +0100 Message-Id: <20190117012913.30562-3-szeder.dev@gmail.com> X-Mailer: git-send-email 2.20.1.499.gf60de1223c In-Reply-To: <20190117012913.30562-1-szeder.dev@gmail.com> References: <20181220162452.17732-1-szeder.dev@gmail.com> <20190117012913.30562-1-szeder.dev@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When Git is build with a "real" GCC on macOS [1], or at least with GCC installed via Homebrew, and CFLAGS includes the '-g' option (and our default CFLAGS does), then by default GCC writes the debug symbols into external files under '.dSYM/' directories (e.g. 'git-daemon.dSYM/', 'git.dSYM/', etc.). Update '.gitignore' to ignore these directories, so they don't clutter the output of 'git status'. Furthermore, these build artifacts then won't trigger build failures on Travis CI via b92cb86ea1 (travis-ci: check that all build artifacts are .gitignore-d, 2017-12-31) once one of the following patches updates our CI build scripts to use a real GCC in the 'osx-gcc' build job. [1] On macOS the default '/usr/bin/gcc' executable is not a real GCC, but merely a compatibility wrapper around Clang: $ gcc --version Configured with: --prefix=<...> Apple LLVM version 9.0.0 (clang-900.0.39.2) <...> So even though 'make CC=gcc' does indeed execute a command called 'gcc', in the end Git will be built with Clang all the same. Signed-off-by: SZEDER Gábor --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 0d77ea5894..a9db568712 100644 --- a/.gitignore +++ b/.gitignore @@ -229,3 +229,4 @@ *.pdb /Debug/ /Release/ +*.dSYM From patchwork Thu Jan 17 01:29:11 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?SZEDER_G=C3=A1bor?= X-Patchwork-Id: 10767417 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6F9E81390 for ; Thu, 17 Jan 2019 01:29:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 60FC42E9F8 for ; Thu, 17 Jan 2019 01:29:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 547742F082; Thu, 17 Jan 2019 01:29:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E69B92E9F8 for ; Thu, 17 Jan 2019 01:29:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727804AbfAQB3j (ORCPT ); Wed, 16 Jan 2019 20:29:39 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:44088 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727769AbfAQB3i (ORCPT ); Wed, 16 Jan 2019 20:29:38 -0500 Received: by mail-wr1-f65.google.com with SMTP id z5so9096564wrt.11 for ; Wed, 16 Jan 2019 17:29:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+g2oBEcUHs+0KUfZAgVLsOvTutfVQa6XgDuI1VOD/e4=; b=K2o9/pAGRoFB9xpqcTeCNNispF6o3YdYXWqRN6wV38NhP9Is9PHC79sQ7k78pgxTD0 H/Ho3Uy1GM4QmtFMEcVKJZRejitE3/Y1vfgfrL8Mrg00/D5fjReXvY7iav+D6lszsnx/ cHO7Yl+wXkPTri/fz2a1+eVkGuJrslr3CgKy64awuIpZD4zNfPKjIc+XFPdw/PzVhbgJ shUh/cjcWgKe14kBs1UOdNSbqZePyWdy8Z4niI6Tdc85Kt5PhewhEjvdZyAME6HwQzHx HOu3wxyN2DKlAzdzbpzW1i9d1mNwFoIEnC/bQNK6xNMOAlBImc4f3GuNdEFQuwOco97i 8onQ== 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:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+g2oBEcUHs+0KUfZAgVLsOvTutfVQa6XgDuI1VOD/e4=; b=JNdvZQQgt3cgWmmG4YG0KBdlUiVCeRABptob4KvjKHq4jX1Gw/dCVncgXd6OPCnli3 Y9RxWy8hsCk/Tet51VutxsiNx8Y07Ig+owMM3Z/k4zYKF42BmzTMp05xPpLGvmnd7iM2 Xd2plkI42LhL/s9YKCoJW/N1h8Rvh/ru9EAOxUOQ6kg5JiAmefqeX7QIwakzoc/jIlqg XaYm4tWlEzWPLKuFMk31+Gu/b2URcyIb8HBFUvGOM9dTlndJLO8vb3pyM8piPzJhy3l4 47xusarOvd+hD8ULczqNCnLx8gyOckWf4+zQk6IoqpLHC99CFrKztu3htCweJT9e1BlN Sfew== X-Gm-Message-State: AJcUukd4cAC9wfSfYB/17f/WKZxOPzQ0Yynmft/8Cbd4fkI6Uv+wMvRw qO20U0pRA5fBMYuRMPPI2tI= X-Google-Smtp-Source: ALg8bN4P71r1aiQ2MCCgpdtztQvcIbY7Ih8u6JhytJsZiAtrt7jg9ZzyCiJKK89zH0thXmtQ/9Yw+A== X-Received: by 2002:a5d:4250:: with SMTP id s16mr9833581wrr.253.1547688576053; Wed, 16 Jan 2019 17:29:36 -0800 (PST) Received: from localhost.localdomain (x4db4a994.dyn.telefonica.de. [77.180.169.148]) by smtp.gmail.com with ESMTPSA id y13sm36818272wme.2.2019.01.16.17.29.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Jan 2019 17:29:35 -0800 (PST) From: =?utf-8?q?SZEDER_G=C3=A1bor?= To: Junio C Hamano Cc: Jonathan Nieder , Johannes Schindelin , =?utf-8?b?w4Z2YXIgQXJu?= =?utf-8?b?ZmrDtnLDsCBCamFybWFzb24=?= , git@vger.kernel.org, =?utf-8?q?SZEDER_G=C3=A1bor?= Subject: [PATCH v2 3/5] travis-ci: don't be '--quiet' when running the tests Date: Thu, 17 Jan 2019 02:29:11 +0100 Message-Id: <20190117012913.30562-4-szeder.dev@gmail.com> X-Mailer: git-send-email 2.20.1.499.gf60de1223c In-Reply-To: <20190117012913.30562-1-szeder.dev@gmail.com> References: <20181220162452.17732-1-szeder.dev@gmail.com> <20190117012913.30562-1-szeder.dev@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP All Travis CI build jobs run the test suite with 'make --quiet test'. On one hand, being quiet doesn't save us from much clutter in the output: $ make test |wc -l 861 $ make --quiet test |wc -l 848 It only spares 13 lines, mostly the output of entering the 't/' directory and the pre- and post-cleanup commands, which is negligible compared to the ~700 lines printed while building Git and the ~850 lines of 'prove' output. On the other hand, it's asking for trouble. In our CI build scripts we build Git and run the test suite in two separate 'make' invocations. In a prelimiary version of one of the later patches in this series, to explicitly specify which compiler to use, I changed them to basically run: make CC=$CC make --quiet test naively thinking that it should Just Work... but then that 'make --quiet test' got all clever on me, noticed the changed build flags, and then proceeded to rebuild everything with the default 'cc'. And because of that '--quiet' option, it did so, well, quietly, only saying "* new build flags", and it was by mere luck that I happened to notice that something is amiss. Let's just drop that '--quiet' option when running the test suite in all build scripts. Signed-off-by: SZEDER Gábor --- ci/run-build-and-tests.sh | 4 ++-- ci/run-linux32-build.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/run-build-and-tests.sh b/ci/run-build-and-tests.sh index cda170d5c2..84431c097e 100755 --- a/ci/run-build-and-tests.sh +++ b/ci/run-build-and-tests.sh @@ -8,7 +8,7 @@ ln -s "$cache_dir/.prove" t/.prove make --jobs=2 -make --quiet test +make test if test "$jobname" = "linux-gcc" then export GIT_TEST_SPLIT_INDEX=yes @@ -17,7 +17,7 @@ then export GIT_TEST_OE_DELTA_SIZE=5 export GIT_TEST_COMMIT_GRAPH=1 export GIT_TEST_MULTI_PACK_INDEX=1 - make --quiet test + make test fi check_unignored_build_artifacts diff --git a/ci/run-linux32-build.sh b/ci/run-linux32-build.sh index 2c60d2e70a..26c168a016 100755 --- a/ci/run-linux32-build.sh +++ b/ci/run-linux32-build.sh @@ -56,5 +56,5 @@ linux32 --32bit i386 su -m -l $CI_USER -c ' cd /usr/src/git test -n "$cache_dir" && ln -s "$cache_dir/.prove" t/.prove make --jobs=2 - make --quiet test + make test ' From patchwork Thu Jan 17 01:29:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?SZEDER_G=C3=A1bor?= X-Patchwork-Id: 10767419 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5E3831390 for ; Thu, 17 Jan 2019 01:29:43 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4EDB82E9F8 for ; Thu, 17 Jan 2019 01:29:43 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 430792F082; Thu, 17 Jan 2019 01:29:43 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 370012E9F8 for ; Thu, 17 Jan 2019 01:29:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727814AbfAQB3k (ORCPT ); Wed, 16 Jan 2019 20:29:40 -0500 Received: from mail-wr1-f66.google.com ([209.85.221.66]:42451 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727797AbfAQB3j (ORCPT ); Wed, 16 Jan 2019 20:29:39 -0500 Received: by mail-wr1-f66.google.com with SMTP id q18so9118527wrx.9 for ; Wed, 16 Jan 2019 17:29:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Q5hbVaILaJX5uGJgjrjy5f+/yPYzGWA9+uSjFwE47/k=; b=sFbcd7q7wFAuZEKzdONvaPKY92mT4JwMSivhVL5NZYtMt5tdMho6wBhhtbD+ISgug2 xRFIihD6lU3WFYyOCW+81YATUaiw5Gtp/yEs7vvrpfX1u/m/A6g1/3MMpnBaCN8QRvzM lLVJFy0sceu5mWldFS/FrWb0EKO1/QSJuej0O9xaoETyl325VU20+IiiclGBpHjjvUVj snA6xo6hT/I9sATBielKAP5GT2OypO35B1AcTl7YuPQBkuGSjJ5ruy0dS3l3ckO7TE2X 9uV5KowMTaA3JAXBhgzg5Oy3Uu7R6OoxoujQ4x6C1vHlkARU3YyIK3CJyrxGyr/G7rTu 6dBg== 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:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Q5hbVaILaJX5uGJgjrjy5f+/yPYzGWA9+uSjFwE47/k=; b=Uz6K6MnO1Tid9zt1W0uYs+iS39XUvd0Mba3AROHKz1lEQS1qM/OU7YmXlKDfbOV3y6 4+r1K5EtsxTYKns/VVZkjXcm7sRViHm8AP2Fg66twVHmThYhztca7o2PXmeT64uOwVGJ nS2gvtzmr+cGsnAw0wPNArsUDxcGo9MR45KhKe9NXF0uXPNuOx/Gv8DkRPEYRx2JZWP0 +d11Fw9sCdKPjC2iDd/Qo9iRvUMKfibUDp5Lq/6WIObsSRDoE62zbBSZ/m20HrRFJA0G D3a9vem13YoAUu6UiCZfCafqzy5wMB22lfCbe9ge3F6ltQDQ6OhkXH7WKyFSX7VfA6tj pSDQ== X-Gm-Message-State: AJcUukfq0+AgzaXuz4xwHYlSqT1tVdD5E5loSe64E8EBJahv9Abeg0O9 cvuu3Fma0x+wJcj0nHEH8jrrUuKB X-Google-Smtp-Source: ALg8bN4puoMe7fdFUubC/LvDZlERJ73CO+2dCDc6icIECJuCyo0xfPjZxZrYODEQbkAW5s6P+pzo2w== X-Received: by 2002:a5d:6b09:: with SMTP id v9mr10176245wrw.304.1547688577207; Wed, 16 Jan 2019 17:29:37 -0800 (PST) Received: from localhost.localdomain (x4db4a994.dyn.telefonica.de. [77.180.169.148]) by smtp.gmail.com with ESMTPSA id y13sm36818272wme.2.2019.01.16.17.29.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Jan 2019 17:29:36 -0800 (PST) From: =?utf-8?q?SZEDER_G=C3=A1bor?= To: Junio C Hamano Cc: Jonathan Nieder , Johannes Schindelin , =?utf-8?b?w4Z2YXIgQXJu?= =?utf-8?b?ZmrDtnLDsCBCamFybWFzb24=?= , git@vger.kernel.org, =?utf-8?q?SZEDER_G=C3=A1bor?= Subject: [PATCH v2 4/5] travis-ci: switch to Xcode 10.1 macOS image Date: Thu, 17 Jan 2019 02:29:12 +0100 Message-Id: <20190117012913.30562-5-szeder.dev@gmail.com> X-Mailer: git-send-email 2.20.1.499.gf60de1223c In-Reply-To: <20190117012913.30562-1-szeder.dev@gmail.com> References: <20181220162452.17732-1-szeder.dev@gmail.com> <20190117012913.30562-1-szeder.dev@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When building something with GCC installed from Homebrew in the default macOS (with Xcode 9.4) image on Travis CI, it errors out with something like this: /usr/local/Cellar/gcc/8.1.0/lib/gcc/8/gcc/x86_64-apple-darwin17.5.0/8.1.0/include-fixed/stdio.h:78:10: fatal error: _stdio.h: No such file or directory #include <_stdio.h> ^~~~~~~~~~ This seems to be a common problem affecting several projects, and the common solution is to use a Travis CI macOS image with more recent Xcode version, e.g. 10 or 10.1. While we don't use such a GCC yet, in the very next patch we will, so switch our OSX build jobs to use the Xcode 10.1 image. Compared to the Xcode 10 image, this has the benefit that it comes with GCC (v8.2) preinstalled from Homebrew. Signed-off-by: SZEDER Gábor --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index 03c8e4c613..36cbdea7f4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,6 +8,8 @@ os: - linux - osx +osx_image: xcode10.1 + compiler: - clang - gcc From patchwork Thu Jan 17 01:29:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?SZEDER_G=C3=A1bor?= X-Patchwork-Id: 10767421 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 37A38139A for ; Thu, 17 Jan 2019 01:29:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2848C2E9F8 for ; Thu, 17 Jan 2019 01:29:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C3B72F082; Thu, 17 Jan 2019 01:29:44 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A0F352E9F8 for ; Thu, 17 Jan 2019 01:29:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727818AbfAQB3m (ORCPT ); Wed, 16 Jan 2019 20:29:42 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:54354 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727801AbfAQB3k (ORCPT ); Wed, 16 Jan 2019 20:29:40 -0500 Received: by mail-wm1-f67.google.com with SMTP id a62so4041699wmh.4 for ; Wed, 16 Jan 2019 17:29:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2DtqSx7pBpnA/nOfUlgB+XJtkrVCPUoA70Fv87HlSR0=; b=nF1Gm9x+FmhX/WP251v2EkTLtduqtorC0fwdAJL4DXmxu4S9alVka3VX4SjiArE4lV VQPPkE6yL8CV5EzwUq31G1l0SWCCdOvKxD7XKWrzGkpZIvpyM/TUu/cI6pz8o133jD/+ CahOPPdGX02ewxIdTfQZ5jp2nbSqL8qWYQQRPWW85TnHLbO+RHSACA/ACWyYOrn7v1HW H6Stq2EZLWun/0/7vzNXSHetW5VuBjBwa9T4/TiK9q6dE6rJtUNvp7BOAz8jcdM0t5kz SJdS1LFAzbELRWpFPzkWbrneyXSRqgutfgkm3lLqwkMyVsCLVadJ5BQG5cni+3KHFCcm y7SQ== 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:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=2DtqSx7pBpnA/nOfUlgB+XJtkrVCPUoA70Fv87HlSR0=; b=OHmNVRRO7dZePfACFfFOXg2eRIw97jVnMMe+CxKJM+SLtTScIrAgs8h+7LWAJt1+cH +Su3ejUwaBQH2pB8D0uPA0AKV78aaX5Cv5CJfR2essULfN4T5ToYrBSoP5vAETbW35hp bFRJjKnzYEeWnxJ2n+ahM2lA+/HoBCPFKho5/DHX2+zxqHcVJ1Y28zUkIxjoDDPc9ucE iUp0U0JlAc9erlQtH5RCkpiWHRbKuhznEh8JuAEwLTbZWDx4RpR5ZBblMA9LCy+RaZOe cK6eK9A/BMx3yEAQrD1RcgWzwqiu+Khu8/4w6SsG16I38qUCgTKeddOB8ayXKQTNkF8s rrTg== X-Gm-Message-State: AJcUukf1HBjJDDQ3/dY+yUwQR0p4PoeBPPu28a+hplWnPO20UMh8pIRI ENBQnqxZgOc+kgPpL79xR2A= X-Google-Smtp-Source: ALg8bN6NCSq565PzMMaA2ACg6TiJwh3jyqP9Hu9oTVKhKqWVtyt+fw0Hsk3BAKhzCMfY/2VhMJDp6Q== X-Received: by 2002:a1c:384:: with SMTP id 126mr9554690wmd.26.1547688578504; Wed, 16 Jan 2019 17:29:38 -0800 (PST) Received: from localhost.localdomain (x4db4a994.dyn.telefonica.de. [77.180.169.148]) by smtp.gmail.com with ESMTPSA id y13sm36818272wme.2.2019.01.16.17.29.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 16 Jan 2019 17:29:37 -0800 (PST) From: =?utf-8?q?SZEDER_G=C3=A1bor?= To: Junio C Hamano Cc: Jonathan Nieder , Johannes Schindelin , =?utf-8?b?w4Z2YXIgQXJu?= =?utf-8?b?ZmrDtnLDsCBCamFybWFzb24=?= , git@vger.kernel.org, =?utf-8?q?SZEDER_G=C3=A1bor?= Subject: [PATCH v2 5/5] travis-ci: build with the right compiler Date: Thu, 17 Jan 2019 02:29:13 +0100 Message-Id: <20190117012913.30562-6-szeder.dev@gmail.com> X-Mailer: git-send-email 2.20.1.499.gf60de1223c In-Reply-To: <20190117012913.30562-1-szeder.dev@gmail.com> References: <20181220162452.17732-1-szeder.dev@gmail.com> <20190117012913.30562-1-szeder.dev@gmail.com> MIME-Version: 1.0 Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Our 'Makefile' hardcodes the compiler to build Git as 'CC = cc'. This CC variable can be overridden from the command line, i.e. 'make CC=gcc-X.Y' will build with that particular GCC version, but not from the environment, i.e. 'CC=gcc-X.Y make' will still build with whatever 'cc' happens to be on the platform. Our build jobs on Travis CI are badly affected by this. In the build matrix we have dedicated build jobs to build Git with GCC and Clang both on Linux and macOS from the very beginning (522354d70f (Add Travis CI support, 2015-11-27)). Alas, this never really worked as supposed to, because Travis CI specifies the compiler for those build jobs as 'export CC=gcc' and 'export CC=clang' (which works fine for projects built with './configure && make'). Consequently, our 'linux-clang' build job has always used GCC, because that's where 'cc' points at in Travis CI's Linux images, while the 'osx-gcc' build job has always used Clang. Furthermore, 37fa4b3c78 (travis-ci: run gcc-8 on linux-gcc jobs, 2018-05-19) added an 'export CC=gcc-8' in an attempt to build with a more modern compiler, but to no avail. Set MAKEFLAGS with CC based on the $CC environment variable, so 'make' will run the "right" compiler. The Xcode 10.1 macOS image on Travis CI already contains the gcc@8 package from Homebrew, but we have to 'brew link' it first to be able to use it. So with this patch our build jobs will build Git with the following compiler versions: linux-clang: clang version 5.0.0 (tags/RELEASE_500/final) linux-gcc: gcc-8 (Ubuntu 8.1.0-5ubuntu1~14.04) 8.1.0 osx-clang: Apple LLVM version 10.0.0 (clang-1000.11.45.5) osx-gcc: gcc-8 (Homebrew GCC 8.2.0) 8.2.0 GETTEXT_POISON: gcc (Ubuntu 4.8.4-2ubuntu1~14.04.3) 4.8.4 Signed-off-by: SZEDER Gábor --- ci/install-dependencies.sh | 5 +++++ ci/lib-travisci.sh | 15 ++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ci/install-dependencies.sh b/ci/install-dependencies.sh index 06c3546e1e..dc719876bb 100755 --- a/ci/install-dependencies.sh +++ b/ci/install-dependencies.sh @@ -40,6 +40,11 @@ osx-clang|osx-gcc) brew install git-lfs gettext brew link --force gettext brew install caskroom/cask/perforce + case "$jobname" in + osx-gcc) + brew link gcc@8 + ;; + esac ;; StaticAnalysis) sudo apt-get -q update diff --git a/ci/lib-travisci.sh b/ci/lib-travisci.sh index 69dff4d1ec..a479613a57 100755 --- a/ci/lib-travisci.sh +++ b/ci/lib-travisci.sh @@ -99,12 +99,14 @@ export DEFAULT_TEST_TARGET=prove export GIT_PROVE_OPTS="--timer --jobs 3 --state=failed,slow,save" export GIT_TEST_OPTS="--verbose-log -x --immediate" export GIT_TEST_CLONE_2GB=YesPlease -if [ "$jobname" = linux-gcc ]; then - export CC=gcc-8 -fi case "$jobname" in linux-clang|linux-gcc) + if [ "$jobname" = linux-gcc ] + then + export CC=gcc-8 + fi + export GIT_TEST_HTTPD=YesPlease # The Linux build installs the defined dependency versions below. @@ -118,6 +120,11 @@ linux-clang|linux-gcc) export PATH="$GIT_LFS_PATH:$P4_PATH:$PATH" ;; osx-clang|osx-gcc) + if [ "$jobname" = osx-gcc ] + then + export CC=gcc-8 + fi + # t9810 occasionally fails on Travis CI OS X # t9816 occasionally fails with "TAP out of sequence errors" on # Travis CI OS X @@ -127,3 +134,5 @@ GIT_TEST_GETTEXT_POISON) export GIT_TEST_GETTEXT_POISON=YesPlease ;; esac + +export MAKEFLAGS="CC=${CC:-cc}"