From patchwork Sat Sep 26 21:32:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Derrick Stolee via GitGitGadget X-Patchwork-Id: 11801669 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A016D139A for ; Sat, 26 Sep 2020 21:32:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8486723719 for ; Sat, 26 Sep 2020 21:32:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="nJ6pcd4r" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727801AbgIZVcy (ORCPT ); Sat, 26 Sep 2020 17:32:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727717AbgIZVcx (ORCPT ); Sat, 26 Sep 2020 17:32:53 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 23DFDC0613CE for ; Sat, 26 Sep 2020 14:32:53 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id d4so2648415wmd.5 for ; Sat, 26 Sep 2020 14:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:mime-version :content-transfer-encoding:fcc:to:cc; bh=mRcnH+G1Ka44sLeCNyVBJTX/HZuo1MlBFoUFNXHVNoQ=; b=nJ6pcd4rgKths2syJpnUdhX/3I3tzUycRmFQuoQgyYCfPNZ1dewethQtKwG2APZE3Q elaAiw0yvHcIZScLYfR8mjYoEqkJ+8FCkQ0AYLDu8mvTzq8rH4xMQyM4TsOzE5FFCf+U UuzFgjxRDgEXYZJbo2EvgfFmLquoP/3ApcoT/NIFV1m0XzNsLJigd+NY9VgWyzz+5B4y uo8XdyLIPkiueaNzoflC2VAIbUYKzT932SoBQGgBPyN5yX/Dy9FJVGIRiUfHXD/WUWmL HaA70HcWcZaho5/H69diFSAgXGN5hO0/2i2MdKajhPr5B9OxF04YDwtArHTjDtyOt5EE Lj9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:mime-version:content-transfer-encoding:fcc:to:cc; bh=mRcnH+G1Ka44sLeCNyVBJTX/HZuo1MlBFoUFNXHVNoQ=; b=JSiNQdyuvVCqnHDm63o6n+i4qAE9wkf3jCEAB3scJUPkQe3D8v5IKBcvZWUc/O6T1t +MUQKuEhrdtA3qOmMr9qZw8XGe4jO+kpSmPegQR21nCgLFfG03LLkz6abXTh2Uq5rWES oLMfHqvfBOtxgIixuxtsuHdpTkE0HUYQKJTk9WTvq5KOAtU6y4L7Hw868KZnMejvGfYt v22h0fUxqRsj0W2P6GFU98cD0uwHydSMr28TXLaRUreEnqs6HCZqRy6Sbs/tSwfxzXeY izJXshya3cj/nZzlsTkGvHL6dG6Fqe9pHCEURO0lkR5w9kNJW9u4TQzf5IH5aoA2vzcm ASXQ== X-Gm-Message-State: AOAM530WyQYwrYTKlkK6BAUzyb1PfbCs+ggygvVFcOGhy9EaV/Pa+yFr RsncK/tNn1pK4ruZ14bjy/LnGcjrMCI= X-Google-Smtp-Source: ABdhPJxNQaWCoAubD4HeKk4TM+LV7ttC6GGOEf9zUzDh1lMOQa6vzRNf2NygLAGEpurcUikegBbNtQ== X-Received: by 2002:a1c:ed09:: with SMTP id l9mr4136629wmh.89.1601155971750; Sat, 26 Sep 2020 14:32:51 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id u8sm3602177wmj.45.2020.09.26.14.32.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 14:32:51 -0700 (PDT) Message-Id: In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Sat, 26 Sep 2020 21:32:40 +0000 Subject: [PATCH v2 01/10] cmake: ignore files generated by CMake as run in Visual Studio MIME-Version: 1.0 Fcc: Sent To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Eric Sunshine , Johannes Schindelin , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin As of recent Visual Studio versions, CMake support is built-in: https://docs.microsoft.com/en-us/cpp/build/cmake-projects-in-visual-studio?view=vs-2019 All that needs to be done is to open the worktree as a folder, and Visual Studio will find the `CMakeLists.txt` file and automatically generate the project files. Let's ignore the entirety of those generated files. Helped-by: Đoàn Trần Công Danh Signed-off-by: Johannes Schindelin --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index d0f692a355..6521f3cf22 100644 --- a/.gitignore +++ b/.gitignore @@ -241,3 +241,4 @@ Release/ /git.VC.VC.opendb /git.VC.db *.dSYM +/contrib/buildsystems/out From patchwork Sat Sep 26 21:32:41 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derrick Stolee via GitGitGadget X-Patchwork-Id: 11801679 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 71B11618 for ; Sat, 26 Sep 2020 21:33:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5653123772 for ; Sat, 26 Sep 2020 21:33:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ZpJzDxGW" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728104AbgIZVdD (ORCPT ); Sat, 26 Sep 2020 17:33:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727794AbgIZVcy (ORCPT ); Sat, 26 Sep 2020 17:32:54 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 123A5C0613D3 for ; Sat, 26 Sep 2020 14:32:54 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id z4so7672275wrr.4 for ; Sat, 26 Sep 2020 14:32:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=xnkt83SLDEtUSWd+hVptfxemrNoGCKpXXnlEscdf5MA=; b=ZpJzDxGWj0D2KBE32RpFDHf5pFpJsIsCuAQyHh7vgsntw0z43mEwb3lph5NbdEvs1o HYyQIUOU0aEapjJKI2tI4TUFv+2tUlH7neBLmTbnUPf81J95vHj9S6qNcLLrnlZ9Erpp 1IlRGOfMvawQOVbJ31yd94AtwPQmsTOTNgeLqrQ1LcRuo+Wr0nXnfMoah57qhAO7xXx3 21st+L1es+/Kk+wGCVylmCge4p4feErRNG8QxnvCvneIgAhZF3cCam7Pv3VIXpwBeCxi mvrVtG1FdVqybwObeNvRlY9A74opMSlt25UoGxfjlPg3cCcKPzQVnyBEJCpu4tf34Z0R X/7Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=xnkt83SLDEtUSWd+hVptfxemrNoGCKpXXnlEscdf5MA=; b=Gpkk25grxPyXxwHY6JHIg7lDAJifMUnCLjak+J+rC2sC9vRueQEE8K1wlWYPuDvRjQ kLMPL9jifAMK/5BWmgpWRXJNqx2QZn1KLNFwApuDUKh8JdVzcRvo8HxwZeB3RVt4Jidr o48ayhhnqN9LO74hSHohjSobQ94YttktBWpexFfZN5SDfA2abgaGkJ+3te9Xo9CMRGf8 uBbORL+cUafzqlmYac1/XRCXE2V/zsdREAku44PKwVrMRnf+i1CgZuZcHm73hBn6S6Ci b3Ms96tRsSSP7ROhgPZUam7gDpkdgsQwiUiAHl81s3Pl2DvHZe/jPAmhxDmbBgzlODcU usgA== X-Gm-Message-State: AOAM530fmalQjEhFFKKd5GxuRMX/BdLvt3/7ClWd2hyzKMFIUzVnbHTd u/WhivGkR2wLoe9fKz6qschzqHEqdok= X-Google-Smtp-Source: ABdhPJxuW1rsS/SxwSkI20rDdST1Mqnpibf1+LgrAh2mwWdkJYzPsmau/eYFTYmzFuZsYSjcn4UvZA== X-Received: by 2002:adf:f78f:: with SMTP id q15mr11104421wrp.206.1601155972602; Sat, 26 Sep 2020 14:32:52 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id h4sm9035747wrm.54.2020.09.26.14.32.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 14:32:52 -0700 (PDT) Message-Id: <05b4b69fee2b8c32769dd72dea182cfb72a14876.1601155970.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Sat, 26 Sep 2020 21:32:41 +0000 Subject: [PATCH v2 02/10] cmake: do find Git for Windows' shell interpreter Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Eric Sunshine , Johannes Schindelin , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin By default, Git for Windows does not install its `sh.exe` into the `PATH`. However, our current `CMakeLists.txt` expects to find a shell interpreter in the `PATH`. So let's fall back to looking in the default location where Git for Windows _does_ install a relatively convenient `sh.exe`: `C:\Program Files\Git\bin\sh.exe` Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 5007f173f1..d14fa4f3dc 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -43,8 +43,11 @@ set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..) find_program(SH_EXE sh) if(NOT SH_EXE) - message(FATAL_ERROR "sh: shell interpreter was not found in your path, please install one." - "On Windows, you can get it as part of 'Git for Windows' install at https://gitforwindows.org/") + set(SH_EXE "C:/Program Files/Git/bin/sh.exe") + if(NOT EXISTS ${SH_EXE}) + message(FATAL_ERROR "sh: shell interpreter was not found in your path, please install one." + "On Windows, you can get it as part of 'Git for Windows' install at https://gitforwindows.org/") + endif() endif() #Create GIT-VERSION-FILE using GIT-VERSION-GEN From patchwork Sat Sep 26 21:32:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derrick Stolee via GitGitGadget X-Patchwork-Id: 11801675 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B263F618 for ; Sat, 26 Sep 2020 21:33:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 96C1D23772 for ; Sat, 26 Sep 2020 21:33:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="T2a0w6cp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728056AbgIZVdB (ORCPT ); Sat, 26 Sep 2020 17:33:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727717AbgIZVcz (ORCPT ); Sat, 26 Sep 2020 17:32:55 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD09AC0613CE for ; Sat, 26 Sep 2020 14:32:54 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id d4so2648446wmd.5 for ; Sat, 26 Sep 2020 14:32:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=eZubIZIwUMiFrmcNwqR+VL9ixmOdNHlOZovIEYzMITo=; b=T2a0w6cp3ib42t8Jn3/JWZoFshPEiLB/tqtLqyV1j8BbNu5Gr11Ss+WtzghD/CCrI5 XAvG+HBAGaHmMBZ1rn/V2rV4d9PLWdeSAQlMkHKCesxsQ7yf5fnHVgq3CS4xlPnYkUx9 +vrd9l7yrRUYrXZ8S/UvGiCHcsYgZJ2z27tZEejVpDI3O8z+IP++UKyoXqu2oxM/hPdx ELsC0n9vGP/DcqnBJBThsKSIGqhEAqNtXomrH2mn5OWMrdNCPwbQV2h5/3OLU6b52+9t DhTN1yjsOC4z1Ftrh6Sd/RTLuhAYLqTzXBMDvyUL7YUdb+UwBk8SYVvuvW0k4rkbtlQS wn4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=eZubIZIwUMiFrmcNwqR+VL9ixmOdNHlOZovIEYzMITo=; b=QmzCrVdVwIs+ZYxmaji2feZPbmdkvHycOaCmZ850GWe1HYQ2yI0PPGY7C90kXRJdjx DrbwXv8WpE3I/UsGobEsuzPxT0eNt5x0/2kXX/mwMYv/yP3tllV++xEHUrwX9HlrYaZH iSHiVUrLwmFF5YWYqt1fchue8UhBXmMvTkFitGisP5pKFRDvy+Of7qXXsp+gIE/zW93m CpvQrKmY3BY/DMorvS5rTTvjEfeeRKF4gGYyTN554tOf7GOogaXOfHWmDhCapJ93vmcb zF7so1uj6/JkL6SyzRMMd3G6gjiZrb02aHAkRMTTtJmoOBm/tep7XPLb5N55oMG/j2+m Kw+Q== X-Gm-Message-State: AOAM533vsUJ6QZ7JZFPTCIEq/tsM/jFEgGN+8wadLKrosoAfvkaDeXoM i6QwTe9PfOkTG2A+aofDrWuKL9vGaKs= X-Google-Smtp-Source: ABdhPJxTL/XqYBL9FTA7IIp5EqiJZufn7i6smweNavIpUrUWAiCRvRDVeNAUmlTYjfoBsuqkP1pzag== X-Received: by 2002:a05:600c:215:: with SMTP id 21mr4041989wmi.105.1601155973320; Sat, 26 Sep 2020 14:32:53 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id 92sm8268306wra.19.2020.09.26.14.32.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 14:32:52 -0700 (PDT) Message-Id: <5967822a0c69b9f822d3a4f6412c626c4a43cc35.1601155970.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Sat, 26 Sep 2020 21:32:42 +0000 Subject: [PATCH v2 03/10] cmake: ensure that the `vcpkg` packages are found on Windows Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Eric Sunshine , Johannes Schindelin , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin On Windows, we use the `vcpkg` project to manage the dependencies, via `compat/vcbuild/`. Let's make sure that these dependencies are found by default. This is needed because we are about to recommend loading the Git worktree as a folder into Visual Studio, relying on the automatic CMake support (which would make it relatively cumbersome to adjust the search path used by CMake manually). Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index d14fa4f3dc..16014ac4f7 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -40,6 +40,13 @@ cmake_minimum_required(VERSION 3.14) #set the source directory to root of git set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..) +if(WIN32) + set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg") + list(APPEND CMAKE_PREFIX_PATH "${VCPKG_DIR}/installed/x64-windows") + + # In the vcpkg edition, we need this to be able to link to libcurl + set(CURL_NO_CURL_CMAKE ON) +endif() find_program(SH_EXE sh) if(NOT SH_EXE) From patchwork Sat Sep 26 21:32:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derrick Stolee via GitGitGadget X-Patchwork-Id: 11801677 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 11B12139A for ; Sat, 26 Sep 2020 21:33:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E7BA123772 for ; Sat, 26 Sep 2020 21:33:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="dOuLflHw" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728090AbgIZVdC (ORCPT ); Sat, 26 Sep 2020 17:33:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727807AbgIZVcz (ORCPT ); Sat, 26 Sep 2020 17:32:55 -0400 Received: from mail-wm1-x344.google.com (mail-wm1-x344.google.com [IPv6:2a00:1450:4864:20::344]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 56735C0613D4 for ; Sat, 26 Sep 2020 14:32:55 -0700 (PDT) Received: by mail-wm1-x344.google.com with SMTP id d4so2648455wmd.5 for ; Sat, 26 Sep 2020 14:32:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=QPGEktvBa4u524d4A0i6OsR419ivIXg6j+KJkoHFQyE=; b=dOuLflHwLsiu6DrcOr7k8OHbkwCTsCarIZCGy8vpKjziQBgF78pwiH1VP4tYbjCYiZ YkEV+AFrZJveocbEcxWl037QOv+gv1ihV3tLRST49ATso3Xh21gUve4FmCtmR6znb/fs ZsuTuBs3Y0N/BVa5dYE3KS3KWq22Etu22260wfJAPdBLUi3Kr1n1Yple3VDz2Y6J4qMq FLatSPkQ680B9OlX6IvfjMI9HniCcsdDOUpWt12sVUt+rHNpRrJNUcJzDTMkh6L0Bcq/ kEc2u3y4jWNOx7cGLTvagnPMIcCmltKzkRUbc33RilpuI4nm20+jGTBHN3Ed2HrJdoTN D7cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=QPGEktvBa4u524d4A0i6OsR419ivIXg6j+KJkoHFQyE=; b=Kyhmcfhpm64w7cXm0soMS/jKORpX1rCJMd0nGK/KRAXK3Gy+YN4BqYopGsxGiUTmwm uietYhQSpn51S6gy/E+HSdzo0HLcXvRtVsKkdQGrprcB/+RxGc8mjJoNemncFnhlLUiD 6ZYKG4zytHYLJRCwnuUKuKhMYOPJD7t3zz9Hrkou7xqL3llAt5jIgc9GbR88x73/Th9z wT3Dm8K6r1ZJRAKhARLqfKZTluFwIfRQ3uKA/tEkvsriVC1DIzHUPgw6Xtl18RTsjl7i HRVCa9ovowyqqm+x4w9eUDLzp/QJBjS4OG3jhl5v/3SLd9C/y8jjpahNlqPmKtyPxbXT imiw== X-Gm-Message-State: AOAM5325fBh6Pn5S0cq7jxOheK64I3xa+p00UOW+MSnwjO/pCOgCV7ZS 02tvB9Gjr1dlx3LkPY4aqgIajZm03G4= X-Google-Smtp-Source: ABdhPJyeHXFthb3+n1x4er3fZRDLN6zUQ2KhlDdiCWXsRh6PIqaw/x86PmENsTIywQw7PunYySKyDw== X-Received: by 2002:a1c:81c9:: with SMTP id c192mr3976467wmd.2.1601155973997; Sat, 26 Sep 2020 14:32:53 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id q12sm7629741wrs.48.2020.09.26.14.32.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 14:32:53 -0700 (PDT) Message-Id: In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Sat, 26 Sep 2020 21:32:43 +0000 Subject: [PATCH v2 04/10] cmake: fall back to using `vcpkg`'s `msgfmt.exe` on Windows Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Eric Sunshine , Johannes Schindelin , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin We are already relying on `vcpkg` to manage our dependencies, including `libiconv`. Let's also use the `msgfmt.exe` from there. Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 16014ac4f7..acb197fba5 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -155,7 +155,11 @@ endif() find_program(MSGFMT_EXE msgfmt) if(NOT MSGFMT_EXE) - message(WARNING "Text Translations won't be build") + set(MSGFMT_EXE ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg/downloads/tools/msys2/msys64/usr/bin/msgfmt.exe) + if(NOT EXISTS ${MSGFMT_EXE}) + message(WARNING "Text Translations won't be build") + unset(MSGFMT_EXE) + endif() endif() #Force all visual studio outputs to CMAKE_BINARY_DIR From patchwork Sat Sep 26 21:32:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derrick Stolee via GitGitGadget X-Patchwork-Id: 11801673 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2EA86139A for ; Sat, 26 Sep 2020 21:33:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0A73F2371F for ; Sat, 26 Sep 2020 21:33:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="paQKYGVf" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728032AbgIZVdB (ORCPT ); Sat, 26 Sep 2020 17:33:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58780 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727810AbgIZVc4 (ORCPT ); Sat, 26 Sep 2020 17:32:56 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CDDBC0613D5 for ; Sat, 26 Sep 2020 14:32:56 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id j2so7632939wrx.7 for ; Sat, 26 Sep 2020 14:32:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=LbzZ7rratphdzpKCzScQ0H87PZ4mOGWV8pJbumS/i3M=; b=paQKYGVfwIPVzLIfByIZ9soDpg/GbFfWgjnvYHTmR3DB/8GAGaXAE0QrO4VUbxkv71 FUAznD+s+LVCuXBN52lY1pKro1Lqsq3qhGdk+kWI+TRMDryiUq0RG0oFR17SnOG/hBSr sNjy8NHrWcj4qr4lp3tfuAvYa5gWTCAWJGG+JRGfOrWCDvrEoNUvWhSulzip4d0TinaE jjBy3b7kFu1IgQSwCrMN/PUKP0hEXn9JCXSvTcsfdHZdOr2/f7x0nE/+Kw31zzq1r1Ca pEFdKmjqiLqGGm3Fwyl8709qe89ORvSWaEUt5ubgZ++Nu7ISmwEvHFDNQJmwdNFSgMB/ EUJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=LbzZ7rratphdzpKCzScQ0H87PZ4mOGWV8pJbumS/i3M=; b=buPmlIdCoBdkxwnemkqAdKbsADo8XA0jiz7VwwcDWmM/OlEE9HsOxR+WjWlziReIRj a0WIIs+HGY6ouCBqN1CsxTfyvVDMx/raf6J7bdi6hZadMk3qXW6991JE8Mz7EUxgh1SH czF34YroH81pjkB715bNrIG8j4iU2ZUn33Trg6uYRiuH0S0UFzKpP5VzWMUrD4UUL/E8 VVXLCDnfSxS2aLPZDMJbg5dOLlzMR5D3C6cVMgl87JNJKn5m+6Hz9qHnNaEAmefGrGF8 DDBV+0sHAyRqGLjmmO+F4jbsxGCJD18RdRdeS0bO4UXxTTUxYizpLOw7G/TIw0j2HCQw RLAQ== X-Gm-Message-State: AOAM533S6T/cPXH/IpGLSTwTQjqZ6W+Vtw0bNNmUvFvws07p1omrEwl5 f9M1zSQK46hp5lzW8i/6eX+sQL4Ro9o= X-Google-Smtp-Source: ABdhPJzbib0XKS46oDYOwlz8549EbWMkI6NYHI3FvC5lbJyuxKOPVm42CeYCt6oWPlYC0agnvoh7bQ== X-Received: by 2002:adf:dd82:: with SMTP id x2mr11708036wrl.419.1601155974631; Sat, 26 Sep 2020 14:32:54 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id x10sm3772305wmi.37.2020.09.26.14.32.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 14:32:54 -0700 (PDT) Message-Id: <8b3500a07c67d07e0928e8d6638d618ab118e1eb.1601155970.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Sat, 26 Sep 2020 21:32:44 +0000 Subject: [PATCH v2 05/10] cmake: quote the path accurately when editing `test-lib.sh` Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Eric Sunshine , Johannes Schindelin , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin By default, the build directory will be called something like `contrib/buildsystems/out/build/x64-Debug (default)` (note the space and the parentheses). We need to make sure that such a path is quoted properly when editing the assignment of the `GIT_BUILD_DIR` variable. Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index acb197fba5..e66ae137c2 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -952,7 +952,7 @@ if(NOT ${CMAKE_BINARY_DIR}/CMakeCache.txt STREQUAL ${CACHE_PATH}) file(WRITE ${CMAKE_BINARY_DIR}/CTestCustom.cmake "file(STRINGS ${CMAKE_SOURCE_DIR}/t/test-lib.sh GIT_BUILD_DIR_REPL REGEX \"GIT_BUILD_DIR=(.*)\")\n" "file(STRINGS ${CMAKE_SOURCE_DIR}/t/test-lib.sh content NEWLINE_CONSUME)\n" - "string(REPLACE \"\${GIT_BUILD_DIR_REPL}\" \"GIT_BUILD_DIR=\\\"$TEST_DIRECTORY\\\"/../${BUILD_DIR_RELATIVE}\" content \"\${content}\")\n" + "string(REPLACE \"\${GIT_BUILD_DIR_REPL}\" \"GIT_BUILD_DIR=\\\"$TEST_DIRECTORY/../${BUILD_DIR_RELATIVE}\\\"\" content \"\${content}\")\n" "file(WRITE ${CMAKE_SOURCE_DIR}/t/test-lib.sh \${content})") #misc copies file(COPY ${CMAKE_SOURCE_DIR}/t/chainlint.sed DESTINATION ${CMAKE_BINARY_DIR}/t/) From patchwork Sat Sep 26 21:32:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derrick Stolee via GitGitGadget X-Patchwork-Id: 11801687 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DDD20139A for ; Sat, 26 Sep 2020 21:33:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C37C723772 for ; Sat, 26 Sep 2020 21:33:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="fLJUb7I7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727972AbgIZVdB (ORCPT ); Sat, 26 Sep 2020 17:33:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727812AbgIZVc5 (ORCPT ); Sat, 26 Sep 2020 17:32:57 -0400 Received: from mail-wm1-x342.google.com (mail-wm1-x342.google.com [IPv6:2a00:1450:4864:20::342]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BFCC5C0613D6 for ; Sat, 26 Sep 2020 14:32:56 -0700 (PDT) Received: by mail-wm1-x342.google.com with SMTP id a9so2844132wmm.2 for ; Sat, 26 Sep 2020 14:32:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=bRp5s+30vZ/dwGxaU1pFoSCDKRfHr+eKVN9HMmOsOR8=; b=fLJUb7I7012sW2cIXZQC95PgRk8TspJxQ1rYCBwlAKclRHLGb1n2lIvbZg60U4oRk7 5zUeIKzMs1eDzoxJudcuT5auzKVHnaKLjnNzZX+aZJlC/aofxjBFYJS/erPJPcBrh8Af Z+bSiRVE8udMhGoIySHd9MXKDKd+0Vh8SrwR3eiwLrmeP1GzAgv3AWf5oALKsSHojB1v NngKM/78Qt9nNOvOfNoE/78/nRR6NYMYeLo95LPS3tq1VKgVwkcH6QZ/La5aDr5coDum glnblXgkOxiDEoWgJ0GhW367RXqKnsD/ZJOeT7FNkifgjEynlpl0k2JK2R5vSK2A2knA JUbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=bRp5s+30vZ/dwGxaU1pFoSCDKRfHr+eKVN9HMmOsOR8=; b=er/SeNTX1zRgp6lPjXgaBXs14LcoWM44ASLdLlm63ms6Vna9NbjccJtoHE3cWnT/oA AEIm8glJT6Jl25mxrfk4hfBBgVIrqRBfaFepjcLUOlHinVYowMk2ZTbGPvSWdNMzvlh5 DTL7oJoOS/E8Up5Sgtec1KL8fsSUuaOpNm4+6kZxNZO2zlxGFYE19lWcTpa2uI9109tU 3/l6nzhZtv+B2hFqK2patpPuKp8LsJztKi1s3uJCU3/AOIF3In7O0BoD3fzceFF9GYkS NlbD8+NEGgqYJJ7MtiIzzNgWO9OBenc6vc6Ud0C6sOKtHlAg7hos2H5CqUnMqIjW0NCu TRRA== X-Gm-Message-State: AOAM530jm0IraAd5UMVo6p9qOdDO/otxTwfaGq4eicZRtnAZg+Xv6wpl e23ADREySNY7yhLoVYhq0MOSIDRDA5g= X-Google-Smtp-Source: ABdhPJzeQ0s7KZtLfj1Z5UOxgUthtUndcEFjjnFHK+NWoCSmwM4TW6u0uq3rrbm3+YX5iOC9N8suJA== X-Received: by 2002:a1c:63c1:: with SMTP id x184mr4127853wmb.138.1601155975360; Sat, 26 Sep 2020 14:32:55 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id k8sm7670850wrl.42.2020.09.26.14.32.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 14:32:54 -0700 (PDT) Message-Id: <88abbd9a788091f869ae297f33e0fa5a6ea535a8.1601155970.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Sat, 26 Sep 2020 21:32:45 +0000 Subject: [PATCH v2 06/10] cmake (Windows): let the `.dll` files be found when running the tests Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Eric Sunshine , Johannes Schindelin , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin Contrary to Unix-ish platforms, the dependencies' shared libraries are not usually found in one central place. In our case, since we use `vcpkg`, they are to be found inside the `compat/vcbuild/vcpkg/` tree. Let's make sure that they are in the search path when running the tests. Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index e66ae137c2..5a4e0ccb01 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -942,6 +942,9 @@ file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "X='${EXE_EXTENSION}'\n") file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_GETTEXT='${NO_GETTEXT}'\n") file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "RUNTIME_PREFIX='${RUNTIME_PREFIX}'\n") file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "NO_PYTHON='${NO_PYTHON}'\n") +if(WIN32) + file(APPEND ${CMAKE_BINARY_DIR}/GIT-BUILD-OPTIONS "PATH=\"$PATH:$TEST_DIRECTORY/../compat/vcbuild/vcpkg/installed/x64-windows/bin\"\n") +endif() #Make the tests work when building out of the source tree get_filename_component(CACHE_PATH ${CMAKE_CURRENT_LIST_DIR}/../../CMakeCache.txt ABSOLUTE) From patchwork Sat Sep 26 21:32:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derrick Stolee via GitGitGadget X-Patchwork-Id: 11801689 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 7F0CC618 for ; Sat, 26 Sep 2020 21:33:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6436723772 for ; Sat, 26 Sep 2020 21:33:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ba3/e6/Q" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728353AbgIZVdL (ORCPT ); Sat, 26 Sep 2020 17:33:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727813AbgIZVdB (ORCPT ); Sat, 26 Sep 2020 17:33:01 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6122AC0613D7 for ; Sat, 26 Sep 2020 14:32:57 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id z1so7656426wrt.3 for ; Sat, 26 Sep 2020 14:32:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=OybwSjx477A1L5ryGyugpej9EqrdVCq1vXQ4tzYvW/A=; b=ba3/e6/QNJJU/MIi09nmzct3dx8BJkUmFXIacm2W+C+XwhzZFMtKHP2AIuPUMOVQyS KqkcMLMOtvF8cJYhc/xfilaoRoUGKD4xVdCyq/UiVhpV3pnRr9uN1ZZjs7KExmTFGwvt VFF/1td6xGyXc5JmtlvJHlbFAyYG8+YiF0cEeroNN6xXusvsIj6794doi7kuieLugDZv GyDZbXMAUIYvL4hCJtWW5q2dXk7zBhNsaixdjj8dBwQ8rQA0aPgzbF9ZNVy1qNMzTFPI OIVbDRJyOHrBh6vSKd2DUoxirCXmfpYKCeAyzh1BgWM142vvKgNpq27FoEtuh4jj0bBL 8n5w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=OybwSjx477A1L5ryGyugpej9EqrdVCq1vXQ4tzYvW/A=; b=lzetZRcMHKbfy3aUyBDvPGaGdHbtM/zWXQuwTQPoIl8H34DU9TBNBggVytLcZJZYtr b937RPIK6XY3se2cazopXhKZvYEZwZewRlCAafm9PGjG45Mz//aHYfp3LWodY/9tR1Wz IANiGtmXKs9840dSheEcYKXCKxj63SAb+e6OjYMpEvaYqL3jwgJbuRLlz/Bi8sLFzc+c ZYL4poRrKCvKxHMzaq3lDJIw1ZTMzcPKCTo/V6eWwntX57XBjT/Spcu5495y8nVLh0Bf hjRMeZWqYz2HtuijB7DFqO1nhHwyaTSFQQ4ldfrzc3Sy5FezFFcJKp1k9ldYGNY8bgoQ o3TA== X-Gm-Message-State: AOAM531D7j4vBdgtisnZfJ0IAtm5SNftkUCcPk4cd+DNi/fa+pm932kB fvLyxz8pKzNMF6x2eVNVtLHBaSh+YD8= X-Google-Smtp-Source: ABdhPJz8aRSMZnHNMQq5Ui5KaR+mFIdaB4BVTy9f+ZIAPhzPJQ0pYC45tHxxktg4hA2NTHllu9fnMA== X-Received: by 2002:adf:ce01:: with SMTP id p1mr11221518wrn.61.1601155976046; Sat, 26 Sep 2020 14:32:56 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id o15sm3622145wmh.29.2020.09.26.14.32.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 14:32:55 -0700 (PDT) Message-Id: <26ebeecb140e26938ecea04e2df2b8c000888162.1601155970.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Sat, 26 Sep 2020 21:32:46 +0000 Subject: [PATCH v2 07/10] cmake (Windows): complain when encountering an unknown compiler Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Eric Sunshine , Johannes Schindelin , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin We have some custom handling regarding the link options, which are specific to each compiler. Therefore: let's not just continue without setting the link options if configuring for a currently unhandled compiler, but error out. Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 2 ++ 1 file changed, 2 insertions(+) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 5a4e0ccb01..d21849b730 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -620,6 +620,8 @@ if(WIN32) target_link_options(common-main PUBLIC -municode -Wl,-nxcompat -Wl,-dynamicbase -Wl,-entry:wmainCRTStartup -Wl,invalidcontinue.obj) elseif(CMAKE_C_COMPILER_ID STREQUAL "MSVC") target_link_options(common-main PUBLIC /IGNORE:4217 /IGNORE:4049 /NOLOGO /ENTRY:wmainCRTStartup /SUBSYSTEM:CONSOLE invalidcontinue.obj) + else() + message(FATAL_ERROR "Unhandled compiler: ${CMAKE_C_COMPILER_ID}") endif() elseif(UNIX) target_link_libraries(common-main pthread rt) From patchwork Sat Sep 26 21:32:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derrick Stolee via GitGitGadget X-Patchwork-Id: 11801685 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E9C56139A for ; Sat, 26 Sep 2020 21:33:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CD00C23772 for ; Sat, 26 Sep 2020 21:33:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="o/V0w2tu" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728332AbgIZVdG (ORCPT ); Sat, 26 Sep 2020 17:33:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727860AbgIZVdB (ORCPT ); Sat, 26 Sep 2020 17:33:01 -0400 Received: from mail-wr1-x443.google.com (mail-wr1-x443.google.com [IPv6:2a00:1450:4864:20::443]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2442CC0613D8 for ; Sat, 26 Sep 2020 14:32:58 -0700 (PDT) Received: by mail-wr1-x443.google.com with SMTP id z4so7672357wrr.4 for ; Sat, 26 Sep 2020 14:32:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=vyLvrpHfDqe4agokkpcNOrP/sTPDYeWnNvNcWxUJ/E0=; b=o/V0w2tuCdW/NUyglXoDYzhIJ2+ffKg/JL6u3A9Tqt5e3tBPTQ6707AX7WSegGd6+p 0uaWant5bOnySUXpjcsfhua4TraSkW7H+37umtjoU1s1moAAFPv4ZUMPebPdnlUkklFJ oehpOMsYuL1gAqZf+2nNN5yCI80GH1AyTPAyfsZV6d2lAWCqsCa08NiS064UhBp2Wyxi HwmpWwR3+quEGfKYVcXCTYiHIPvTwXWhkn+SRnR1wgjRBVmL7Qh3YniP9gSGxtaVEhCW wklDQ/MHtFUpevczaR2eUsUtWMLpSnLmR0e5iOsmY/SpQc+NNDrLgz21ynKOfpFxLMWy ipzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=vyLvrpHfDqe4agokkpcNOrP/sTPDYeWnNvNcWxUJ/E0=; b=Y5hqjO/lmrNC9P/8abYAry0DQAyqd00qeXrPnoEYMa0bPd/PGG3peyF+TFMnxkJsPe rq5cKXoMl1XScr9a50Uqsew/hYei1Rjgk4lQmgquMIfvsS68HLeDBawXHCiSsxmRZD6u VvXBnqcExhSwuy0DAAnblTrM+1uJu7srSrhf7mj1gfeqwYll8DBTNTdUzc2DMAFAjd3j T2jxfNifPor/q77I7Vjl/hzhKMVlmRYtOJZ0rz13WWC54O/klEECKQ+bjELqGJ/QJWOl UH0/maBgUbhOjtpH5KtORwgmo9CKPayIfSLVUXy4KJRQKkVmrKjOpZWQSGfxpG8ePyXG Sfdg== X-Gm-Message-State: AOAM533uDfVvVxrjuN05k5Jm/tcNnKcSoy/tmVlYUULNkK1G0oMpBCD2 gDxpjW47HdpcjhdWPIgcgbixCtJR9ZA= X-Google-Smtp-Source: ABdhPJy3WRO4blTBZKY5aPQ6uYkQqCt1Ti9X1sCycRCpWKEZhvUYnP9HCPGX0Y2sBu3IiRFdgLPXYw== X-Received: by 2002:adf:efc9:: with SMTP id i9mr11431896wrp.187.1601155976748; Sat, 26 Sep 2020 14:32:56 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id f16sm7549179wrp.47.2020.09.26.14.32.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 14:32:56 -0700 (PDT) Message-Id: <3587ee5e8d119b19fb3a4ff626c092acd5bd35ef.1601155970.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Sat, 26 Sep 2020 21:32:47 +0000 Subject: [PATCH v2 08/10] cmake (Windows): initialize vcpkg/build dependencies automatically Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Eric Sunshine , Johannes Schindelin , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin The idea of having CMake support in Git's source tree is to enable contributors on Windows to start contributing with little effort. To that end, we just added some sensible defaults that will let users open the worktree in Visual Studio and start building. This expects the dependencies (such as zlib) to be available already, though. If they are not available, we expect the user to run `compat/vcbuild/vcpkg_install.bat`. Rather than requiring this step to be manual, detect the situation and run it as part of the CMake configuration step. This concludes our journey to make it as effortless as possible to start developing Git in Visual Studio: all the developer needs to do is to clone Git's repository, open the worktree via `File>Open>Folder...` and wait for CMake to finish configuring. Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index d21849b730..1eaeb8b8e0 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -42,6 +42,10 @@ cmake_minimum_required(VERSION 3.14) set(CMAKE_SOURCE_DIR ${CMAKE_CURRENT_LIST_DIR}/../..) if(WIN32) set(VCPKG_DIR "${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg") + if(NOT EXISTS ${VCPKG_DIR}) + message("Initializinge vcpkg and building the Git's dependencies (this will take a while...)") + execute_process(COMMAND ${CMAKE_SOURCE_DIR}/compat/vcbuild/vcpkg_install.bat) + endif() list(APPEND CMAKE_PREFIX_PATH "${VCPKG_DIR}/installed/x64-windows") # In the vcpkg edition, we need this to be able to link to libcurl From patchwork Sat Sep 26 21:32:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derrick Stolee via GitGitGadget X-Patchwork-Id: 11801683 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4DD8C139A for ; Sat, 26 Sep 2020 21:33:06 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 31FCC23772 for ; Sat, 26 Sep 2020 21:33:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ttFiWGoo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728284AbgIZVdF (ORCPT ); Sat, 26 Sep 2020 17:33:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58800 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727814AbgIZVdB (ORCPT ); Sat, 26 Sep 2020 17:33:01 -0400 Received: from mail-wr1-x441.google.com (mail-wr1-x441.google.com [IPv6:2a00:1450:4864:20::441]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAA75C0613D9 for ; Sat, 26 Sep 2020 14:32:58 -0700 (PDT) Received: by mail-wr1-x441.google.com with SMTP id e16so7677756wrm.2 for ; Sat, 26 Sep 2020 14:32:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=kPwKcxGrRvsZn7FWly9EDeX7JTF/jA86riQcfqmFzIg=; b=ttFiWGooJ90OuQLAyBFVHjzuX6e2hurJb/vRDCv8IZ/R9hwtohUOyR/O+gHftIAspP aN+y5jZASk7O46nFdnr+YyCPNx4SW9iuEr+7txbDTJccUG98ciUqOpB2a9gjkRuhPcPm nAoEsj6BGpiKKXaMCaTBt5kSsekQcJoLUD7WquDVG5cjKp4safG0U/SP3MAG5R+eefrG eDgn5rGLR0tnZiQ51NH5j3hoL+eju8ut6I5m6yDuVTcecXXwMKdoI95jv7m5ZP4a3b5j TGJYDzhdn7rWPVaOJlFMXsln5eCLeMB5iMX+Ighocmwz7FgxgdU7rTOjbtQP/QVgvA4E 8y3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=kPwKcxGrRvsZn7FWly9EDeX7JTF/jA86riQcfqmFzIg=; b=HzunovFxWySBB7CS4HxN1SGncU9RSSRtlfJzu2CLh5AkLnYSQJse8arIa3JwMT6lH3 TMpBbr8WuUPfCr/nrD1b7IWlBNJikp6X/PL5+GMep0hs1tOxcXpThGuChxldpiyHQqoN 9dqji5QlNWkToKcPOhQPVG+HNskqv3NrKkp14Ry3L4bIvwyYmhKyKtZdwRphACrdobBf lwNMdnL5zXjSMvYpHSJgakYW4MWcuzThTrXn7O+0KsbMDkNHzVuq5IsSN9v6linPLFJK lGBjkeHwy+xkcJqvtqDRG5lc56tAYdMikltCQpgGxFYRLnfA6x6z06oaUcDcIWhRggIh a3yg== X-Gm-Message-State: AOAM533piegq2lEoBGrpvbjzBY3q/0MQg5MhUBRf2KQ9TxiuOJk6eZoP irjkpFxYD7ncQBJ0p2js64sj06xoccQ= X-Google-Smtp-Source: ABdhPJycRvYkpDPOrXB+eStP7Dv/u0P/3tVdoLONpAPQMzsps67WUITpF8EHEC96EPTgg5FMKbNhcg== X-Received: by 2002:a05:6000:124d:: with SMTP id j13mr11610065wrx.182.1601155977425; Sat, 26 Sep 2020 14:32:57 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id f14sm8027466wrv.72.2020.09.26.14.32.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 14:32:57 -0700 (PDT) Message-Id: <68a7d984ec225f08486a4faf2b8d5bd2df2d5083.1601155970.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Johannes Schindelin via GitGitGadget" Date: Sat, 26 Sep 2020 21:32:48 +0000 Subject: [PATCH v2 09/10] cmake (Windows): recommend using Visual Studio's built-in CMake support Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Eric Sunshine , Johannes Schindelin , Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin It is a lot more convenient to use than having to specify the configuration in CMake manually (does not matter whether using the command-line or CMake's GUI). While at it, recommend using `contrib/buildsystems/out/` as build directory also in the part that talks about running CMake manually. Helped-by: Junio C Hamano Signed-off-by: Johannes Schindelin --- contrib/buildsystems/CMakeLists.txt | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/contrib/buildsystems/CMakeLists.txt b/contrib/buildsystems/CMakeLists.txt index 1eaeb8b8e0..de92e4fe2d 100644 --- a/contrib/buildsystems/CMakeLists.txt +++ b/contrib/buildsystems/CMakeLists.txt @@ -4,17 +4,25 @@ #[[ -Instructions to run CMake: +Instructions how to use this in Visual Studio: -cmake `relative-path-to-CMakeLists.txt` -DCMAKE_BUILD_TYPE=Release -Eg. -From the root of git source tree - `cmake contrib/buildsystems/ ` -This will build the git binaries at the root +Open the worktree as a folder. Visual Studio 2019 and later will detect +the CMake configuration automatically and set everything up for you, +ready to build. You can then run the tests in `t/` via a regular Git Bash. -For out of source builds, say build in 'git/git-build/' - `mkdir git-build;cd git-build; cmake ../contrib/buildsystems/` -This will build the git binaries in git-build directory +Note: Visual Studio also has the option of opening `CMakeLists.txt` +directly; Using this option, Visual Studio will not find the source code, +though, therefore the `File>Open>Folder...` option is preferred. + +Instructions to run CMake manually: + + mkdir -p contrib/buildsystems/out + cd contrib/buildsystems/out + cmake ../ -DCMAKE_BUILD_TYPE=Release + +This will build the git binaries in contrib/buildsystems/out +directory (our top-level .gitignore file knows to ignore contents of +this directory). Possible build configurations(-DCMAKE_BUILD_TYPE) with corresponding compiler flags From patchwork Sat Sep 26 21:32:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Derrick Stolee via GitGitGadget X-Patchwork-Id: 11801681 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9FDF5618 for ; Sat, 26 Sep 2020 21:33:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 83F0D23719 for ; Sat, 26 Sep 2020 21:33:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="WPdYf/wV" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728121AbgIZVdE (ORCPT ); Sat, 26 Sep 2020 17:33:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727848AbgIZVdB (ORCPT ); Sat, 26 Sep 2020 17:33:01 -0400 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8A9E4C0613DA for ; Sat, 26 Sep 2020 14:32:59 -0700 (PDT) Received: by mail-wm1-x343.google.com with SMTP id s13so2652917wmh.4 for ; Sat, 26 Sep 2020 14:32:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=fLx/oqN4eboVCzSUB4omppsZm0evzi7MY+4v/FyZl7s=; b=WPdYf/wV3oOuRjxWPwqednQBenzRdkPcx55KHJvkWAchkhUs6xQKz+oiv4BnOBFW0b oXTyAGypX2oLDv8skdZXaiQh3duEGdFwAaF9UhWjP4tBqt2WWRy9+ppjU7Uy+R93lKvj iJRYHN3VFtK9PCxSx4f9pC6nJba2yKQHakPkaRmrBjwygFvpBnp+y/DxagJAtqeNqywy Mbq+39qLmza9Yl0IPDM1Z/dn7XEN7nXms13KcdMaACoMiFqziypfqzZufXwGthj4J4jf UJjWwvzcDYs5t/SMynoTTnqgElodL1aa0MObXRlbvzmpeqAmMEZzSaD3F4uOrjMOvpIs Spiw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=fLx/oqN4eboVCzSUB4omppsZm0evzi7MY+4v/FyZl7s=; b=tNztxExh0h9ILXJWnTl9hYHVTz3M6Oxv/euV7nhqgMvje/2QjAS7BtmnCa3mcDt0V+ m562AyyHwmb3p0YUMVUkJugRsaMG3P7/dBoQfWFL4181Hsjt1Ow8xkgLKxXwWqEc0mEi K/4Ho3/FzCeMxvXmwE1rUv43T2sJVMe3tTnJ/x9S6560Azv6k1suIHNdy391Dwvpruqs aSCZLDox9tGRGX6MjtB++hcm1yqgxNU6AMO+op4tNWCGWyC1/cKpXGelJJEF+ULRTIuW dJdoXa91IilpvMrl3hBUTC7O95LVK1QKm+tGhJIYG+LLCdjJ1p2E6n8AnV6+ZaNM8cjC Syvw== X-Gm-Message-State: AOAM532IbuTUVUVlpvcncjQZGeqc+Miu0qF/f8IN4WRdgM6Ns4mQ0dD/ 1t5gMUDK1ZyWnxFcVExZWHA39zsoxSE= X-Google-Smtp-Source: ABdhPJxIkDYaW/9Vw5LrmotWTk9HvCOQYM9/+pKYNF4P0Pl19aX3Mzwa5PZLp4U3nHomZcv9MHSXmw== X-Received: by 2002:a1c:480a:: with SMTP id v10mr3902564wma.141.1601155978165; Sat, 26 Sep 2020 14:32:58 -0700 (PDT) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id a81sm4067053wmf.32.2020.09.26.14.32.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 26 Sep 2020 14:32:57 -0700 (PDT) Message-Id: <152705bbc6a105411d0be0f76b18757c8ab0f893.1601155970.git.gitgitgadget@gmail.com> In-Reply-To: References: From: "Junio C Hamano via GitGitGadget" Date: Sat, 26 Sep 2020 21:32:49 +0000 Subject: [PATCH v2 10/10] hashmap_for_each_entry(): workaround MSVC's runtime check failure #3 Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Sibi Siddharthan , =?utf-8?b?xJBvw6Bu?= =?utf-8?b?IFRy4bqnbiBDw7RuZw==?= Danh , SZEDER =?utf-8?b?R8OhYm9y?= , Eric Sunshine , Johannes Schindelin , Johannes Schindelin , Junio C Hamano Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Junio C Hamano The OFFSETOF_VAR(var, member) macro is implemented in terms of offsetof(typeof(*var), member) with compilers that know typeof(), but its fallback implemenation compares &(var->member) and (var) and count the distance in bytes, i.e. ((uintptr_t)&(var)->member - (uintptr_t)(var)) MSVC's runtime check, when fed an uninitialized 'var', flags this as a use of an uninitialized variable (and that is legit---uninitialized contents of 'var' is subtracted) in a debug build. After auditing all 6 uses of OFFSETOF_VAR(), 1 of them does feed a potentially uninitialized 'var' to the macro in the beginning of the for() loop: #define hashmap_for_each_entry(map, iter, var, member) \ for (var = hashmap_iter_first_entry_offset(map, iter, \ OFFSETOF_VAR(var, member)); \ var; \ var = hashmap_iter_next_entry_offset(iter, \ OFFSETOF_VAR(var, member))) We can work around this by making sure that var has _some_ value when OFFSETOF_VAR() is called. Strictly speaking, it invites undefined behaviour to use NULL here if we end up with pointer comparison, but MSVC runtime seems to be happy with it, and most other systems have typeof() and don't even need pointer comparison fallback code. Signed-off-by: Junio C Hamano Signed-off-by: Johannes Schindelin --- hashmap.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hashmap.h b/hashmap.h index ef220de4c6..b011b394fe 100644 --- a/hashmap.h +++ b/hashmap.h @@ -449,7 +449,8 @@ static inline struct hashmap_entry *hashmap_iter_first(struct hashmap *map, * containing a @member which is a "struct hashmap_entry" */ #define hashmap_for_each_entry(map, iter, var, member) \ - for (var = hashmap_iter_first_entry_offset(map, iter, \ + for (var = NULL, /* for systems without typeof */ \ + var = hashmap_iter_first_entry_offset(map, iter, \ OFFSETOF_VAR(var, member)); \ var; \ var = hashmap_iter_next_entry_offset(iter, \