Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp806528pxb; Tue, 14 Sep 2021 09:06:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzLwF4l+Tc4DYmeLxZa8h7bvJJ5T8tda2qiB6saXB100sa+wmii7RzvSnI4EUMcP2Eka2nE X-Received: by 2002:a2e:7d13:: with SMTP id y19mr16133558ljc.344.1631635602561; Tue, 14 Sep 2021 09:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631635602; cv=none; d=google.com; s=arc-20160816; b=MdPTvvLXgaqxJIStX6y37BhPoUMRpAl/JVGY2an8NUjQOpDzlm3XYrYUy+/tO+U36E NWefQC7rxBGaMZj9VNK24jKdMmHIKS0jEOWnf7omhjkHrCpMjgwnYdVR8Ya7wRLybfrZ rtOJqfa+79DGf7dzYA0KXXLwycnZG4tSS/K6We7OCTxZahEWKG+Nc4b/xLpRywzSUgWT SKrHqnmm8na6jNJkoVat0CommHv5vksG/m2XMZ217JYZ2smMV9Vjp/yPzAnfopgHlfIJ oGUVT0Kj1QunNKA08E2sywXgYSgbwFq5AFuX7eQuuav0qMs9mGz5eL0crGgBcL23NcFm nA4Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=YXb8s9wHEOlTn2wSRL6/2KhWgpd/77mtepjylKirHbY=; b=046EB1hImbOOAy0WZwW5BUXLekIW1Q6xkkD5sGSAmzkOQTNZjJgMJr06XytYmxX0iT ZGJIFake5DKsUlmM7cRUj9q2tNt/9hfHQFduKQJ0kU0Q5hoGRss8VASA891bCAwyojSr kZ+r2ozlPdgilVi6gQ7RsTLPSUc180sGorjM7rMl5CARUqXezUk/veE4hgfjuzg0l6IL CYgVd0NbmmGsiWEzQ22zMMPiO0rmsIrrCrDfIUWGScPImJjtytKjE9LgweJOFflr6IsR dJ6fMgH35a8+01EsycHx+rS/QiakhKp4Jt/SnTe+SEmWpAknYBhY1/FSlUa7GwA0ekQt EY4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PoeDqNqB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j18si17311874lfg.452.2021.09.14.09.06.11; Tue, 14 Sep 2021 09:06:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=PoeDqNqB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235216AbhINQCl (ORCPT + 99 others); Tue, 14 Sep 2021 12:02:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:57258 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234037AbhINQCh (ORCPT ); Tue, 14 Sep 2021 12:02:37 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 24E4061151; Tue, 14 Sep 2021 16:01:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631635280; bh=YvnFp+LTkAmgQGEWe/SBIyJmwTJ98eh4cA8SOGc7JFg=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=PoeDqNqBcSWSq1v+Ma1vPWkDVmsjzdnoNH6UUs+V6Q3jziaFY5UXhmF6yE+k8LOuV pDIwhVhEAeUXWFuhV5EeEvCu0y0iAINaXs+FMhZ25+5/eDn0gkyBgAhx6/AcGRtBPc 31mYGojmg8mqOzxoHcqd2Ulah1rFqBjib1XZWeJ5lzPbBLEYEMapC3jKYkDOHgpjkR LqMlFFUi3jwDRzRs1YHR1Nyn/M4GJVKCySeFzIh1e1MhE1vYXWNWDgjVlIaq0Qt3Q4 BzM1A+Kvw2V8cMZCtlJqdHDZao17Q0Xc+WLssKOlpqzZiP/Ifx5gUFIEprQGxpaP0d W3t5hV+r1gz+A== Subject: Re: [PATCH] gen_compile_commands: add missing sys import To: andreas@rammhold.de, Nick Desaulniers Cc: llvm@lists.linux.dev, linux-kernel@vger.kernel.org References: <20210914154441.1726853-1-andreas@rammhold.de> From: Nathan Chancellor Message-ID: <026a4e82-da46-a559-06d5-18cff798ad96@kernel.org> Date: Tue, 14 Sep 2021 09:01:17 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: <20210914154441.1726853-1-andreas@rammhold.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Andreas, On 9/14/2021 8:44 AM, andreas@rammhold.de wrote: > From: Andreas Rammhold > > The sys.exit was being used at multiple locations within the script but > never imported. This lead to the script exiting with a error instead of > with the nicely formatted (useful) error output. > > Signed-off-by: Andreas Rammhold > --- > scripts/clang-tools/gen_compile_commands.py | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/scripts/clang-tools/gen_compile_commands.py b/scripts/clang-tools/gen_compile_commands.py > index 0033eedce003e..1d1bde1fd45eb 100755 > --- a/scripts/clang-tools/gen_compile_commands.py > +++ b/scripts/clang-tools/gen_compile_commands.py > @@ -13,6 +13,7 @@ import logging > import os > import re > import subprocess > +import sys > > _DEFAULT_OUTPUT = 'compile_commands.json' > _DEFAULT_LOG_LEVEL = 'WARNING' > Thank you for the patch! Someone else submitted the exact same fix and it is now pending in the kbuild tree: https://git.kernel.org/masahiroy/linux-kbuild/c/776f04ca2c29f13d483a3effc0c27404fe901143 I am curious, how did you discover this? Did you hit one of those error paths? Cheers, Nathan