From patchwork Mon Apr 15 11:50:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Thomas Schwinge X-Patchwork-Id: 1923701 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.a=rsa-sha256 header.s=20230601 header.b=KjCgCXht; dkim-atps=neutral Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=2620:52:3:1:0:246e:9693:128c; helo=server2.sourceware.org; envelope-from=gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=patchwork.ozlabs.org) Received: from server2.sourceware.org (server2.sourceware.org [IPv6:2620:52:3:1:0:246e:9693:128c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4VJ59F6rD5z1yXv for ; Mon, 15 Apr 2024 21:51:12 +1000 (AEST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 5638F3858C41 for ; Mon, 15 Apr 2024 11:51:10 +0000 (GMT) X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mail-wr1-x42f.google.com (mail-wr1-x42f.google.com [IPv6:2a00:1450:4864:20::42f]) by sourceware.org (Postfix) with ESMTPS id 8F0323858D32 for ; Mon, 15 Apr 2024 11:50:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8F0323858D32 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=baylibre.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 8F0323858D32 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a00:1450:4864:20::42f ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713181848; cv=none; b=UqHs8V9FXuZJC3s+/kUE1rK+lx7j+QpeBIhMa5yXMemateKBN+gUI4EobSqEeeT8HSF9paGvRZgimLgABH4hGDlSKE+8KY702FIQTIQOyhiyDUx4KU6RQ3nQnLHttCpjTwA4KKFUGzRSGfvahRrAllD+snIUahIRAUCmJFgP6pU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1713181848; c=relaxed/simple; bh=D9VRme1sKlcXk2wWBu+1qI2DciNW22m/ny71R9UGtHw=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=PmFVvmLnFA1ncFKjZ1sCztjhpXGQH9tjfgho6oDLDy9fcAxw+xaivDcLRdSjSOtR1Alv58UlZ+AWzNji/rvxuZaL4CmDLsIRRLCp7ssGqB/OM9trEnonulidRYJMDbAi5NIa4Pql11VGvu9KAFeNaC54IiY2mBNsIkqyhQLZIw4= ARC-Authentication-Results: i=1; server2.sourceware.org Received: by mail-wr1-x42f.google.com with SMTP id ffacd0b85a97d-346f4266e59so2359818f8f.3 for ; Mon, 15 Apr 2024 04:50:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1713181844; x=1713786644; darn=gcc.gnu.org; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=B8iZXHs3uQAadFMB0OZD2s6nzipOx8/pqehOh3rMpMo=; b=KjCgCXhtJvovgBDtRGQtnyDfZfzgvZOEVBhjXlgizdWe1daJXmhO/uiVVDz/zDhTYz 47ENFqtgYebjFNRjlpElyp36tlRe4tWHOFEFbjvNSeym27MoKERs3Sowq+pNcP771q2D 28EvvK48RUxEIWHjQJXLSO1AMAs7fYNcp5KmCj89psCgas0MdOODtQ9+KZ9N6qGyHWAd p/QguCDu9ihgcos6l7eh52+kppotwMc1zVYlCoUT81gpEkd+ILZ/osbk5Vq7Zf+7tOee TTY+SqV/Q4WMzWkqcdwYpThp7GLa2lzNIEgDg1DiD8fzHKgSvnl7BLJGI21R6pJifFbV FlZw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1713181844; x=1713786644; h=mime-version:message-id:date:user-agent:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=B8iZXHs3uQAadFMB0OZD2s6nzipOx8/pqehOh3rMpMo=; b=hQPOQTs4R3+k76XuDzKC4Dt6LGBu4SnXz1qJzTrknXTl2yVruZM+bj6RHsiIbHz99i Pizov8SzfuJFFpNeJbPlJQXhzt7rCo1Sy/D9XWFBPoOcATt6T/HaMAmYRHjFas0ffDb9 KiX/RsjAmBfeZr9IZIuEirpAFMX1ikifYj+ad4W7fXp1cfJK8FSH6VQ5B2Zy2zgYroqY 5UunjDM5n4THuV+Qj33nX+bnvsloHLGLI+A33Af12813vFQ1N8g5oaq82mU1eer691vk XRGwuR5/GmeGuxRtlX1w3cRbiIfELC4CnQVdG10Rvmwmwz1DLXNZIaabUelPWeTi4aJ5 wI1g== X-Forwarded-Encrypted: i=1; AJvYcCVBWuAjiTpGu5W+Vv0lhDCm5FllI+ujguXf3rQptg9zMDezPv8IdbzmgpCwqqrRzh8bL2vVFrVeP64lANxTlZu+0qZIGS1Syg== X-Gm-Message-State: AOJu0YxyHeBc5g7oGL7+bxEnd7UtbXMZ789aAotpMzUt+iTnFU2yqnli eajPsQB3er/BhG+kBWgu6NMl9w6IyeVVRybdOFHIp1Ei5Mkp3EAysWGlVprNdbg= X-Google-Smtp-Source: AGHT+IHMZDenatYcvWdNaRgQKMy2oSOYr+vo4da4IPMLP7nAwKR0YZbVof75W8DAxI6U5+2dX54hcQ== X-Received: by 2002:a5d:570b:0:b0:343:7884:fb52 with SMTP id a11-20020a5d570b000000b003437884fb52mr6904577wrv.50.1713181844241; Mon, 15 Apr 2024 04:50:44 -0700 (PDT) Received: from euler.schwinge.homeip.net (p200300c8b70ce600fbf8323f8abe0da4.dip0.t-ipconnect.de. [2003:c8:b70c:e600:fbf8:323f:8abe:da4]) by smtp.gmail.com with ESMTPSA id r9-20020adff109000000b00341de3abb0esm11834331wro.20.2024.04.15.04.50.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 15 Apr 2024 04:50:43 -0700 (PDT) From: Thomas Schwinge To: Pierre-Emmanuel Patry , gcc-patches@gcc.gnu.org, gcc-rust@gcc.gnu.org Cc: Arthur Cohen Subject: build: Don't check for host-prefixed 'cargo' program (was: [PATCH] build: Check for cargo when building rust language) In-Reply-To: <87edb6ev31.fsf@euler.schwinge.ddns.net> References: <20240408163337.303317-2-pierre-emmanuel.patry@embecosm.com> <87edb6ev31.fsf@euler.schwinge.ddns.net> User-Agent: Notmuch/0.30+8~g47a4bad (https://notmuchmail.org) Emacs/29.2 (x86_64-pc-linux-gnu) Date: Mon, 15 Apr 2024 13:50:30 +0200 Message-ID: <87a5luetfd.fsf@euler.schwinge.ddns.net> MIME-Version: 1.0 X-Spam-Status: No, score=-11.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gcc-patches-bounces+incoming=patchwork.ozlabs.org@gcc.gnu.org Hi! On 2024-04-15T13:14:42+0200, I wrote: > On 2024-04-08T18:33:38+0200, pierre-emmanuel.patry@embecosm.com wrote: >> The rust frontend requires cargo to build some of it's components, > > In GCC upstream still: 's%requires%is going to require'. ;-) > >> it's presence was not checked during configuration. > > After confirming the desired semantics/diagnostics, I've now pushed this > to trunk branch in commit 3e1e73fc99584440e5967577f2049573eeaf4596 > "build: Check for cargo when building rust language". > > > I now wonder: instead of 'AC_CHECK_TOOL', shouldn't this use > 'AC_CHECK_PROG'? (We always want plain 'cargo', not host-prefixed > 'aarch64-linux-gnu-cargo' etc., right?) I'll look into changing this. OK to push "build: Don't check for host-prefixed 'cargo' program", see attached? Grüße Thomas From 913be0412665d02561f8aeb999860ce8d292c61e Mon Sep 17 00:00:00 2001 From: Thomas Schwinge Date: Mon, 15 Apr 2024 13:33:48 +0200 Subject: [PATCH] build: Don't check for host-prefixed 'cargo' program Follow-up to commit 3e1e73fc99584440e5967577f2049573eeaf4596 "build: Check for cargo when building rust language": On 2024-04-15T13:14:42+0200, I wrote: > I now wonder: instead of 'AC_CHECK_TOOL', shouldn't this use > 'AC_CHECK_PROG'? (We always want plain 'cargo', not host-prefixed > 'aarch64-linux-gnu-cargo' etc., right?) I'll look into changing this. * configure: Regenerate. config/ * acx.m4 (ACX_PROG_CARGO): Use 'AC_CHECK_PROGS'. --- config/acx.m4 | 3 +-- configure | 64 ++++++--------------------------------------------- 2 files changed, 8 insertions(+), 59 deletions(-) diff --git a/config/acx.m4 b/config/acx.m4 index 3c5fe67342e..c45e55e7f51 100644 --- a/config/acx.m4 +++ b/config/acx.m4 @@ -427,8 +427,7 @@ fi # Test for Rust # We require cargo and rustc for some parts of the rust compiler. AC_DEFUN([ACX_PROG_CARGO], -[AC_REQUIRE([AC_CHECK_TOOL_PREFIX]) -AC_CHECK_TOOL(CARGO, cargo, no) +[AC_CHECK_PROGS(CARGO, cargo, no) if test "x$CARGO" != xno; then have_cargo=yes else diff --git a/configure b/configure index dd96445ac4a..e254aa132b5 100755 --- a/configure +++ b/configure @@ -5818,10 +5818,10 @@ else have_gdc=no fi - -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cargo", so it can be a program name with args. -set dummy ${ac_tool_prefix}cargo; ac_word=$2 +for ac_prog in cargo +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CARGO+:} false; then : @@ -5837,7 +5837,7 @@ do test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_CARGO="${ac_tool_prefix}cargo" + ac_cv_prog_CARGO="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi @@ -5857,59 +5857,9 @@ $as_echo "no" >&6; } fi -fi -if test -z "$ac_cv_prog_CARGO"; then - ac_ct_CARGO=$CARGO - # Extract the first word of "cargo", so it can be a program name with args. -set dummy cargo; ac_word=$2 -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } -if ${ac_cv_prog_ac_ct_CARGO+:} false; then : - $as_echo_n "(cached) " >&6 -else - if test -n "$ac_ct_CARGO"; then - ac_cv_prog_ac_ct_CARGO="$ac_ct_CARGO" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CARGO="cargo" - $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi + test -n "$CARGO" && break done - done -IFS=$as_save_IFS - -fi -fi -ac_ct_CARGO=$ac_cv_prog_ac_ct_CARGO -if test -n "$ac_ct_CARGO"; then - { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CARGO" >&5 -$as_echo "$ac_ct_CARGO" >&6; } -else - { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 -$as_echo "no" >&6; } -fi - - if test "x$ac_ct_CARGO" = x; then - CARGO="no" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} -ac_tool_warned=yes ;; -esac - CARGO=$ac_ct_CARGO - fi -else - CARGO="$ac_cv_prog_CARGO" -fi +test -n "$CARGO" || CARGO="no" if test "x$CARGO" != xno; then have_cargo=yes -- 2.34.1