* [Buildroot] [PATCH] pkg-virtual.mk: explicitly set <pkg>_VERSION / _SOURCE for robustness
@ 2018-03-12 22:36 Peter Korsgaard
2018-03-14 7:39 ` Peter Korsgaard
2018-04-06 16:53 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Peter Korsgaard @ 2018-03-12 22:36 UTC (permalink / raw)
To: 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 <pkg>_VERSION and <pkg>_SOURCE to the empty
string in the virtual package infrastructure.
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
---
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
--
2.11.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] pkg-virtual.mk: explicitly set <pkg>_VERSION / _SOURCE for robustness
2018-03-12 22:36 [Buildroot] [PATCH] pkg-virtual.mk: explicitly set <pkg>_VERSION / _SOURCE for robustness Peter Korsgaard
@ 2018-03-14 7:39 ` Peter Korsgaard
2018-04-06 16:53 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2018-03-14 7:39 UTC (permalink / raw)
To: buildroot
>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes:
> 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 <pkg>_VERSION and <pkg>_SOURCE to the empty
> string in the virtual package infrastructure.
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Committed, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Buildroot] [PATCH] pkg-virtual.mk: explicitly set <pkg>_VERSION / _SOURCE for robustness
2018-03-12 22:36 [Buildroot] [PATCH] pkg-virtual.mk: explicitly set <pkg>_VERSION / _SOURCE for robustness Peter Korsgaard
2018-03-14 7:39 ` Peter Korsgaard
@ 2018-04-06 16:53 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2018-04-06 16:53 UTC (permalink / raw)
To: buildroot
>>>>> "Peter" == Peter Korsgaard <peter@korsgaard.com> writes:
> 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 <pkg>_VERSION and <pkg>_SOURCE to the empty
> string in the virtual package infrastructure.
> Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Committed to 2018.02.x, thanks.
--
Bye, Peter Korsgaard
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-04-06 16:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-12 22:36 [Buildroot] [PATCH] pkg-virtual.mk: explicitly set <pkg>_VERSION / _SOURCE for robustness Peter Korsgaard
2018-03-14 7:39 ` Peter Korsgaard
2018-04-06 16:53 ` Peter Korsgaard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.