From patchwork Mon Mar 12 22:36:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Korsgaard X-Patchwork-Id: 884927 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=korsgaard.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="Ojr9IZqE"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 400Xrw3dlWz9sSN for ; Tue, 13 Mar 2018 09:36:16 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id E29A187632; Mon, 12 Mar 2018 22:36:12 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id oAMU3H7VoTWm; Mon, 12 Mar 2018 22:36:11 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 0A3CB86706; Mon, 12 Mar 2018 22:36:11 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 717131C1E66 for ; Mon, 12 Mar 2018 22:36:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6E4A786C7E for ; Mon, 12 Mar 2018 22:36:09 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id dwmKBX6kZ-4c for ; Mon, 12 Mar 2018 22:36:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wm0-f44.google.com (mail-wm0-f44.google.com [74.125.82.44]) by fraxinus.osuosl.org (Postfix) with ESMTPS id 1625586C7F for ; Mon, 12 Mar 2018 22:36:08 +0000 (UTC) Received: by mail-wm0-f44.google.com with SMTP id t3so19736265wmc.2 for ; Mon, 12 Mar 2018 15:36:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=YCk+KWEWfKt47jU4a765GYPtf/rrq2IiioLyZmi17tc=; b=Ojr9IZqEvEPKL80fHjZwplY6spfqKy7PIVdNQ1QVBNNyNyYxh00zZjSbnAwqacBY40 3JNAcBGgGURE3h0TY/RKYBGHqyBXFrZ7HB2luPX4lPydVsSdVp4g6LTm7JEzroNnr8Ec FJhh26Er+W0wuRTLV7mbI8q1tQe13mWR+1RrxSFmItMjBlzrNfmxGHuambxX1MeXgb3a LQ70XOZ1rj/HgTuLABLmuM0fDxYbqpqQ1jQiooT6el7/ARt1B9ein/67NtFrGLFD2IeT bMAtCuU2Z/acvVV55Xa37Uij31v851qgRscAg4K+3SSkSmwEd5dlk2Pa5+RL4pKNlmj0 zbwg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=YCk+KWEWfKt47jU4a765GYPtf/rrq2IiioLyZmi17tc=; b=PmY6mVCQ9cGxQNU/PUJoev4jPNf9luopTsRey5blhjb9WhvLNP2gnzNF/Dqej1jhRs 1BCTl0OasBkWp2oxEjxH4dYME1ewaIfyjHfvUvXeqS7DcnpQJKjD4nILmRDY0rtrHzHn Jr2PIf5w4lRQzz6PUEWJnpuTeHI9xiXIEbNUT+ZainRSmWJurpBHoYUjbRelaaQVwD51 P2L+zB/WDyr0+WmFTGQnnaxHZs8nTGN4f9Kx2+w5HqvGxof0B54vBN+7db2FuTKWmo41 1teVQ/1qJLNM0VfqvOd01ey/evvNihtwgbUb+duWr1YFXonWIRp5wicY/GNOfBBnljpJ WsaQ== X-Gm-Message-State: AElRT7H8Rl08XuoSSfW7oUlHgbX1Yagx05IzCkCr0bFhzUO5VN3HpKDS 5bghYB8+cgzf+OszqP2K2Jw+9675 X-Google-Smtp-Source: AG47ELse5GKrc2iTS5B6jIliOMsc8uypC3mH6EuFLdFircp02bz8vC7c4FnjVMFOsxhpmanCG5/Z4g== X-Received: by 10.80.140.5 with SMTP id p5mr12204206edp.55.1520894166089; Mon, 12 Mar 2018 15:36:06 -0700 (PDT) Received: from dell.be.48ers.dk (d51a5bc31.access.telenet.be. [81.165.188.49]) by smtp.gmail.com with ESMTPSA id l7sm5604686eda.65.2018.03.12.15.36.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 12 Mar 2018 15:36:05 -0700 (PDT) Received: from peko by dell.be.48ers.dk with local (Exim 4.89) (envelope-from ) id 1evW32-0005g9-J7; Mon, 12 Mar 2018 23:36:04 +0100 From: Peter Korsgaard To: buildroot@buildroot.org, yann.morin.1998@free.fr Date: Mon, 12 Mar 2018 23:36:03 +0100 Message-Id: <20180312223603.21788-1-peter@korsgaard.com> X-Mailer: git-send-email 2.11.0 Subject: [Buildroot] [PATCH] pkg-virtual.mk: explicitly set _VERSION / _SOURCE for robustness X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Recently a build failure was reported which was traced back to to the fact that the user had a TOOLCHAIN_VERSION environment variable set which leads to a strange looking error message: toolchain/toolchain/toolchain.mk:40: *** TOOLCHAIN_SITE cannot be empty when TOOLCHAIN_SOURCE is not. Stop. Environment variables automatically gets converted to make variables by GNU make - E.G. from the manual (https://www.gnu.org/software/make/manual/html_node/Environment.html): Variables in make can come from the environment in which make is run. Every environment variable that make sees when it starts up is transformed into a make variable with the same name and value So we end up in make with TOOLCHAIN_VERSION set to the value of the environment variable. As virtual packages do not have a version, there is no explicit TOOLCHAIN_VERSION = .. line in toolchain.mk overriding this value, and the logic in package/pkg-generic.mk sets a default value for TOOLCHAIN_SOURCE when TOOLCHAIN_VERSION is set, and finally errors out as TOOLCHAIN_SITE isn't set. As a workaround, explicitly set _VERSION and _SOURCE to the empty string in the virtual package infrastructure. Signed-off-by: Peter Korsgaard --- package/pkg-virtual.mk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/package/pkg-virtual.mk b/package/pkg-virtual.mk index 0de79d49be..05bd63eb18 100644 --- a/package/pkg-virtual.mk +++ b/package/pkg-virtual.mk @@ -41,6 +41,11 @@ $$(error No implementation selected for virtual package $(1). Configuration erro endif endif +# explicitly set these so we do not get confused by environment +# variables with the same names. +$(2)_VERSION = +$(2)_SOURCE = + $(2)_IS_VIRTUAL = YES # Add dependency against the provider