From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id IYXILeFvMWq1dQoAWB0awg (envelope-from ) for ; Tue, 16 Jun 2026 11:46:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1781624801; bh=gaRImciu9JQ/aahe3MrHG7lQ0V9G+QRq1T8O9iuIees=; h=Date:Subject:To:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=iSltv5wZVttMNoybJzPR2pC9d/U8D2BlDocDtwtLNv6HLq9InD5bCwnsLh0wZz+pW Boq3oDTu0hujAlkViHZjbvSOfZ8wn+QcRjJzK0MXHAd9uf8tu1ioDiMAuT5zfLW2f5 8T/ah8P54mQcCF9jzbsTH1tdJKr9Pa/tLRu9MWGw= Received: by simark.ca (Postfix, from userid 112) id B294B1E098; Tue, 16 Jun 2026 11:46:41 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-5.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham autolearn_force=no version=4.0.1 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=IFXwVwF5; dkim-atps=neutral Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 0790C1E070 for ; Tue, 16 Jun 2026 11:46:41 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 33C4E48F6653 for ; Tue, 16 Jun 2026 15:46:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 33C4E48F6653 Authentication-Results: sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=IFXwVwF5 Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id C0E7948F66D9 for ; Tue, 16 Jun 2026 15:46:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C0E7948F66D9 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=simark.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=simark.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org C0E7948F66D9 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=158.69.221.121 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781624776; cv=none; b=jFgNksqcYjthrj6TsUsEgaHGWmoLSnyZ7/4BxlzdgNN17VrE2D6yl9BK1ZqUrednq6nI36FNj+lxxF3w45GcDbdu1sgAMgr6s/z2/6aZnSd/wvFijOPR4klJZSW9rP9jECty8hFuQ0utFcoyYf7O0PvyffnQlcGiT5KTQ3fB/Us= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1781624776; c=relaxed/simple; bh=gaRImciu9JQ/aahe3MrHG7lQ0V9G+QRq1T8O9iuIees=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=Q5WnYTCXFqv5IlQkGQ/4+5eDFMFA0QZJPBEGHP5WzLF+F8JxWKS2xFLAJSZUoU1eL+XWjtXtu39Wb/AJ1eiU4qCtlE2QS4u3puamkog5zk4izCKYzRTshccroQ9BWdZK4F1ChyEMltfEUHOV4I+Ie9FxBPrCEy1py9/ceCiUKj4= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (1024-bit key, unprotected) header.d=simark.ca header.i=@simark.ca header.a=rsa-sha256 header.s=mail header.b=IFXwVwF5 DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C0E7948F66D9 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=simark.ca; s=mail; t=1781624776; bh=gaRImciu9JQ/aahe3MrHG7lQ0V9G+QRq1T8O9iuIees=; h=Date:Subject:To:References:From:In-Reply-To:From; b=IFXwVwF5km+T2ZbeLOBtH1DZHIlUlHLnYNutL2cVM26cgSEXn6oST34+tVXiBTePs TJ/6jQj1FTDaD29LSFuMORLcLQfwGar1hCrBRTJ44kt+9q3n/V0D8x9GcEdEQTevZU 5vqwCOU/C5SSuxHECj9n4NiFUw0Z2vyCh9BVD330= Received: by simark.ca (Postfix) id 578F01E070; Tue, 16 Jun 2026 11:46:16 -0400 (EDT) Message-ID: Date: Tue, 16 Jun 2026 11:46:15 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] [pre-commit] Stop using deprecated language script To: Tom de Vries , gdb-patches@sourceware.org References: <20260616092346.3242305-1-tdevries@suse.de> <88bdbbf9-7ff3-4eb6-832a-1df7c785458f@suse.de> Content-Language: fr From: Simon Marchi In-Reply-To: <88bdbbf9-7ff3-4eb6-832a-1df7c785458f@suse.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~public-inbox=simark.ca@sourceware.org On 6/16/26 11:32 AM, Tom de Vries wrote: > On 6/16/26 3:46 PM, Simon Marchi wrote: >> On 6/16/26 5:23 AM, Tom de Vries wrote: >>> In v4.4.0, pre-commit renamed language script to unsupported_script. >>> >>> The rename was done to stress that pre-commit doesn't provide an environment >>> for the script to run in [1]. >>> >>> The language script is now a deprecated alias for unsupported_script, and the >>> plan seems to be to initially produce a deprecation warning, and eventually >>> remove support for the alias completely. >>> >>> Start using the new name: unsupported_script. >>> >>> Furthermore, the check-include-guards hook uses language python, and indeed it >>> uses a python script, but it doesn't really need a virtual environment. It >>> imports modules fnmatch, re, sys and typing, all of which are available in >>> python 3.10 and later, which is the environment pre-commit itself requires >>> (because we require pre-commit v4.5.1 or later, and pre-commit requires python >>> 3.10 since v4.4.0). So while we're at it, use unsupported_script for this >>> hook as well, reducing the amount of environments pre-commit has to manage. >>> >>> Tested using "pre-commit run --all-files" with python 3.10, as well as 3.13. >>> >>> [1] https://github.com/pre-commit/pre-commit/pull/3577 >> >> From reading the pre-commit doc, I didn't understand the difference >> between "unsupported_script" and "unsupported", did you? > > Not really. > > The difference seems to be that for unsupported_script "the entry should be a path relative to the root of the hook repository". > > Concretely, a hook like this using unsupported_script works: > ... > - id: bla > name: bla > language: unsupported > entry: sh -c "echo bla; exit 1" > ... > > Changing the language to unsupported_script gets us: "Executable `/data/vries/gdb/binutils-gdb.git/sh"` not found. > > To get the same effect, we need: > ... > - id: bla > name: bla > language: unsupported_script > entry: /usr/bin/sh -c "echo bla; exit 1" > ... > > Note that this version also works fine with language unsupported. > > The intent seems to be that unsupported_script is reserved for in-repo scripts, and unsupported is the fallback that supports anything else. Ok, make sense. LGTM then. Approved-By: Simon Marchi Simon