Skip to contentSkip to conversation

Why does bitbake-setup force a machine config fragment?

DISCUSSION Quentin Schulz 2 participants 2 messages Feb 3

lore
Share & tools
lore
#0 lore raw

Hi all,

I've started using bitbake-setup a while ago and I keep hitting the same "issue".

I follow the setup and then I want to build images for multiple machines from my BSP and I cannot right out of the box because we're forced to select a default machine and it cannot be overridden from the local environment. Yes, it only takes a few seconds to do the thing. But it *feels* "wrong".

I believe this is not great user experience as it'll lead to people thinking they need separate build directories for each machine they build for, which is definitely not the case.

Also, would anyone actually build for any of the machines specified in bitbake-setup? (aside from our autobuilders of course)

In short, I'm wondering if we shouldn't have an additional option in the list for machine targets which would be something along the lines of: "None: I'll set the MACHINE variable from the environment or local.conf myself".

Or maybe we should NOT forbid the user to pass a MACHINE env variable when there already is a config fragment for a MACHINE? What was the rationale behind this?

What do you think? I know it seemed odd to Antonin as well but maybe we're the only ones and we just need to adapt :)

N.B.: same remark for DISTRO (I happen to only develop BSP layers for now so poky as forced default DISTRO is fine but I could imagine other people having the same issue with this one).

Cheers,
Quentin

#1 lore raw
Quoted 4 lines · Quentin Schulz via lists.openembedded.org

In short, I'm wondering if we shouldn't have an additional option in the list for machine targets which would be something along the lines of:
"None: I'll set the MACHINE variable from the environment or local.conf myself".

There's a --skip-selection command line option where you can list things you don't want to select. You also have the option of not specifying possible machines in the config itself, e.g. drop this

                "machine": {
                    "description": "Target machines",
                    "options" : ["machine/qemux86-64",
"machine/qemuarm64", "machine/qemuriscv64", "machine/genericarm64",
"machine/genericx86-64"]
                },

or its equivalent from your config file. You can also have two configurations side by side in the config file, one with machine selector looking similar to above and another without. Configurations can be nested and form a tree structure.

Quoted 3 lines

Or maybe we should NOT forbid the user to pass a MACHINE env variable when there already is a config fragment for a MACHINE? What was the rationale behind this?

I think this was the bug:

https://bugzilla.yoctoproject.org/show_bug.cgi?id=16060

and this was the fix:

https://lists.openembedded.org/g/bitbake-devel/message/18468

(there's probably associated discussion on the mailing list as well which is not registered in the ticket).

I agree that overriding fragment-based machine selection from command line by setting MACHINE=xxx would be beneficial as lots of people have finger memory for it, but I think this was found tricky to implement correctly, and so we decided to just deem it a mis-configuration. But you can look into it again.

Otherwise, it's okay to do this instead of 'MACHINE=xxx bitbake...' when there's already a machine set via fragment:

bitbake-config-build enable-fragment machine/xxx && bitbake ...

You can add a shell alias for the first command, and then it's even shorter:

M xxx && bitbake ...

Alex