[Buildroot] [PATCH 1/1] utils/genrandconfig: add randconfig based --no-toolchains-csv option

James Hilliard james.hilliard1 at gmail.com
Sun Apr 3 16:22:19 UTC 2022


On Sun, Apr 3, 2022 at 7:58 AM Arnout Vandecappelle <arnout at mind.be> wrote:
>
>
>
> On 02/04/2022 20:58, James Hilliard wrote:
> > On Sat, Apr 2, 2022 at 10:29 AM Arnout Vandecappelle <arnout at mind.be> wrote:
> >>
> >>    Hi James,
> >>
> >> On 02/04/2022 03:05, James Hilliard wrote:
> [snip]
> >>> +    if 'BR2_ROOTFS_SKELETON_CUSTOM=y\n' in configlines and \
> >>> +       'BR2_ROOTFS_SKELETON_CUSTOM_PATH=""\n' in configlines:
> >>> +        configlines.remove('BR2_ROOTFS_SKELETON_CUSTOM=y\n')
> >>
> >>    I don't understand why for this particular one you remove it explicitly, while
> >> for other cases you rely (I guess) on the dependency check to make sure we get a
> >> valid config (eventually).
> >
> > Others were missing the empty string config for matching against so
> > this approach
> > didn't seem to work there.
>
>   I still don't understand... If I have the time, I'll try to cook up a patch
> that does the check the same way as all the other checks are done, and you an
> tell me if you're happy with that.

Using a fixup avoids extra randconfig regenerations mostly, it's not
strictly needed.

>
> [snip]
> >>    I agree though that it's more work to do that than the current patch, so
> >> perhaps this is a good first step.
> >
> > Yeah, best to do this incrementally IMO, since this is revealing issues already
> > in the autobuilder relating to config validation I'm running this on:
> > http://autobuild.buildroot.net/?submitter=James+Hilliard+%28asahi-mini%29
>
>   So this is running a modified buildroot-test that passes the
> --no-toolchains-csv option?

Yes, plus I'm using an out of tree utils/genrandconfig override to add
the option.

>
> > Note that this autobuilder is an aarch64(running
> > https://asahilinux.org/) host so
> > it doesn't use the prebuilt toolchains.
>
> [snip]
> >>> -    subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir,
> >>> -                           "savedefconfig"])
> >>> +            if subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir,
> >>> +                                      "savedefconfig"]):
> >>
> >>    This one should simply never fail, so it should move outside of the loop,
> >> after checking dependencies.
> >
> > I just tested that this can fail so I've kept it in the loop for now.
>
>   Okay, let me rephrase: if 'make dependencies' passes, then 'make
> savedefconfig' should never fail. If you had a situation where make
> savedefconfig fails, I'd be interested to know about it and debug it.

The make dependencies call is after savedefconfig so I think it would need
to be checked due to that.

>
>
>   Regards,
>   Arnout
>
> >>> +                continue
> >>>
> >>> -    return subprocess.call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir,
> >>> -                            "dependencies"])
> >>> +            if subprocess.call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir,
> >>> +                                "dependencies"]):
> >>> +                continue
> >>> +            break
> >>> +    return 0
> >>>
> >>>
> >>>    if __name__ == '__main__':
> >>> @@ -433,10 +443,18 @@ if __name__ == '__main__':
> >>>        parser.add_argument("--buildrootdir", "-b",
> >>>                            help="Buildroot directory (relative to current directory)",
> >>>                            type=str, default='.')
> >>> -    parser.add_argument("--toolchains-csv",
> >>> -                        help="Path of the toolchain configuration file",
> >>> -                        type=str,
> >>> -                        default="support/config-fragments/autobuild/toolchain-configs.csv")
> >>> +
> >>> +    toolchains_csv = parser.add_mutually_exclusive_group(required=False)
> >>> +    toolchains_csv.add_argument("--toolchains-csv",
> >>> +                                dest="toolchains_csv",
> >>> +                                help="Path of the toolchain configuration file",
> >>> +                                type=str)
> >>> +    toolchains_csv.add_argument("--no-toolchains-csv",
> >>> +                                dest="toolchains_csv",
> >>> +                                help="Generate random toolchain configuration",
> >>> +                                action='store_false')
> >>> +    parser.set_defaults(toolchains_csv="support/config-fragments/autobuild/toolchain-configs.csv")
> >>> +
> >>>        args = parser.parse_args()
> >>>
> >>>        # We need the absolute path to use with O=, because the relative



More information about the buildroot mailing list