🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: linux.kernel.git
Article #827

Re: [PATCH] Makefile: pin cargo --target-dir to ./target

#827
From: Andy Koppe
Date: Mon, 19 Oct 2026 19:43
41 lines
13289 bytes
On Mon, 19 Oct 2026 at 17:07, Junio C Hamano <gitster@pobox.com> wrote:
> Andy Koppe <andy.koppe@gmail.com> writes:
> > The Makefile assumes that cargo places build artifacts under ./target.
> > That assumption breaks if the user has a custom target dir setting, e.g.
> > in their ~/.cargo/config.toml file or in the CARGO_TARGET_DIR env var.
> > This results in a link error due to failing to find the gitcore library
> > built with cargo.
> >
> > To fix this, pass '--target-dir target' to the cargo commands that build
> > gitcore. Add it directly to the recipes rather than to CARGO_ARGS, so
> > that it isn't lost if CARGO_ARGS is overridden.
>
> The change might make sense, but these areas are touched by other
> topics in flight.
>
> Given that they both appear on the same line as $(CARGO_ARGS)
> appears, I have to wonder if we want to instead just add a single
>
>     CARGO_ARGS += --target-dir target
>
> somewhere early that are unreleated to these individual rules?

The problem I see with that approach is that CARGO_ARGS looks like it
is intended for build preferences similar to CFLAGS or LDFLAGS that
could be overridden on the make command line, whereas the target dir
is a hard requirement of the subsequent link step.

I suppose `override CARGO_ARGS += --target-dir target` would avoid
that concern, but also set a trap because any subsequent modifications
of the variable without `override` would be quietly ignored.

The conflicting topic apparently is mh/rust-crate-subdir by Mike
Hommey, which moves things into a 'rust' subdirectory, but is looking
somewhat stalled:
https://lore.kernel.org/git/20260917060415.2986259-1-mh@glandium.org/

I'd of course be happy to reapply the --target-dir tweak here on top
of that if it does go ahead, or for Mike to just add it there.

Andy
Technical Details
Message-ID: <CAHWeT-Z5OhJLYx21V417DoL3xOQJj6viUzCm+04iDe0zu=jVWw@mail.gmail.com>
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-72440-linux-kernel-git=dewy.ru
References: <20261018205305.2634339-1-andy.koppe@gmail.com> <xmqq33u165dp.fsf@gitster.g>

Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!git+bounces-72440-linux-kernel-git=dewy.ru
From: andy.koppe@gmail.com (Andy Koppe)
Newsgroups: linux.kernel.git
Subject: Re: [PATCH] Makefile: pin cargo --target-dir to ./target
Date: Mon, 19 Oct 2026 20:43:24 +0100
Organization: Usenet Network
Message-ID: <CAHWeT-Z5OhJLYx21V417DoL3xOQJj6viUzCm+04iDe0zu=jVWw@mail.gmail.com>
References: <20261018205305.2634339-1-andy.koppe@gmail.com> <xmqq33u165dp.fsf@gitster.g>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Injection-Info: usenet.network;
	logging-data="3699955"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:bngeuJfV16/bA8yPO0GTSR1jxow= sha256:criKlq6gnfGiBQ36gfZJ+0dYFG8MsHjSlAQ0JiQZbXY=
	sha1:qCdj/QFrKtQrx6t5ja3bamoh4So= sha256:fxTkCYWI7mVWgIgWVaDL+k8zA7ZWCZLNDzM9ndo2cJU=
List-ID: <git.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
	by mail.dewy.ru (Postfix) with ESMTP id 7998F110AF2; Mon, 19 Oct 2026 22:51:36 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.948
X-Spam-Status: No, score=-1.948 tagged_above=-9999 required=6.31
	tests=[DCC_CHECK=1.1, DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1,
	DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001,
	FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25,
	MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001,
	SPF_PASS=-0.001] autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
	header.d=gmail.com
X-Received: from mail.dewy.ru ([127.0.0.1])
	by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
	with ESMTP id eXrOTyR3_Qvp;
	Mon, 19 Oct 2026 22:51:33 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=git+bounces-72440-linux-kernel-git=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> 
X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=gmail.com
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
	by mail.dewy.ru (Postfix) with ESMTPS id 34BA2110AAB; Mon, 19 Oct 2026 22:51:25 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92])
	by sea.lore.kernel.org (Postfix) with ESMTP id 5ABC846ACB; Mon, 19 Oct 2026 19:43:39 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-ARC-Seal: i=3; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1792439018;
	b=LqYdBRJzDBUkAbuFFRJaeMzm/iiim0mm8zQ4XSwGJpdZpat7k1CAdyl/syMP43xllVYm
	 EAeo+QVOt6xySS9FX8Ln3vdKkNZ+uVxI6J3S33M0rDoeY1SH8WudGVMOuK8UJbVHKfN6e
	 FHbj0nA+wKA3yWTFQPq6WQZw5A2JV6/npFu7HTNj2H6lRjh6HR/xjU8Fd9yZvxv2lsdbt
	 Qp469A+opKRWbx89Sl2vWa7e5OCdMxd9hAy6L5YmRTBT4MDNDtUiU2wKxgzFD+WS5lELV
	 BWEpBsaNzVSOevNi9Ex2wfB1KoQnr+vfH+EERwVpgNN7Eqmwj1ArydGkr7CsU+/TyJA==
X-ARC-Message-Signature: i=3; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792439018;
	h=X-Original-To:Received:DMARC-Filter:Received:DKIM-Signature:
	 X-Google-DKIM-Signature:X-Gm-Message-State:X-Gm-Gg:X-Received:
	 X-Mailing-List:List-Id:List-Post:List-Help:List-Subscribe:
	 List-Unsubscribe:List-Owner:Precedence:MIME-Version:References:
	 In-Reply-To:From:Date:X-Gm-Features:Message-ID:Subject:To:Cc:
	 Content-Type;
	bh=HoANQWyvBJNi90TVZH8eI55sg2XWI2+CtZ/tLg6JGlI=;
	b=bAcigEkyjc6UojfQMeRkYXDtWJEybjbQ9j7uBYR3XiaLbLHG3WjbApgVhnUyq8Q7oLHR
	 3l7gF5bsv07kXOMRJioIithdrc4Q1BcduSvcGvgaN9q1AxBwb5/vRBXpDZVkC7MCpPcA3
	 eV/RmVMLaw1r/Hu3HRKsCB8/pI/4iWrF9UJzj5Y3dbxLAnNZv5sj3oIH9d9qzVLJ9us1m
	 5WpCXEiH+RGQmSy8QCa0fYYLR4x8qrO88LWsV7VKvF6iYOq1k0Vj9KE5Wyh69kJPeoPKj
	 8KZB+FTim6YlgeeIKMC0w0FlSykVVYdsfObMNpKr1b2P1nQgWUqpd7+zw2wvnDSg7Bg==
X-ARC-Authentication-Results: i=3; smtp.subspace.kernel.org; 
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=EwZq97WE;
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1
X-Received: from localhost.localdomain (localhost [127.0.0.1])
	by smtp.subspace.kernel.org (Postfix) with ESMTP id 81F1B606A31F;
	Mon, 19 Oct 2026 19:43:38 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
	dkim=pass (2048-bit key, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=EwZq97WE
X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=209.85.167.177
X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass;
	t=1792439017;
	b=der0af4Gd+q+FlWbi4unkBN0DY4/oajyc6SdfpWlU82zbOfTp+Z2wkRHVZxkyz8S4Iu+
	 dYg86q/Vh9/z6x9SPjPRnT7q9W+4qvka89fQVaBcHDlxfS/cbvZni9jMpHqYyV4yvVpun
	 dIJ0L25Ui80EQGPKhH2NLELiRBVR+eeTWpmhyowHoCU9ZWFP1bvlBE1EzzTHGJ5WAvmUu
	 5Pq1bZ0V19r2XBqk1uCDHL2CIPTFLSd0mm76m8Ex7P0HRPEIzRvAdHdL8Av3HXtrHPVCg
	 v/RoAu/rOshJIz2yrJjHd8sBx6dB1YWNTPhR4ICM+8NEdVcmbqyb/vrz1/2CitwAYVg==
X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015;
	a=rsa-sha256; c=relaxed/relaxed; t=1792439017;
	h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature:
	 X-Gm-Message-State:X-Gm-Gg:X-Received:MIME-Version:References:
	 In-Reply-To:From:Date:X-Gm-Features:Message-ID:Subject:To:Cc:
	 Content-Type;
	bh=HoANQWyvBJNi90TVZH8eI55sg2XWI2+CtZ/tLg6JGlI=;
	b=Q8cAPtRfeEhXRU8huvqSZw1a1z2RzAsBdz9tjadQMCLVrRk8PGmJi0Zu58s4iLB1A5N8
	 jBdK/vbSok6YnY/yDrwqfC1e8ocWYb3hAHjlDSkWTM2sVtDsrMY1SX0WwXcKEx1iiFEqc
	 1zJ+CKo4CL+Fv3s/PP6lWB5uYYM4/kreH95eSKA9JOmy9kzrBtWmomXl7wvwJeKO8ueb3
	 ApGlcB/jR01pVabQuGED5WXcSWO/2tJXDEmamXCiSdDPqqY5pIl/3MsMTUQbXxQZYEHTz
	 074fLIu8gQZEfKek2+cic26TEUYvIoaHo0tOER7/ndyS5pCW1Cae/6EglkJ3axQX9tg==
X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; 
	dmarc=pass header.from=gmail.com;
	spf=pass smtp.mailfrom=gmail.com;
	dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20251104 header.b=EwZq97WE;
	arc=pass header.oldest-pass=0 smtp.remote-ip=209.85.167.177
X-Received: from mail-oi1-f177.google.com (mail-oi1-f177.google.com [209.85.167.177])
	(using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)
	 key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256)
	(No client certificate requested)
	by smtp.subspace.kernel.org (Postfix) with ESMTPS id 46362606A31A
	for <git@vger.kernel.org>; Mon, 19 Oct 2026 19:43:37 +0000 (UTC)
X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 46362606A31A
X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com
X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com
X-Received: by mail-oi1-f177.google.com with SMTP id 5614622812f47-53c156ba662so1410617b6e.1
        for <git@vger.kernel.org>; Mon, 19 Oct 2026 12:43:37 -0700 (PDT)
X-ARC-Seal: i=1; a=rsa-sha256; t=1792439016; cv=none;
        d=google.com; s=arc-20260327;
        b=KIbaEM75y06n2QciltGlghtc/nglStLe+7hRg5X8I1rSsDSof+02y45L76ntjTMcA0
         Xuq0FfTPU5XmYf6Z9ZAhU0RlsUhu04GdbBu/LX2m4CHUxO1Md4HwbH1HK5bjn9NY1VoN
         a1Rwkacl+CMmKYuNo/rbxEFLSR9NRV3GVsQSIDBK4yPzOEx3v1RLvgOYgrMZo5kuXMrb
         0pCU1ps6JYQe1KuwZNHmaq6P6subPLTWVSKa2pfTICPvBbE0HROOpFw2BYl69L6L8Am/
         3GR3t3KAinS6yss+Qk/8TpICuRlnxdIFWPMNoKKC1ht1Bib48avlKugzM5PHAfiJaSTW
         ANng==
X-ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327;
        h=cc:to:subject:message-id:date:from:in-reply-to:references
         :mime-version:dkim-signature;
        bh=HoANQWyvBJNi90TVZH8eI55sg2XWI2+CtZ/tLg6JGlI=;
        fh=Tczw0obM6Dp6WXaqRz6LMjv/5C+9GaR+vl22Gr1KDWM=;
        b=oitI4i51lv3LpOjPN1UGHZJ0KUMn9+lqS+gpVD08VnivxO7FREoezQHEx6azYVLDwT
         90YZqBFy4uTIccGk+fj2OPWyPoRKSf9WXt4enojfWrWL/XgSvHpxy2T7KNNbCOiqLQo0
         YdY5MT6GVp7d+Zc8pFiaKxjjkHM7Tgw4ibCnqMGGOpxt/G3ESvkZglnhMEUCGBX7p2hh
         B5+6Q6M4D8Ex4jT2FfJDjM3ltmi3Lmp9QRebm8D9bNMKivMvbiiI2GzYqhXYM4nRS65M
         w+JR9RBwMe7TOWcM8cqV6ScYFiHvAE1trErlvZnInNcWgSWQNQHbj7vqZBHwWKNUlU/h
         Ur7w==;
        darn=vger.kernel.org
X-ARC-Authentication-Results: i=1; mx.google.com; arc=none
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=gmail.com; s=20251104; t=1792439016; x=1793043816; darn=vger.kernel.org;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:from:to:cc:subject:date:message-id:reply-to
         :content-type;
        bh=HoANQWyvBJNi90TVZH8eI55sg2XWI2+CtZ/tLg6JGlI=;
        b=EwZq97WEjq33PCcvj6Rcys5OJc2PRHAA4PFruJ7+D7z3tzRRgE1DlLVBq5ROF2T6Tg
         OiHtSYdxGiU1LA2cxj6WOEt4QTtMyPdkpyllSMoyF4Ps/76Gppc7QECxcL3D89gJ/EE8
         tZt/BA8pXLaKrbEEkcIoV7Y+XN2ONEVuC0qvf7uY4VGho2f6hgHSn4uF4oEK6aBmDEHL
         1O8hF6yLBkbYXJLiP7e+tTISLxiiOVsr+qSsw+c75Eq8LgzNHSYrRYRUsL+eo+qYCvrA
         vqmZJt1lNYe6MIwclqlZ/CtnYzOVWChQiGctJlAdwptTHpJsHvMlGsl7cUBUG+kvznfb
         Yd0g==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20260707; t=1792439016; x=1793043816;
        h=content-type:cc:to:subject:message-id:date:from:in-reply-to
         :references:mime-version:x-gm-gg:x-gm-message-state:from:to:cc
         :subject:date:message-id:reply-to:content-type;
        bh=HoANQWyvBJNi90TVZH8eI55sg2XWI2+CtZ/tLg6JGlI=;
        b=hTMfMYKnD3Y0cyWuQjUOJLOwfmDtDDmbAZl8mw9HXVU0RaT93cy0Wxy8AQwPXqVMdM
         u2kOzbz0HTJKZjsSGsPXOLMHhzAS1BPwv5IrsqjwfZ4RxwHDnREhHXDcwy8b4BqOGByW
         3RpNthsRV7VnkaZNwHapN+SRfCsoxlKCk7GBAXBb6I27jsBbNqK7w4xCXZdu2eFTCDGy
         Ux6kXl67bje8M816FR4y7N7Plq46zophtDvrgOluo6QwRGEMxi0SDDq2ub9iK47JHx2R
         s81koHcL9cZ44qduc9Nh+V5QfZL4LlPWNF+9P2KECPGZlOrt540me4+06qdY9sQezJ+G
         uJoA==
X-Gm-Message-State: AFq9FYKTafcAIQpXrHxij9xO3A4L05HqCDw5w/cxwmKh38BxCd7SVtpI
	+sx/5rfeqxfIuiLXt8BRNLDJSCiOgIHigA+XZTa0jsWonNfx5lYGuwmUjjkHCmA3wfRlHZYUJpv
	XtHQILgrE1w1BpcMCKcaUJuKvKN2RoMw=
X-Gm-Gg: AYBFou1TzoIWM7xLT+/JpLF+4h0pEAjwBhtQq/xfDlLprvaf8Ap1NfuIQ4y7hQQJesG
	o3t/eSuX6q+DCzLpg+2By+/5hvp3uwVq4XOrUbebr/me3DDniywlx+FGZX5Oi16ki1dZFPcAPwl
	GIZmKznXr3ICnfrqzZODZSmm5m1Je+duSb+CVCzse43RJ455dgURzduj9buN+Y649z2Vs2c5eV4
	GB87KA4EIdUA4cu73z6Inm8ki2+bV91wY9ePcIqusUyqiXBzwB5p1BXfXcDRUikelnElYukwe2N
	y6QU6Op0DZg3VLnamy9s5+hrcBrdvZyQoiA4+8ctsos1hSBHkMO079qcesMFYlsX
X-Received: by 2002:a05:6808:c40a:b0:4ea:18f:649f with SMTP id
 5614622812f47-53cc5b5ba80mr6837204b6e.3.1792439016084; Mon, 19 Oct 2026
 12:43:36 -0700 (PDT)
X-Mailing-List: git@vger.kernel.org
X-List-Post: <mailto:git@vger.kernel.org>
X-List-Help: <mailto:git+help@vger.kernel.org>
X-List-Subscribe: <mailto:git+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:git+unsubscribe@vger.kernel.org>
X-List-Owner: <mailto:git+owner@vger.kernel.org>
X-Precedence: list
X-In-Reply-To: <xmqq33u165dp.fsf@gitster.g>
X-Gm-Features: AclHuK8BHLAx028PWwTe3DgitlHPqIvUWhB_9qheVb1FdXABvNevIjwY0vS2zJ4
X-Cc: git@vger.kernel.org, Patrick Steinhardt <ps@pks.im>, 
	"brian m . carlson" <sandals@crustytoothpaste.net>, Shardul Natu <snatu@google.com>, 
	Mike Hommey <mh@glandium.org>