Skip to contentSkip to conversation

u-boot: state the MACHINE when skipping u-boot

PATCH In review Ross Burton 4 participants 15 messages Aug 1, 2013

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 u-boot: state the MACHINE when skipping u-boot

If the user accidently tries building u-boot on a machine doesn't use u-boot (such as qemuarm) the error message doesn't make it clear why u-boot was skipped. To help, state the machine that was being built for again.

[ YOCTO #4945 ]

---
 meta/recipes-bsp/u-boot/u-boot.inc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-bsp/u-boot/u-boot.inc +1 -1
index 6bbe457..6ec63df 100644
@@ -13,7 +13,7 @@ python () {
 		FILE = os.path.basename(d.getVar("FILE", True))
 		bb.debug(1, "To build %s, see %s for instructions on \
 			     setting up your machine config" % (PN, FILE))
-		raise bb.parse.SkipPackage("because UBOOT_MACHINE is not set")
+		raise bb.parse.SkipPackage("UBOOT_MACHINE is not set in the %s machine configuration." % d.getVar("MACHINE", True))
 }
 
 # Allow setting an additional version string that will be picked up by the
Signature · 1 line
1.7.10.4
#1 lore raw

Speaking of gerrit terms: I would prefer that you didn't submit this.

I would like it to be more specific. If it cannot be more specific, it should provide further information to get more specific information. Note, machine configuration can be the command line as well, so this would still be vague.

Quoted 36 lines · Ross Burton

If the user accidently tries building u-boot on a machine doesn't use u-boot
(such as qemuarm) the error message doesn't make it clear why u-boot was skipped. To help, state the machine that was being built for again.

[ YOCTO #4945 ]

---
 meta/recipes-bsp/u-boot/u-boot.inc |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
meta/recipes-bsp/u-boot/u-boot.inc +1 -1
index 6bbe457..6ec63df 100644
@@ -13,7 +13,7 @@ python () {
                FILE = os.path.basename(d.getVar("FILE", True))
                bb.debug(1, "To build %s, see %s for instructions on \
                             setting up your machine config" % (PN, FILE))
-               raise bb.parse.SkipPackage("because UBOOT_MACHINE is not
 set")
+               raise bb.parse.SkipPackage("UBOOT_MACHINE is not set in
 the %s machine configuration." % d.getVar("MACHINE", True))
 }

# Allow setting an additional version string that will be picked up by the
--
1.7.10.4

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.openembedded.org/mailman/listinfo/openembedded-core

#2 lore raw
Quoted 6 lines · Laszlo Papp

Speaking of gerrit terms: I would prefer that you didn't submit this.

I would like it to be more specific. If it cannot be more specific, it should provide further information to get more specific information. Note, machine configuration can be the command line as well, so this would still be vague.

It cannot be more specific without dumping the entire machine configuration, which won't help because a variable is *not* set.

By "machine configuration can be in the command line" do you mean MACHINE=foo? And if so, why does that mean the statement is vague?

Ross

#3 lore raw
Quoted 10 lines · Ross
Quoted 6 lines · Laszlo Papp

Speaking of gerrit terms: I would prefer that you didn't submit this.

I would like it to be more specific. If it cannot be more specific, it should provide further information to get more specific information. Note, machine configuration can be the command line as well, so this would still be vague.

It cannot be more specific without dumping the entire machine configuration, which won't help because a variable is *not* set.

Alternatively, let's approach it the other way. When the user does "MACHINE=qemux86 bitbake u-boot" what do you think the error message should be?

Ross

#4 lore raw
In reply to Burton, Ross
Quoted 5 lines · Ross
Quoted 4 lines · Laszlo Papp

Speaking of gerrit terms: I would prefer that you didn't submit this.

I would like it to be more specific. If it cannot be more specific, it should provide further information to get more specific information.

Quoted 8 lines

Note,

Quoted 1 line

machine configuration can be the command line as well, so this would

still

Quoted 1 line

be vague.

It cannot be more specific without dumping the entire machine configuration, which won't help because a variable is *not* set.

No no, it could print out the concrete file to look up, not just a name. Besides, I would probably even print a warning about the entry point and load address not set.

Quoted 3 lines

By "machine configuration can be in the command line" do you mean MACHINE=foo? And if so, why does that mean the statement is vague?

Well, you could place a warning for instance when it is set to the same as in the config file. That is probably not what the user intended.

#5 lore raw
Quoted 6 lines · Laszlo Papp
Quoted 2 lines

It cannot be more specific without dumping the entire machine configuration, which won't help because a variable is *not* set.

No no, it could print out the concrete file to look up, not just a name. Besides, I would probably even print a warning about the entry point and load address not set.

This is a simple "can I even build?" check, and UBOOT_MACHINE is sufficient.

Our users are not totally useless, I think they can find their own machine configuration files.

Quoted 5 lines
Quoted 2 lines

By "machine configuration can be in the command line" do you mean MACHINE=foo? And if so, why does that mean the statement is vague?

Well, you could place a warning for instance when it is set to the same as in the config file. That is probably not what the user intended.

I'm not sure what you meant here. Do you mean a situation where the local.conf says MACHINE=foo and the user also sets MACHINE=foo in the environment?

Ross

#6 lore raw
Quoted 8 lines · Ross
Quoted 6 lines · Laszlo Papp
Quoted 2 lines

It cannot be more specific without dumping the entire machine configuration, which won't help because a variable is *not* set.

No no, it could print out the concrete file to look up, not just a name. Besides, I would probably even print a warning about the entry point and load address not set.

Quoted 6 lines

This is a simple "can I even build?" check, and UBOOT_MACHINE is sufficient.

Our users are not totally useless, I think they can find their own machine configuration files.

It is not about users being useful or "useless" as you claim. It is about getting the output I can pass to the editor right away as that would be the most common action anyway. Why would they need to find on their own when it can be returned right away? You do not like working more than needed, surely?

Quoted 11 lines
Quoted 4 lines
Quoted 2 lines

By "machine configuration can be in the command line" do you mean MACHINE=foo? And if so, why does that mean the statement is vague?

Well, you could place a warning for instance when it is set to the same

as

Quoted 1 line

in the config file. That is probably not what the user intended.

I'm not sure what you meant here. Do you mean a situation where the local.conf says MACHINE=foo and the user also sets MACHINE=foo in the environment?

Yes.

#7 lore raw
Quoted 5 lines · Laszlo Papp
Quoted 3 lines

I'm not sure what you meant here. Do you mean a situation where the local.conf says MACHINE=foo and the user also sets MACHINE=foo in the environment?

Yes.

But there's nothing wrong with the user doing that at all.

Ross

#8 lore raw
Quoted 8 lines · Ross
Quoted 5 lines · Laszlo Papp
Quoted 3 lines

I'm not sure what you meant here. Do you mean a situation where the local.conf says MACHINE=foo and the user also sets MACHINE=foo in the environment?

Yes.

But there's nothing wrong with the user doing that at all.

Why do you think compilers warn in such use cases? Because they cannot know if you are doing something silly, or something unintentional. It might just well be that the user wanted to type something else, but got confused in which case he might get a hard to debug issue later, or even if not hard, it is additional issue due to his.

#9 lore raw
Quoted 9 lines · Laszlo Papp
Quoted 8 lines · Ross
Quoted 5 lines · Laszlo Papp
Quoted 3 lines

I'm not sure what you meant here. Do you mean a situation where the local.conf says MACHINE=foo and the user also sets MACHINE=foo in the environment?

Yes.

Quoted 8 lines
Quoted 1 line

But there's nothing wrong with the user doing that at all.

Why do you think compilers warn in such use cases? Because they cannot know if you are doing something silly, or something unintentional. It might just well be that the user wanted to type something else, but got confused in which case he might get a hard to debug issue later, or even if not hard, it is additional issue due to his.

Please provide the message you preferred so it can be seen and discussed. An example might make it easier to get what you really mean.

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#10 lore raw
Quoted 18 lines · Otavio Salvador
Quoted 1 line · Laszlo Papp

On Thu, Aug 1, 2013 at 5:35 PM, Burton, Ross <[email protected]>

Quoted 6 lines · wrote:
Quoted 6 lines · Laszlo Papp
Quoted 4 lines
Quoted 3 lines

I'm not sure what you meant here. Do you mean a situation where the local.conf says MACHINE=foo and the user also sets MACHINE=foo in the environment?

Quoted 6 lines
Quoted 3 lines
Quoted 1 line

Yes.

But there's nothing wrong with the user doing that at all.

Why do you think compilers warn in such use cases? Because they cannot

know

Quoted 1 line

if you are doing something silly, or something unintentional. It might

just

Quoted 9 lines
Quoted 2 lines

well be that the user wanted to type something else, but got confused in which case he might get a hard to debug issue later, or even if not

hard, it

Quoted 1 line

is additional issue due to his.

Please provide the message you preferred so it can be seen and discussed. An example might make it easier to get what you really mean.

"Warning: "foo", specified manually on the command line, is the same as in the /path/to/the/relevant/background/file.stuff file"

Please do not hang on the grammar as I am a non-native speakers.

#11 lore raw
Quoted 1 line · On Thursday 01 August 2013 17:52:13 Laszlo Papp wrote:

On Thu, Aug 1, 2013 at 5:50 PM, Otavio Salvador

Quoted 29 lines · <[email protected]>wrote:
Quoted 29 lines · Laszlo Papp
Quoted 1 line

On Thu, Aug 1, 2013 at 5:35 PM, Burton, Ross <[email protected]>

Quoted 11 lines · wrote:
Quoted 9 lines · Laszlo Papp
Quoted 6 lines
Quoted 4 lines

I'm not sure what you meant here. Do you mean a situation where the local.conf says MACHINE=foo and the user also sets MACHINE=foo in the
environment?

Yes.

But there's nothing wrong with the user doing that at all.

Why do you think compilers warn in such use cases? Because they cannot

know

Quoted 1 line

if you are doing something silly, or something unintentional. It might

just

Quoted 2 lines

well be that the user wanted to type something else, but got confused in which case he might get a hard to debug issue later, or even if not

hard, it

Quoted 1 line

is additional issue due to his.

Quoted 8 lines
Quoted 3 lines

Please provide the message you preferred so it can be seen and discussed. An example might make it easier to get what you really mean.

"Warning: "foo", specified manually on the command line, is the same as in the /path/to/the/relevant/background/file.stuff file"

Please do not hang on the grammar as I am a non-native speakers.

I'm afraid this is not practical. The ability to specify the value for MACHINE and other variables from the external environment is not just there for folks running bitbake manually from the command line, but also external scripts as well, and they could quite legitimately set it to the same value that has been specified in the configuration file and showing a warning in that case would be undesirable.

I'm not sure I understand the value of showing this warning in any case. The system is not going to do anything that the user won't expect - the user specified the value of MACHINE on the command line and that's the value that is being used. The fact that it is the same as what's in the configuration file is incidental.

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
#12 lore raw

On Thu, Aug 1, 2013 at 6:02 PM, Paul Eggleton <[email protected]

Quoted 14 lines

wrote:

I'm afraid this is not practical. The ability to specify the value for MACHINE
and other variables from the external environment is not just there for folks
running bitbake manually from the command line, but also external scripts as
well, and they could quite legitimately set it to the same value that has been
specified in the configuration file and showing a warning in that case would be
undesirable.

Oh yeah, it cannot happen with compiler outputs the same way? Answer is: it can.

You can add another feature later though if you wish to suppress warnings. That makes sense to me.

Quoted 9 lines

I'm not sure I understand the value of showing this warning in any case. The
system is not going to do anything that the user won't expect - the user specified the value of MACHINE on the command line and that's the value that is
being used. The fact that it is the same as what's in the configuration file is
incidental.

Have you used gcc, clang, etc? Do you have experience with warnings in general? They are there in certain cases because the programmer may have or probably made a mistake. It is a lot easier to figure out at that time than debugging very hard later...

Actually, it is even getting more serious in your "script" case where it would be totally hidden by the script if it is not logging properly, and you would only realize an issue later.

Surely, we all copy paste wrong on a daily basis, and we also write "foo" instead "fow" and "bar" at times. So, I do not follow your comment. Nothing to reinvent the wheel here, just follow the general practice that other software developers have figured out along the decades.

#13 lore raw
Quoted 16 lines · Laszlo Papp
Quoted 12 lines · Paul Eggleton

I'm afraid this is not practical. The ability to specify the value for MACHINE
and other variables from the external environment is not just there for folks
running bitbake manually from the command line, but also external scripts as
well, and they could quite legitimately set it to the same value that has been
specified in the configuration file and showing a warning in that case would be
undesirable.

Quoted 5 lines

Oh yeah, it cannot happen with compiler outputs the same way? Answer is: it can.

You can add another feature later though if you wish to suppress warnings. That makes sense to me.

It makes sense to not add the warning. Too many warnings just confuse users and does not provide anything useful as users just ignore them in the end.

Quoted 10 lines
Quoted 8 lines

I'm not sure I understand the value of showing this warning in any case. The
system is not going to do anything that the user won't expect - the user specified the value of MACHINE on the command line and that's the value that is
being used. The fact that it is the same as what's in the configuration file is
incidental.

Quoted 4 lines

Have you used gcc, clang, etc? Do you have experience with warnings in general? They are there in certain cases because the programmer may have or probably made a mistake. It is a lot easier to figure out at that time than debugging very hard later...

<sarcarsm>
I am sure we all in Yocto community NEVER used GCC/CLang... </sarcarsm>

Did you EVER read your own messages? Please do.

Quoted 8 lines

Actually, it is even getting more serious in your "script" case where it would be totally hidden by the script if it is not logging properly, and you would only realize an issue later.

Surely, we all copy paste wrong on a daily basis, and we also write "foo" instead "fow" and "bar" at times. So, I do not follow your comment. Nothing to reinvent the wheel here, just follow the general practice that other software developers have figured out along the decades.

That's the point; we are folloing Yocto general practice and doing it different here won't help. Just confuse.

Regards,

Signature · 3 lines
Otavio Salvador                             O.S. Systems
http://www.ossystems.com.br        http://projetos.ossystems.com.br
Mobile: +55 (53) 9981-7854            Mobile: +1 (347) 903-9750
#14 lore raw
Quoted 23 lines · Otavio Salvador
Quoted 8 lines · Laszlo Papp
Quoted 6 lines · Paul Eggleton

I'm afraid this is not practical. The ability to specify the value for MACHINE
and other variables from the external environment is not just there for folks
running bitbake manually from the command line, but also external

scripts

Quoted 2 lines
Quoted 2 lines

as
well, and they could quite legitimately set it to the same value that

has

Quoted 7 lines
Quoted 4 lines

been
specified in the configuration file and showing a warning in that case would be
undesirable.

Oh yeah, it cannot happen with compiler outputs the same way? Answer is:

it

Quoted 2 lines

can.

Quoted 8 lines
Quoted 1 line

You can add another feature later though if you wish to suppress

warnings.

Quoted 1 line

That makes sense to me.

It makes sense to not add the warning. Too many warnings just confuse users and does not provide anything useful as users just ignore them in the end.

"Too many warnings confuse the users" -> Despite your claim below, you have not talked much to the gcc/clang and so forth users. You are quite off the reality in here.

If there are users ignoring warnings for no real reasons, it is their mistake. That does not mean careful users should be limited by those users. Such users ignoring the warnings have no harm anyway. They will just ignore them.

Quoted 15 lines
Quoted 11 lines

I'm not sure I understand the value of showing this warning in any case.

Quoted 7 lines

The
system is not going to do anything that the user won't expect - the user specified the value of MACHINE on the command line and that's the value that is
being used. The fact that it is the same as what's in the configuration file is
incidental.

Quoted 2 lines

Have you used gcc, clang, etc? Do you have experience with warnings in general? They are there in certain cases because the programmer may have

or

Quoted 1 line

probably made a mistake. It is a lot easier to figure out at that time

Quoted 9 lines

than

Quoted 1 line

debugging very hard later...

<sarcarsm>
I am sure we all in Yocto community NEVER used GCC/CLang... </sarcarsm>

Did you EVER read your own messages? Please do.

You are quite off here, too. It was questioned about the "warning " usage of those in this context of course. Please get back on track.

Quoted 6 lines

Actually, it is even getting more serious in your "script" case where it

Quoted 1 line

would be totally hidden by the script if it is not logging properly, and

you

Quoted 2 lines

would only realize an issue later.

Quoted 9 lines
Quoted 2 lines

Surely, we all copy paste wrong on a daily basis, and we also write "foo" instead "fow" and "bar" at times. So, I do not follow your comment.

Nothing

Quoted 2 lines

to reinvent the wheel here, just follow the general practice that other software developers have figured out along the decades.

That's the point; we are folloing Yocto general practice and doing it different here won't help. Just confuse.

Actually, I was getting a lot more warning than I expected already, so you are speaking against the reality. In fact, those warnings I got I could also suppress. I do not claim they are useless though just because I do not like them.