DISTRO override logic in angstrom.inc
Not having paid close attention to the "A case for user distro" thread, I was quite surprised when today the OpenMoko distro override no longer worked.
OpenMoko bases on angstrom and subsequently includes angstrom.inc which forcefully sets DISTRO = angstrom. I wonder whether this is a bit too violent against sharing files.
I had to
-OVERRIDES = "local:${MACHINE}:${DISTRO}:angstrom:${TARGET_OS}:
${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}" +OVERRIDES = "local:${MACHINE}:openmoko:angstrom:${TARGET_OS}:
${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
to get the wanted behaviour back.
:M:
Signature · 1 line
Dr. Michael 'Mickey' Lauer | IT-Freelancer | http://www.vanille-media.de
Hello,
Quoted 8 lines · On Mon, 18 Feb 2008 20:52:30 +0100 Michael 'Mickey' Lauer…
Not having paid close attention to the "A case for user distro" thread, I was quite surprised when today the OpenMoko distro override no longer worked.
OpenMoko bases on angstrom and subsequently includes angstrom.inc which forcefully sets DISTRO = angstrom. I wonder whether this is a bit too violent against sharing files.
Quoted 8 lines
I had to
-OVERRIDES = "local:${MACHINE}:${DISTRO}:angstrom:${TARGET_OS}:
${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}" +OVERRIDES = "local:${MACHINE}:openmoko:angstrom:${TARGET_OS}:
${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"to get the wanted behaviour back.
Hm, but that only shows that overriding DISTRO is indeed weird thing which can lead to complex include file interactions. So, how it was before is:
1. openmoko.conf includes angstrom-2007-for-openmoko.inc which indirectly includes angstrom.inc which overrides DISTRO.
2. Then, openmoko.conf had DISTRO="openmoko" which looked like null assignment, but actually re-set DISTRO after angstrom.inc's deeds.
Well, I went over all distro confs and removed everything which looked like empty assignments, who could imagine there's such imperative logic based on include order happens with OpenMoko? I'm sorry for the hassle this caused, but in the end Angstrom seems to be the offender as the only distro which plays tricks with DISTRO.
I believe the OVERRIDES update above is the correct and reliable solution to this issue, and would like to propose that we finished with this DISTRO override cleanup:
1. Treat DISTRO as the input-only parameter from user, and thus ban assignments to it.
2. Make Angstrom to use OVERRIDES like above.
I don't know if Angstrom relies somewhere else on DISTRO to be overriden, but that can, and should be fixed too (usage in OVERRIDES apparently should be the most heavy assumption).
I also think that using literal values like "openmoko" and "angstrom" is the right way, though for completeness, here's version with extra indirection. In bitbake.conf:
DISTRO_OVERRIDE = ${DISTRO}
OVERRIDES = "local:${MACHINE}:${DISTRO_OVERRIDES}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
Then distros which need that can use DISTRO_OVERRIDE :=
Again, IMHO that just complicates the matter.
Quoted 6 lines
:M:
Signature · 2 lines
Dr. Michael 'Mickey' Lauer | IT-Freelancer | http://www.vanille-media.de
[]
Signature · 2 lines
Best regards, Paul mailto:[email protected]
Quoted 24 lines · Paul Sokolovsky
Quoted 8 lines · On Mon, 18 Feb 2008 20:52:30 +0100 Michael 'Mickey' Lauer…
Not having paid close attention to the "A case for user distro" thread, I was quite surprised when today the OpenMoko distro override no longer worked.
OpenMoko bases on angstrom and subsequently includes angstrom.inc which forcefully sets DISTRO = angstrom. I wonder whether this is a bit too violent against sharing files.
Quoted 8 lines
I had to
-OVERRIDES = "local:${MACHINE}:${DISTRO}:angstrom:${TARGET_OS}:
${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}" +OVERRIDES = "local:${MACHINE}:openmoko:angstrom:${TARGET_OS}:
${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"to get the wanted behaviour back.
Hm, but that only shows that overriding DISTRO is indeed weird thing which can lead to complex include file interactions. So, how it was before is:
Quoted 4 lines
1. openmoko.conf includes angstrom-2007-for-openmoko.inc which indirectly includes angstrom.inc which overrides DISTRO.
2. Then, openmoko.conf had DISTRO="openmoko" which looked like null assignment, but actually re-set DISTRO after angstrom.inc's deeds.
This kind of justifies my concerns over changing this stuff as its subtle. It has highlighted that openmoko was running without "angstrom" in overrides at all though which if its truly angstrom derived might have caused problems. Alternatively, Mickey's change isn't 100% equivalent to what was there before and I'd suggest Mickey considers it carefully.
Quoted 16 lines
I believe the OVERRIDES update above is the correct and reliable solution to this issue, and would like to propose that we finished with this DISTRO override cleanup:
1. Treat DISTRO as the input-only parameter from user, and thus ban assignments to it.
2. Make Angstrom to use OVERRIDES like above.I don't know if Angstrom relies somewhere else on DISTRO to be overriden, but that can, and should be fixed too (usage in OVERRIDES apparently should be the most heavy assumption).
I also think that using literal values like "openmoko" and "angstrom" is the right way, though for completeness, here's version with extra indirection. In bitbake.conf:
Quoted 7 lines
DISTRO_OVERRIDE= ${DISTRO}
OVERRIDES = "local:${MACHINE}:${DISTRO_OVERRIDES}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"Then distros which need that can use
DISTRO_OVERRIDE:=Again, IMHO that just complicates the matter.
I'm voting in favour of:
DISTRO_OVERRIDES ?= ${DISTRO}
OVERRIDES ="local:${MACHINE}:${DISTRO_OVERRIDES}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"
and then angstrom sets:
DISTRO_OVERRIDES = "angstrom"
and openmoko sets:
DISTRO_OVERRIDES = "openmoko:angstrom"
Note there is no longer any use of := and that the main list of overrides is only written in one place rather than spread out per distro which could cause maintenance problems in the future.
Cheers,
Richard
Hello,
Quoted 25 lines · On Mon, 18 Feb 2008 21:54:24 +0000 Richard Purdie <[email protected]> wrote:
Quoted 24 lines · Paul Sokolovsky
Quoted 8 lines · On Mon, 18 Feb 2008 20:52:30 +0100 Michael 'Mickey' Lauer…
Not having paid close attention to the "A case for user distro" thread, I was quite surprised when today the OpenMoko distro override no longer worked.
OpenMoko bases on angstrom and subsequently includes angstrom.inc which forcefully sets DISTRO = angstrom. I wonder whether this is a bit too violent against sharing files.
Quoted 8 lines
I had to
-OVERRIDES = "local:${MACHINE}:${DISTRO}:angstrom:${TARGET_OS}:
${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}" +OVERRIDES = "local:${MACHINE}:openmoko:angstrom:${TARGET_OS}:
${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"to get the wanted behaviour back.
Hm, but that only shows that overriding DISTRO is indeed weird thing which can lead to complex include file interactions. So, how it was before is:
Quoted 7 lines
Quoted 4 lines
1. openmoko.conf includes angstrom-2007-for-openmoko.inc which indirectly includes angstrom.inc which overrides DISTRO.
2. Then, openmoko.conf had DISTRO="openmoko" which looked like null assignment, but actually re-set DISTRO after angstrom.inc's deeds.This kind of justifies my concerns over changing this stuff as its subtle.
You'd know my answer, right - somebody should... ;-) Living in fear of changing that doesn't help either. I guess treating OVERRIDES as something mystical was the reason why "DISTRO=" got into angstrom.inc in the first place.
Quoted 2 lines
It has highlighted that openmoko was running without "angstrom" in overrides at all though
Hm, why? "-" change from Mickey shows there was literal "angstrom" in there. So, it was "openmoko:angstrom" before, became "angstrom:angstrom" after my change, and now set back in explicit way. I assume that OVERRIDES are processed in order, so if there're both openmoko and angstrom override, first will have priority, otherwise angstrom's will be picked up, and I guess that's desired behavior.
Quoted 39 lines
which if its truly angstrom
derived might have caused problems. Alternatively, Mickey's change isn't 100% equivalent to what was there before and I'd suggest Mickey considers it carefully.Quoted 16 lines
I believe the OVERRIDES update above is the correct and reliable solution to this issue, and would like to propose that we finished with this DISTRO override cleanup:
1. Treat DISTRO as the input-only parameter from user, and thus ban assignments to it.
2. Make Angstrom to use OVERRIDES like above.I don't know if Angstrom relies somewhere else on DISTRO to be overriden, but that can, and should be fixed too (usage in OVERRIDES apparently should be the most heavy assumption).
I also think that using literal values like "openmoko" and "angstrom" is the right way, though for completeness, here's version with extra indirection. In bitbake.conf:
Quoted 7 lines
DISTRO_OVERRIDE= ${DISTRO}
OVERRIDES = "local:${MACHINE}:${DISTRO_OVERRIDES}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"Then distros which need that can use
DISTRO_OVERRIDE:=Again, IMHO that just complicates the matter.
I'm voting in favour of:
DISTRO_OVERRIDES?= ${DISTRO}
OVERRIDES ="local:${MACHINE}:${DISTRO_OVERRIDES}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"and then angstrom sets:
DISTRO_OVERRIDES= "angstrom"
Quoted 7 lines
and openmoko sets:
DISTRO_OVERRIDES= "openmoko:angstrom"Note there is no longer any use of := and that the main list of overrides is only written in one place rather than spread out per distro which could cause maintenance problems in the future.
You know better. If such use with ":" inside is acceptable, and it's really DISTRO_OVERRIDE*S*, so the meaning of it is not "a var where distro may put something to use instead of its name in OVERRIDES", but instead "var which holds values on which distro wants to override, in addition to standard overrides", then it's even better ;-).
Quoted 5 lines
Cheers,
Richard
[]
Signature · 2 lines
Best regards, Paul mailto:[email protected]
Quoted 4 lines · On Tue, 19 Feb 2008 00:18:29 +0200 Paul Sokolovsky <[email protected]> wrote:
I assume that OVERRIDES are processed in order, so if there're both openmoko and angstrom override, first will have priority, otherwise angstrom's will be picked up, and I guess that's desired behavior.
Actually both are used. Hence openmoko patches in psplash are a diff against Angstrom patches and not the raw source.
Graeme
Hello,
Quoted 8 lines · On Mon, 18 Feb 2008 22:27:10 +0000 Graeme Gregory <[email protected]> wrote:
Quoted 4 lines · On Tue, 19 Feb 2008 00:18:29 +0200 Paul Sokolovsky <[email protected]> wrote:
I assume that OVERRIDES are processed in order, so if there're both openmoko and angstrom override, first will have priority, otherwise angstrom's will be picked up, and I guess that's desired behavior.
Actually both are used. Hence openmoko patches in psplash are a diff against Angstrom patches and not the raw source.
Oh my god, it's all so tangled then. I missed the fact that I broke openmoko build with logo-math.patch - I added it as ansgtrom-specific override exactly because didn't want to affect OM ;-I.
Well, it needs to be pushed upstream now...
Quoted 3 lines
Graeme
Signature · 2 lines
Best regards, Paul mailto:[email protected]
Quoted 7 lines · Paul Sokolovsky
Quoted 2 lines · On Mon, 18 Feb 2008 21:54:24 +0000 Richard Purdie <[email protected]> wrote:
Quoted 1 line · Paul Sokolovsky
On Mon, 18 Feb 2008 20:52:30 +0100 Michael 'Mickey' Lauer <[email protected]> wrote:
You'd know my answer, right - somebody should... ;-) Living in fear of changing that doesn't help either. I guess treating OVERRIDES as something mystical was the reason why "DISTRO=" got into angstrom.inc in the first place.
Not mystic, dangerous and subtle ;-).
Quoted 9 lines
Quoted 2 lines
It has highlighted that openmoko was running without "angstrom" in overrides at all though
Hm, why? "-" change from Mickey shows there was literal "angstrom" in there. So, it was "openmoko:angstrom" before, became "angstrom:angstrom" after my change, and now set back in explicit way. I assume that OVERRIDES are processed in order, so if there're both openmoko and angstrom override, first will have priority, otherwise angstrom's will be picked up, and I guess that's desired behavior.
Sorry, I'd misread the diff and my brain is tired ;-). There is no change in behaviour.
Quoted 12 lines
Quoted 12 lines
I'm voting in favour of:
DISTRO_OVERRIDES?= ${DISTRO}
OVERRIDES ="local:${MACHINE}:${DISTRO_OVERRIDES}:${TARGET_OS}:${TARGET_ARCH}:build-${BUILD_OS}:fail-fast:pn-${PN}"and then angstrom sets:
DISTRO_OVERRIDES= "angstrom"and openmoko sets:
Quoted 7 lines
Quoted 5 lines
DISTRO_OVERRIDES= "openmoko:angstrom"Note there is no longer any use of := and that the main list of overrides is only written in one place rather than spread out per distro which could cause maintenance problems in the future.
You know better. If such use with ":" inside is acceptable,
It is as far as I'm concerned. We already do this with things like PATH.
Quoted 5 lines
and it's
really DISTRO_OVERRIDE*S*, so the meaning of it is not "a var where distro may put something to use instead of its name in OVERRIDES", but instead "var which holds values on which distro wants to override, in addition to standard overrides", then it's even better ;-).
The latter is what I'm implying. Its more powerful and shouldn't break any existing usage, I can't really see anything against it at the moment and it simplifies openmoko's setup...
Cheers,
Richard
Quoted 11 lines · On Monday 18 February 2008 22:54:24 Richard Purdie wrote:
I'm voting in favour of:
DISTRO_OVERRIDES?= ${DISTRO}
OVERRIDES ="local:${MACHINE}:${DISTRO_OVERRIDES}:${TARGET_OS}:${TARGET_ARCH}:build-${ BUILD_OS}:fail-fast:pn-${PN}"and then angstrom sets:
DISTRO_OVERRIDES= "angstrom"
Quoted 7 lines
and openmoko sets:
DISTRO_OVERRIDES= "openmoko:angstrom"Note there is no longer any use of := and that the main list of overrides is only written in one place rather than spread out per distro which could cause maintenance problems in the future.
I like that a lot.
+1 from me.
:M:
Quoted 12 lines · Michael 'Mickey' Lauer
Quoted 11 lines · On Monday 18 February 2008 22:54:24 Richard Purdie wrote:
I'm voting in favour of:
DISTRO_OVERRIDES?= ${DISTRO}
OVERRIDES ="local:${MACHINE}:${DISTRO_OVERRIDES}:${TARGET_OS}:${TARGET_ARCH}:build-${ BUILD_OS}:fail-fast:pn-${PN}"and then angstrom sets:
DISTRO_OVERRIDES= "angstrom"
Quoted 7 lines
Quoted 7 lines
and openmoko sets:
DISTRO_OVERRIDES= "openmoko:angstrom"Note there is no longer any use of := and that the main list of overrides is only written in one place rather than spread out per distro which could cause maintenance problems in the future.
Can we do the same for MACHINE at the same time?
nslu2, for instance, needs to use ixp4xx overrides and does the same thing that openmoko did with angstrom overrides.
-- Rod