From patchwork Thu Dec 20 16:24:48 2018 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: 10739111 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 EF14F746 for ; Thu, 20 Dec 2018 16:25:21 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DD6F7291A8 for ; Thu, 20 Dec 2018 16:25:21 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D13F5291B7; Thu, 20 Dec 2018 16:25:21 +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 6195D291A8 for ; Thu, 20 Dec 2018 16:25:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732985AbeLTQZU (ORCPT ); Thu, 20 Dec 2018 11:25:20 -0500 Received: from mail-wr1-f67.google.com ([209.85.221.67]:39236 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731218AbeLTQZU (ORCPT ); Thu, 20 Dec 2018 11:25:20 -0500 Received: by mail-wr1-f67.google.com with SMTP id t27so2386317wra.6 for ; Thu, 20 Dec 2018 08:25:18 -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=IOOnjInSQ8h/sMXWMzAYngEaadKBr3J51feInAOp6p0=; b=KH4RzryS209qI35WL9Q/6n9L46nW1GQDvCqVjYJ80h1LctwRl13L4sM8scbKamOgTd tcSZBgaMQCUCVYveysfuY0cgq+NLdx4VvhD92fEwsF3J/bVsudr+Xa1tJgXmKSpWtk3C xUvYAcqfu8pRJtae+sCqm6wXgXYj82ee50wdieO+Lf4J/JymKNBXiH/lfI6D4AyblzDs iBYt6yBhhyAgyTSu9dVdMueuHId/O//JWcc2wHX6vWKVWr2EhARYjlkgvp556HY9zbGY BZXkhY5I+5AfsT19NRoy/fH7jw5bq2oP81OWMJEe687twdrq0nEAlV5xVKZ2RuGyinp4 qoPg== 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=IOOnjInSQ8h/sMXWMzAYngEaadKBr3J51feInAOp6p0=; b=IEOTzgYrcqkAUV4nUTZ0sai+9t9v/D5dEiLoeossg/LHJ3rl2+SPruGODelt/Nau/J Z7/7qmalv7t6/eDqmeCCq1Pi1u1ul7P62QSXWQRzlOkuvTgK0w6+JlqqTactEgF6BCqZ oHVyuI3RB4LALdSjKD3D7jkSV2awqaS0SXMPU47emcyPGHvefgmOZoQlouyf0WhQQ8cm JUgHLSLkrB00t5zU5h6dLE9+4DBv2sTHn3sIOE3eGmyh44oGyBcFo44qvoQOup+mk47V CGXFBUd7uf5LKqgUkCU3vsCSteAYQvECRJHSNrtEDFbSeQG1ahqOUuw9xc/4TgzMbOI/ uywQ== X-Gm-Message-State: AA+aEWbPBl5xGnFy6yNGqeoJLwqkLpguaDvWe6QdoSWZEnKF5lwKr+iA gkRV2m0o+duTCeNLxAcKSFY= X-Google-Smtp-Source: AFSGD/XKO8RvGgsp8XGtB+Y5oMwKsPR24adcHFCOb7HbxALvE6SsmRpy7hSIm1i7V2b3njW1QlZxTA== X-Received: by 2002:a5d:50c5:: with SMTP id f5mr22167234wrt.37.1545323117572; Thu, 20 Dec 2018 08:25:17 -0800 (PST) Received: from localhost.localdomain (x4db1e5de.dyn.telefonica.de. [77.177.229.222]) by smtp.gmail.com with ESMTPSA id 200sm8980566wmw.31.2018.12.20.08.25.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Dec 2018 08:25:17 -0800 (PST) From: =?utf-8?q?SZEDER_G=C3=A1bor?= To: Junio C Hamano Cc: Jonathan Nieder , Johannes Schindelin , git@vger.kernel.org, =?utf-8?q?SZEDER_G=C3=A1bor?= Subject: [PATCH 1/5] compat/obstack: fix -Wcast-function-type warnings Date: Thu, 20 Dec 2018 17:24:48 +0100 Message-Id: <20181220162452.17732-2-szeder.dev@gmail.com> X-Mailer: git-send-email 2.20.1.151.gec613c4b75 In-Reply-To: <20181220162452.17732-1-szeder.dev@gmail.com> References: <20181220162452.17732-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 Git with GCC 8.2.0 (at least from Homebrew on macOS, DEVELOPER flags enabled) one is greeted with a screenful of compiler 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) 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. 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..dd9504c684 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.fn_extra_arg) ((h)->extra_arg, (size)) \ + : (*(h)->chunkfun.fn) ((size))) # define CALL_FREEFUN(h, old_chunk) \ do { \ if ((h) -> use_extra_arg) \ - (*(h)->freefun) ((h)->extra_arg, (old_chunk)); \ + (*(h)->freefun.fn_extra_arg) ((h)->extra_arg, (old_chunk)); \ else \ - (*(void (*) (void *)) (h)->freefun) ((old_chunk)); \ + (*(h)->freefun.fn) ((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.fn = chunkfun; + h->freefun.fn = 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.fn_extra_arg = (struct _obstack_chunk * (*)(void *,long)) chunkfun; + h->freefun.fn_extra_arg = (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..0f9b2232a9 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 { + struct _obstack_chunk *(*fn_extra_arg) (void *, long); + void *(*fn) (long); + } chunkfun; + union { + void (*fn_extra_arg) (void *, struct _obstack_chunk *); + void (*fn) (void *); + } 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.fn_extra_arg = (struct _obstack_chunk *(*)(void *, long)) (newchunkfun)) #define obstack_freefun(h, newfreefun) \ - ((h) -> freefun = (void (*)(void *, struct _obstack_chunk *)) (newfreefun)) + ((h)->freefun.fn_extra_arg = (void (*)(void *, struct _obstack_chunk *)) (newfreefun)) #define obstack_1grow_fast(h,achar) (*((h)->next_free)++ = (achar)) From patchwork Thu Dec 20 16:24:49 2018 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: 10739113 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 736B0924 for ; Thu, 20 Dec 2018 16:25:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 62DEC291A8 for ; Thu, 20 Dec 2018 16:25:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 56E7D291B7; Thu, 20 Dec 2018 16:25:23 +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 E7848291A8 for ; Thu, 20 Dec 2018 16:25:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732991AbeLTQZW (ORCPT ); Thu, 20 Dec 2018 11:25:22 -0500 Received: from mail-wr1-f65.google.com ([209.85.221.65]:38677 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732881AbeLTQZV (ORCPT ); Thu, 20 Dec 2018 11:25:21 -0500 Received: by mail-wr1-f65.google.com with SMTP id v13so2387605wrw.5 for ; Thu, 20 Dec 2018 08:25:19 -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=MrFYQJslRk8r5lzRDnw7Evz+RXhOag00S7sLo/OJ1Vk=; b=S2nktbZC2VJ95MagzYMfyjKsA1FFsHLvh/gJs/M9y7ZVW5chKFA6VkaDM6tDNp/HhK bPCtsqdKqS38KgllzAlxPHy/UXd2e/iJPB5s5TZlxvGQoFSqDO+s76ZKrSbneyXIyJqi W4fzov4MFbYI13QV/ye+6V1qGwxp/SCCjTpBnnocnF4KWMhp4xjLBnfHV+HlZKQTwJy4 B0UcyO24PQX6YkdIy71JG5y+S1e5DAmnKpng2FXBn8zqLtexVa0QiEHAZ6IFzNomDak2 WVtMOkObMnvKyx3uBDeV1J56A7E6UM4sbi+6HWwfsb0qx29BXalqWa4y+GwAk7rBueOS uJiA== 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=MrFYQJslRk8r5lzRDnw7Evz+RXhOag00S7sLo/OJ1Vk=; b=cRomAOxa15PUmwkA6TtCd1GUgkvCAf44itPdd58OBTX88bgBHHAnMPQWDjinflTmO5 W0oJJyxx9mvpl7q/iuwDdTm/PBGQB0KHmlZhCbsGGiK9uw7+rHhIUrEKFWN29Qw42vau 4qgRnMUd32MQe0XLL9q//+ng+xiDPDPfl6MCxqVmEYbG6N9suWpBQcDhivmk1pwvxHO+ hDomsRc4AlA8kZel1+L3TQ4j5sUb7hoy0cys9IqWW9iniFS/h/CD8PnG3vP0k9TqGLDv 880pjD5689xb+WoPJIfl1SnkyV5GipcjJGtRDAiKl8TvEWJFmzDd7HypEDuXUerNIpQo FiLQ== X-Gm-Message-State: AA+aEWZnoq0PKudy8Lj4JqktkiMuq6D9tAaPHDi2T9zK4jzVupyH7FtI KQQ91ZCqdGNiSJaGVTY+iak= X-Google-Smtp-Source: AFSGD/WV31JyawkdbG6b509Td7hE7eX9gfERGdHEgiSdoktrBfuYewSkkOSZkQJdxZMoQySB4sbIrw== X-Received: by 2002:a5d:4652:: with SMTP id j18mr23945240wrs.279.1545323118910; Thu, 20 Dec 2018 08:25:18 -0800 (PST) Received: from localhost.localdomain (x4db1e5de.dyn.telefonica.de. [77.177.229.222]) by smtp.gmail.com with ESMTPSA id 200sm8980566wmw.31.2018.12.20.08.25.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Dec 2018 08:25:18 -0800 (PST) From: =?utf-8?q?SZEDER_G=C3=A1bor?= To: Junio C Hamano Cc: Jonathan Nieder , Johannes Schindelin , git@vger.kernel.org, =?utf-8?q?SZEDER_G=C3=A1bor?= Subject: [PATCH 2/5] .gitignore: ignore external debug symbols from GCC on macOS Date: Thu, 20 Dec 2018 17:24:49 +0100 Message-Id: <20181220162452.17732-3-szeder.dev@gmail.com> X-Mailer: git-send-email 2.20.1.151.gec613c4b75 In-Reply-To: <20181220162452.17732-1-szeder.dev@gmail.com> References: <20181220162452.17732-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 Dec 20 16:24:50 2018 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: 10739115 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 EAB52924 for ; Thu, 20 Dec 2018 16:25:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DB445291B4 for ; Thu, 20 Dec 2018 16:25:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD54E291BA; Thu, 20 Dec 2018 16:25:24 +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 67B8A291B4 for ; Thu, 20 Dec 2018 16:25:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732997AbeLTQZW (ORCPT ); Thu, 20 Dec 2018 11:25:22 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:39915 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731218AbeLTQZW (ORCPT ); Thu, 20 Dec 2018 11:25:22 -0500 Received: by mail-wm1-f66.google.com with SMTP id f81so2842899wmd.4 for ; Thu, 20 Dec 2018 08:25:20 -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=dFDIFLkMiDElyR2pPLkx2eii0ABonagn/3/EjmMoERw=; b=cxW7M55kyeqZq+0B5u1JQ4fNOL49Ejnb1Exw5BnG9vR7UnIzUXNEk7nu7uR8mwtaM4 ivg8ArQmsv2pcq7nWnDUS8Ga5RJhLH9o6921TNQxgOliKR2xAgcomm2z+iQGeFhJZ8rK WpPfr+ooSjKIqazbChHlemIbqIJ8YoNWEq7AClK5rthteYGx5LRczD+xAiZDtPAvAQAw Awf+OpbmDmJRrwDg3lAmjP2ti1z68nyzmj8b5cNnHFPH5EEfXiBA02C3Ppp90kYjYbhO gzYab+TpXpddvHLe79flefgR/BL5jWghzKV5988izCDegY22zE+ZdxZRRtmu3qrMMZga yP7Q== 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=dFDIFLkMiDElyR2pPLkx2eii0ABonagn/3/EjmMoERw=; b=DsmK+RVcRZ6Xg1uUBidexffdtpGs6ty0NiGChjCbS0QHJcXfAlrYA7OQ9CXT55bpzn taybwV8Q76W5wKKCxbj1ovYe7gUTnMLuINMWd4UgcaXUSBJEa2OZjQNdWQygL2aTlAs5 mDS0uvF8zgKq3JqmXOqRD3a2/SzDL95PSuk//ojXATtExndwdY/i/m5FLczQ2JAa+Pf0 Qjub5D3Qf4F14/Ru+EyHOETqwdUR/KzBHuIxhbqiyzM29fMJWesDzbGVjq/UPXaHQQCi VhCBsvYMoke+f2S+wCfx+07aawJc6Wi0O3e3lzBhLFltD1SiqTNLZFmJ0JAfnQSadawV WFpw== X-Gm-Message-State: AA+aEWa9oVWnAprRqd+dWjvHnuhfRhJiz+iJcTsBHtA48WwlEwppU0Wt FvfWT6bngL2fU4VAU4dziGw= X-Google-Smtp-Source: AFSGD/WNxJs0k31lJ7RwtQpPZsroZuDgtDB7knGOePqMnRe1D/3O+hS1uZZSeAXor5cH7eveQ7qzjg== X-Received: by 2002:a1c:5a42:: with SMTP id o63mr1903171wmb.88.1545323120153; Thu, 20 Dec 2018 08:25:20 -0800 (PST) Received: from localhost.localdomain (x4db1e5de.dyn.telefonica.de. [77.177.229.222]) by smtp.gmail.com with ESMTPSA id 200sm8980566wmw.31.2018.12.20.08.25.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Dec 2018 08:25:19 -0800 (PST) From: =?utf-8?q?SZEDER_G=C3=A1bor?= To: Junio C Hamano Cc: Jonathan Nieder , Johannes Schindelin , git@vger.kernel.org, =?utf-8?q?SZEDER_G=C3=A1bor?= Subject: [PATCH 3/5] travis-ci: don't be '--quiet' when running the tests Date: Thu, 20 Dec 2018 17:24:50 +0100 Message-Id: <20181220162452.17732-4-szeder.dev@gmail.com> X-Mailer: git-send-email 2.20.1.151.gec613c4b75 In-Reply-To: <20181220162452.17732-1-szeder.dev@gmail.com> References: <20181220162452.17732-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 Dec 20 16:24:51 2018 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: 10739119 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 68217746 for ; Thu, 20 Dec 2018 16:25:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 59185291A8 for ; Thu, 20 Dec 2018 16:25:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D4B1291B7; Thu, 20 Dec 2018 16:25:29 +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 E765F291A8 for ; Thu, 20 Dec 2018 16:25:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733004AbeLTQZ0 (ORCPT ); Thu, 20 Dec 2018 11:25:26 -0500 Received: from mail-wm1-f66.google.com ([209.85.128.66]:54852 "EHLO mail-wm1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732992AbeLTQZX (ORCPT ); Thu, 20 Dec 2018 11:25:23 -0500 Received: by mail-wm1-f66.google.com with SMTP id a62so2662048wmh.4 for ; Thu, 20 Dec 2018 08:25:21 -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=croQXYHNHehpvuWiJZBef0uvwVh+XEOmDLPgUFZWnP0=; b=SWpdi2bAAUQCkKKR45+oUey/48lG/nIQqEo+VOt6V/rVD51dRVObQNDUGoZCNrgtsY xM2rklkf0or4uJmwUo8m0KMuhnEkfrAQcyTG9vYNWn35nGJwsUoa+7+vywUddtzPwPNY R/NtQpLuhJRDOeBJYw+EByBZzrxlbGO7ILnDVKRtNOoBY3Ja1SGHT1QXT0fR3M8MaDDP 0iB2rZu/wyUS23y/lv/uKdAPkdZNG8ttxISSerglUxqhPtpqJsXrIttXTcY7RbHcheFD GiIwJwfWLStMxRZMU0520fV2nHFYK0jFC8namHXDeQcPdyNyw2Ev2JztsPtOFPzN1hOz rx7A== 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=croQXYHNHehpvuWiJZBef0uvwVh+XEOmDLPgUFZWnP0=; b=EygPyZAyM0OD4RLmfceHg1V4JImxcVanacJlooUL5qmQxClLIa805lVKer3q8R6j/4 3Tv2L6fVjMogzjr8z748j2/qDqtt6bH88EoPqkaPSxBFBDdYl/scQcuJDbfl+vrHZ+1R BLl6m3HcFffEtSwjb5wLypbm7FYLFfOPPYSyRyBVz3SjtWusErMolyZaNnN3DgIaYsJQ +sjWEKECawEjMnGJ8NrhkpbfLeyCdXY3paemr7VHrVGY11OZa+SnUnWVikX5QDh35jTY GolHDeW4ue7KPSkcVTYeA1GsHpfBXFSWPv6KVWDF6Z0qYtoijtEe8foO08R48aI8edKO am2A== X-Gm-Message-State: AA+aEWb7vNcmbfYdq2VXeKpVh4DFJL2khOxfBm+zpyKg1uqf6w75vfG9 eLpBXxQhWvk1rk2mPDna+kPDBjo4 X-Google-Smtp-Source: AFSGD/V2lbamxihqrDKx5qfBCXcXxZTgQcUtg05R7VDr83NhzWhnM02fLgsI8YiSltL+qi9NVrgP7g== X-Received: by 2002:a1c:ae88:: with SMTP id x130mr11495255wme.91.1545323121346; Thu, 20 Dec 2018 08:25:21 -0800 (PST) Received: from localhost.localdomain (x4db1e5de.dyn.telefonica.de. [77.177.229.222]) by smtp.gmail.com with ESMTPSA id 200sm8980566wmw.31.2018.12.20.08.25.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Dec 2018 08:25:20 -0800 (PST) From: =?utf-8?q?SZEDER_G=C3=A1bor?= To: Junio C Hamano Cc: Jonathan Nieder , Johannes Schindelin , git@vger.kernel.org, =?utf-8?q?SZEDER_G=C3=A1bor?= Subject: [PATCH 4/5] travis-ci: switch to Xcode 10.1 macOS image Date: Thu, 20 Dec 2018 17:24:51 +0100 Message-Id: <20181220162452.17732-5-szeder.dev@gmail.com> X-Mailer: git-send-email 2.20.1.151.gec613c4b75 In-Reply-To: <20181220162452.17732-1-szeder.dev@gmail.com> References: <20181220162452.17732-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 Dec 20 16:24:52 2018 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: 10739117 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 6619E746 for ; Thu, 20 Dec 2018 16:25:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 54C2A291A8 for ; Thu, 20 Dec 2018 16:25:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4854D291B7; Thu, 20 Dec 2018 16:25:28 +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 EAED1291A8 for ; Thu, 20 Dec 2018 16:25:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733006AbeLTQZ1 (ORCPT ); Thu, 20 Dec 2018 11:25:27 -0500 Received: from mail-wm1-f68.google.com ([209.85.128.68]:54859 "EHLO mail-wm1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731218AbeLTQZZ (ORCPT ); Thu, 20 Dec 2018 11:25:25 -0500 Received: by mail-wm1-f68.google.com with SMTP id a62so2662137wmh.4 for ; Thu, 20 Dec 2018 08:25:23 -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=QEcxTjJqEgLAtiumJ2DCmPWwPKffAOTL0rDTlg9xRp8=; b=PfGIImKeUQI2epLg3RBnkDimnazW9TadhaellNZlSnFU2kXdG5COSGbheHj7OOxb5V Aj5n6VjIC1WSySJnBSp1sZEPSdJUqFG17SXveUTwGYKqDrkqSDvc7IiGbmJJDwKZs8HU eF5yng/MfK8Pvjv3j/OsYZldY2kHubYnVlNFEQtGYm9ohTIOCPe8YyyUe5nEizsVkTeu 8BASuzrVfIiem7CMimAwuyv/oi/mAYkV/Km6EFl3Hi5sctwVQ21puARFO2x5kLpgvX1f 5dyfXUGIezVgmtmOo0HZlqUqDh1bf3a2OmB8YiQ6zVOLEFJE5hj4OGxoxKviOz0XFuXz by1Q== 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=QEcxTjJqEgLAtiumJ2DCmPWwPKffAOTL0rDTlg9xRp8=; b=XDfVz8isMfEyNVamO/Mm9xYAh9sVHVHhSkUvaS+QLA/Y8vBGgjuslNsW6CSx7yW2OU bWzbLquYxmBCybdxlQ174Jkygwa4HC0jDmrO3LRIaBtfYLLEFnBwtl/W6XLvZTaiBM7H Hkh8C5hrWaROCCoZZUWWIF83WXufZOdQtByNiG21D7R9uonwkdFxgYqV9x56SdmMR4zD QVMAfZWSTZ7Rg4KCP46HCqh5Hy1jFdhlOmRSLXszCGmOooVNuUq48GKVwg4u6J/nKzF0 Kec0wgwZWd0nL/D76jXvxf+ouqImHmmr1yMrbC3TRnlvGqh1Fv23r7aQNqhjpITM8r8+ NqNQ== X-Gm-Message-State: AA+aEWZkXe67z4bG83+hsEpnBL2il3PcTAMjpXpEN+dTMkygwxWxtSBs m5nSNBom5CEoOieCWUooZXo= X-Google-Smtp-Source: AFSGD/VUnj10MPNrLFuQdie2t1ctg4Xkq8dq285QwwCugefcISAWoBvacRFTUKADj8HbjoX7eQiU4g== X-Received: by 2002:a1c:11c1:: with SMTP id 184mr11459991wmr.59.1545323122478; Thu, 20 Dec 2018 08:25:22 -0800 (PST) Received: from localhost.localdomain (x4db1e5de.dyn.telefonica.de. [77.177.229.222]) by smtp.gmail.com with ESMTPSA id 200sm8980566wmw.31.2018.12.20.08.25.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 20 Dec 2018 08:25:21 -0800 (PST) From: =?utf-8?q?SZEDER_G=C3=A1bor?= To: Junio C Hamano Cc: Jonathan Nieder , Johannes Schindelin , git@vger.kernel.org, =?utf-8?q?SZEDER_G=C3=A1bor?= Subject: [PATCH 5/5] travis-ci: build with the right compiler Date: Thu, 20 Dec 2018 17:24:52 +0100 Message-Id: <20181220162452.17732-6-szeder.dev@gmail.com> X-Mailer: git-send-email 2.20.1.151.gec613c4b75 In-Reply-To: <20181220162452.17732-1-szeder.dev@gmail.com> References: <20181220162452.17732-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 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}"