utils/genrandconfig: add randconfig based --no-toolchains-csv option
PATCH 1/1 utils/genrandconfig: add randconfig based --no-toolchains-csv option
Currently we only test a limited set of toolchains that are mostly prebuilt, add a flag to allow using randconfig for randomizing additional toolchain settings instead of randpackageconfig.
To avoid invalid configs we need to add additional config validation filtering and fixups.
--- utils/genrandconfig | 52 ++++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 17 deletions(-)
utils/genrandconfig +35 -17
@@ -315,6 +315,10 @@ def fixup_config(sysinfo, configfile): configlines.remove('BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE=""\n') configlines.append('BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="%s"\n' % bootscr) + 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') + with open(configfile, "w+") as configf: configf.writelines(configlines)
@@ -331,11 +335,14 @@ def gen_config(args): sysinfo = SystemInfo() - # Select a random toolchain configuration - configs = get_toolchain_configs(args.toolchains_csv, args.buildrootdir) + if args.toolchains_csv: + # Select a random toolchain configuration + configs = get_toolchain_configs(args.toolchains_csv, args.buildrootdir) - i = randint(0, len(configs) - 1) - toolchainconfig = configs[i] + i = randint(0, len(configs) - 1) + toolchainconfig = configs[i] + else: + toolchainconfig = [] configlines = list(toolchainconfig)
@@ -409,19 +416,22 @@ def gen_config(args): bounded_loop -= 1 subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir, "KCONFIG_PROBABILITY=%d" % randint(1, 20), - "randpackageconfig"]) + "randpackageconfig" if args.toolchains_csv else "randconfig"]) if fixup_config(sysinfo, configfile): - break - - subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir, - "olddefconfig"]) + if subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir, + "olddefconfig"]): + continue - 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"]): + 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
Signature · 6 lines
2.25.1 _______________________________________________ buildroot mailing list [email protected] https://lists.buildroot.org/mailman/listinfo/buildroot
Hi James,
Quoted 3 lines · James Hilliard
Currently we only test a limited set of toolchains that are mostly prebuilt, add a flag to allow using randconfig for randomizing additional toolchain settings instead of randpackageconfig.
Oooh, it's been on my wishlist for a loooong time to use randconfig instead of
randpackageconfig in the autobuilders...
Quoted 3 lines
To avoid invalid configs we need to add additional config validation filtering and fixups.
I guess the following 4 patches are supposed to do that? Please keep them
together in a series in the future.
Quoted 11 lines
Signed-off-by James Hilliard <[email protected]>--- utils/genrandconfig | 52 ++++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 17 deletions(-)utils/genrandconfig +0
-0
utils/genrandconfig def fixup_config(sysinfo, configfile): · line 320
Quoted 6 lines
utils/genrandconfig +3
-0@@ -315,6 +315,10 @@ def fixup_config(sysinfo, configfile): configlines.remove('BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE=""\n') configlines.append('BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="%s"\n' % bootscr) + 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).
Also, I think the proper approach for dealing with required string options is
to give them a default value in support/config-fragments/minimal.config. Unlike the toolchainfile, the configlines in minimal.config don't all need to be present in the final .config, so we can add stuff there that is only available if the appropriate boolean option gets selected randomly.
Quoted 10 lines
utils/genrandconfig +1
-2+ with open(configfile, "w+") as configf: configf.writelines(configlines)@@ -331,11 +335,14 @@ def gen_config(args): sysinfo = SystemInfo() - # Select a random toolchain configuration - configs = get_toolchain_configs(args.toolchains_csv, args.buildrootdir)
utils/genrandconfig def gen_config(args): · line 345
Quoted 10 lines
utils/genrandconfig +7
-2+ if args.toolchains_csv: + # Select a random toolchain configuration + configs = get_toolchain_configs(args.toolchains_csv, args.buildrootdir) - i = randint(0, len(configs) - 1) - toolchainconfig = configs[i] + i = randint(0, len(configs) - 1) + toolchainconfig = configs[i] + else: + toolchainconfig = []
Wow, you lost me here. The commit message says "for randomizing *additional*
toolchain settings", so I assumed that it would still use a toolchainfile but allow randomizing other options.
And I don't see a problem with that. We just have to first run randconfig, and
apply the toolchain config after that.
And I think we can do that unconditionally, even. It would require a little
bit of testing (basically iterating over all the toolchain configs and checking that a valid config can still be generated for each of them) but can be deployed pretty much as is I think.
I agree though that it's more work to do that than the current patch, so
perhaps this is a good first step.
utils/genrandconfig def gen_config(args): · line 421
Quoted 11 lines
utils/genrandconfig +1
-1configlines = list(toolchainconfig)@@ -409,19 +416,22 @@ def gen_config(args): bounded_loop -= 1 subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir, "KCONFIG_PROBABILITY=%d" % randint(1, 20), - "randpackageconfig"]) + "randpackageconfig" if args.toolchains_csv else "randconfig"]) if fixup_config(sysinfo, configfile):
I think the control flow is easier to follow if we change this into
if not fixup_config:
continue
utils/genrandconfig def gen_config(args): · line 427
Quoted 12 lines
utils/genrandconfig +5
-6- break - - subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir, - "olddefconfig"]) + if subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir, + "olddefconfig"]): + continue - 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.
Regards,
Arnout
Quoted 25 lines
utils/genrandconfig +11
-6+ 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",
utils/genrandconfig if __name__ == '__main__': · line 460
Quoted 10 lines
utils/genrandconfig +7
-0+ 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
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 12 lines · Arnout Vandecappelle
Hi James,
Quoted 3 lines · James Hilliard
Currently we only test a limited set of toolchains that are mostly prebuilt, add a flag to allow using randconfig for randomizing additional toolchain settings instead of randpackageconfig.
Oooh, it's been on my wishlist for a loooong time to use randconfig instead of
randpackageconfig in the autobuilders...Quoted 1 line
Quoted 5 lines
Quoted 2 lines
To avoid invalid configs we need to add additional config validation filtering and fixups.
I guess the following 4 patches are supposed to do that? Please keep them
together in a series in the future.
I would say those are more bugs that this patch revealed, the config validation filtering+fixups I'm referring to are just the ones in this patch.
Quoted 15 lines
Quoted 15 lines
Signed-off-by James Hilliard <[email protected]>--- utils/genrandconfig | 52 ++++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 17 deletions(-)utils/genrandconfig +0
-0@@ -315,6 +315,10 @@ def fixup_config(sysinfo, configfile): configlines.remove('BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE=""\n') configlines.append('BR2_PACKAGE_HOST_UBOOT_TOOLS_BOOT_SCRIPT_SOURCE="%s"\n' % bootscr)
Quoted 7 lines
utils/genrandconfig def fixup_config(sysinfo, configfile): · line 320
Quoted 3 lines
utils/genrandconfig +3
-0+ 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.
Quoted 6 lines
Also, I think the proper approach for dealing with required string options is
to give them a default value insupport/config-fragments/minimal.config. Unlike the toolchainfile, the configlines in minimal.config don't all need to be present in the final .config, so we can add stuff there that is only available if the appropriate boolean option gets selected randomly.
Well most of these empty strings need to have a config option removed/filtered IMO.
Quoted 15 lines
Quoted 15 lines
utils/genrandconfig +4
-2+ with open(configfile, "w+") as configf: configf.writelines(configlines)@@ -331,11 +335,14 @@ def gen_config(args): sysinfo = SystemInfo() - # Select a random toolchain configuration - configs = get_toolchain_configs(args.toolchains_csv, args.buildrootdir) + if args.toolchains_csv: + # Select a random toolchain configuration + configs = get_toolchain_configs(args.toolchains_csv, args.buildrootdir)
Quoted 10 lines
utils/genrandconfig def gen_config(args): · line 345
Quoted 6 lines
utils/genrandconfig +4
-2- i = randint(0, len(configs) - 1) - toolchainconfig = configs[i] + i = randint(0, len(configs) - 1) + toolchainconfig = configs[i] + else: + toolchainconfig = []Wow, you lost me here. The commit message says "for randomizing *additional*
toolchain settings", so I assumed that it would still use a toolchainfile but allow randomizing other options.
Well currently toolchains selection is randomized based on the toolchain csv, this
randomizes additional toolchain settings beyond the toolchain csv.
Quoted 3 lines
And I don't see a problem with that. We just have to first run randconfig, and
apply the toolchain config after that.
This is deliberately not using the toolchain configs as I'm trying to test randomizing
toolchains themselves here.
Quoted 5 lines
And I think we can do that unconditionally, even. It would require a little
bit of testing (basically iterating over all the toolchain configs and checking that a valid config can still be generated for each of them) but can be deployed pretty much as is I think.
I think this is more an alternative to the toolchain random selection, this random
method is kinda experimental at the moment IMO so I've kept the codepaths separate.
Quoted 3 lines
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
Note that this autobuilder is an aarch64(running
https://asahilinux.org/) host so
it doesn't use the prebuilt toolchains.
Quoted 11 lines
Quoted 11 lines
utils/genrandconfig +1
-1configlines = list(toolchainconfig)@@ -409,19 +416,22 @@ def gen_config(args): bounded_loop -= 1 subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir, "KCONFIG_PROBABILITY=%d" % randint(1, 20), - "randpackageconfig"]) + "randpackageconfig" if args.toolchains_csv else "randconfig"])
Quoted 6 lines
utils/genrandconfig def gen_config(args): · line 421
Quoted 1 line
utils/genrandconfig +0
-0if fixup_config(sysinfo, configfile):I think the control flow is easier to follow if we change this into
if not
fixup_config:
continue
Changed in v2:
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
Quoted 9 lines
Quoted 9 lines
utils/genrandconfig +3
-4- break - - subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir, - "olddefconfig"]) + if subprocess.check_call(["make", "O=%s" % args.outputdir, "-C", args.buildrootdir, + "olddefconfig"]): + continue
Quoted 7 lines
utils/genrandconfig def gen_config(args): · line 427
Quoted 4 lines
utils/genrandconfig +2
-2- 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.
Quoted 40 lines
Regards,
ArnoutQuoted 34 lines
utils/genrandconfig +18
-6+ 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()
Quoted 1 line
utils/genrandconfig if __name__ == '__main__': · line 460
Quoted 1 line
utils/genrandconfig +0
-0# We need the absolute path to use with O=, because the relative
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 5 lines · James Hilliard
Quoted 4 lines · Arnout Vandecappelle
Hi James,
On 02/04/2022 03:05, James Hilliard wrote:
[snip]
Quoted 11 lines
Quoted 7 lines
utils/genrandconfig def fixup_config(sysinfo, configfile): · line 320
Quoted 3 lines
utils/genrandconfig +3
-0+ 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.
[snip]
Quoted 6 lines
Quoted 2 lines
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?
Quoted 3 lines
Note that this autobuilder is an aarch64(running
https://asahilinux.org/) host so
it doesn't use the prebuilt toolchains.
[snip]
Quoted 9 lines
Quoted 7 lines
utils/genrandconfig def gen_config(args): · line 427
Quoted 4 lines
utils/genrandconfig +2
-2- 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.
Regards,
Arnout
Quoted 34 lines
Quoted 34 lines
Quoted 34 lines
utils/genrandconfig +18
-6+ 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()
Quoted 1 line
Quoted 1 line
utils/genrandconfig if __name__ == '__main__': · line 460
Quoted 1 line
utils/genrandconfig +0
-0# We need the absolute path to use with O=, because the relative
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 17 lines · Arnout Vandecappelle
Quoted 5 lines · James Hilliard
Quoted 4 lines · Arnout Vandecappelle
Hi James,
On 02/04/2022 03:05, James Hilliard wrote:
[snip]
Quoted 8 lines
Quoted 7 lines
Quoted 3 lines
+ 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).
Quoted 5 lines
Quoted 3 lines
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.
Looks like the check is already there in skeleton-custom.mk:
ifeq ($(BR2_PACKAGE_SKELETON_CUSTOM)$(BR_BUILDING),yy) ifeq ($(SKELETON_CUSTOM_PATH),)
$(error No path specified for the custom skeleton) endif
endif
So I don't understand why this fixup is needed...
Regards,
Arnout
Quoted 74 lines
[snip]
Quoted 6 lines
Quoted 2 lines
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%29So this is running a modified buildroot-test that passes the --no-toolchains-csv option?
Quoted 3 lines
Note that this autobuilder is an aarch64(running
https://asahilinux.org/) host so
it doesn't use the prebuilt toolchains.[snip]
Quoted 11 lines
Quoted 9 lines
Quoted 6 lines
- 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.
Regards,
ArnoutQuoted 39 lines
Quoted 39 lines
Quoted 39 lines
+ 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 0if
__name__== '__main__':utils/genrandconfig +12
-4@@ -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()
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
# We need the absolute path to use with O=, because the relative
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 18 lines · Arnout Vandecappelle
Quoted 5 lines · James Hilliard
Quoted 4 lines · Arnout Vandecappelle
Hi James,
On 02/04/2022 03:05, James Hilliard wrote:
[snip]
Quoted 8 lines
Quoted 7 lines
utils/genrandconfig def fixup_config(sysinfo, configfile): · line 320
Quoted 3 lines
utils/genrandconfig +3
-0+ 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).
Quoted 7 lines
Quoted 3 lines
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.
Quoted 11 lines
[snip]
Quoted 6 lines
Quoted 2 lines
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%29So 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.
Quoted 11 lines
Quoted 4 lines
Note that this autobuilder is an aarch64(running
https://asahilinux.org/) host so
it doesn't use the prebuilt toolchains.[snip]
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
utils/genrandconfig +2
-2- 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"]):
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
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.
Quoted 39 lines
Regards,
ArnoutQuoted 34 lines
Quoted 34 lines
Quoted 34 lines
utils/genrandconfig +18
-6+ 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()
Quoted 1 line
Quoted 1 line
Quoted 1 line
utils/genrandconfig if __name__ == '__main__': · line 460
Quoted 1 line
utils/genrandconfig +0
-0# We need the absolute path to use with O=, because the relative
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
Quoted 18 lines · Arnout Vandecappelle
Quoted 5 lines · James Hilliard
Quoted 4 lines · Arnout Vandecappelle
Hi James,
On 02/04/2022 03:05, James Hilliard wrote:
[snip]
Quoted 8 lines
Quoted 7 lines
utils/genrandconfig def fixup_config(sysinfo, configfile): · line 320
Quoted 3 lines
utils/genrandconfig +3
-0+ 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).
Quoted 7 lines
Quoted 3 lines
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.
I was looking at the defconfig actually instead of the config for that, I think we don't
need the retry saving loop with this anymore, I ran randomizations in a loop for a while
and I'm not seeing any failures anymore due to invalid configs getting past fixup_config:
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
Quoted 22 lines
[snip]
Quoted 6 lines
Quoted 2 lines
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%29So this is running a modified buildroot-test that passes the
--no-toolchains-csv option?Quoted 3 lines
Note that this autobuilder is an aarch64(running
https://asahilinux.org/) host so
it doesn't use the prebuilt toolchains.[snip]
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines
utils/genrandconfig +2
-2- 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"]):
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
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.
I think it was this issue probably:
https://patchwork.ozlabs.org/project/buildroot/patch/[email protected]/
Quoted 39 lines
Regards,
ArnoutQuoted 34 lines
Quoted 34 lines
Quoted 34 lines
utils/genrandconfig +18
-6+ 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()
Quoted 1 line
Quoted 1 line
Quoted 1 line
utils/genrandconfig if __name__ == '__main__': · line 460
Quoted 1 line
utils/genrandconfig +0
-0# We need the absolute path to use with O=, because the relative
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot