seL4 / microkit

Microkit - A simple operating system framework for the seL4 microkernel
Other
68 stars 37 forks source link

build_sdk.py: add support for minimal build #131

Closed nspin closed 6 days ago

nspin commented 3 weeks ago

This PR adds four new options to the build_sdk.py CLI:

These options are useful in cases where the SDK is being built by a build system that doesn't have any use for artifacts other than those necessary for building a particular system.

Ivan-Velickovic commented 3 weeks ago

These options are useful in cases where the SDK is being built by a build system that doesn't have any use for artifacts other than those necessary for building a particular system.

Would this be solved once the SDK is released?

nspin commented 3 weeks ago

These options would still be useful for cases where projects build Microkit from source. One example that comes to mind is working off of HEAD rather than the latest release. Another example is hacking on Microkit itself.

Ivan-Velickovic commented 3 weeks ago

Yep I agree I just meant if your specific use-case would still need these options.

Ivan-Velickovic commented 3 weeks ago

I assume the use-case is for the Rust Microkit demos which I think should just be able to use a released version available for download but just want to check.

nspin commented 3 weeks ago

Yes, those demos will use the binary release.

Ivan-Velickovic commented 3 weeks ago

Can you change —only-board to something like —boards and make it take a comma separated list of boards that are built, same thing for the config?

This has been pretty useful for me in the past and is something I have in my fork.

nspin commented 6 days ago

I changed it to take multiple --board and --config arguments. When absent, the default is all. How is that?

Ivan-Velickovic commented 6 days ago

I changed it to take multiple --board and --config arguments. When absent, the default is all. How is that?

It's fairly common for me to specify multiple boards when developing so would still prefer the comma separated list.

Something like:

    if args.boards:
        board_names = args.boards.split(",")
        supported_board_names = [board.name for board in SUPPORTED_BOARDS]
        # Check that we are filtering boards that actually are supported
        for board in board_names:
            if board not in supported_board_names:
                raise Exception(f"Trying to build a board: {board} that does not exist in supported list.")
        selected_boards = board_names
    else:
        selected_boards = SUPPORTED_BOARDS
nspin commented 6 days ago

The PR as is allows one to specify --board and --config multiple times to select multiple boards or configs. For example:

microkit --board imx8mm_evk --board qemu_virt_aarch64 --config release --config debug

Would you prefer --boards BOARD1,BOARD2 or --board BOARD1 --board BOARD2?

I'll add the existence check.

Ivan-Velickovic commented 6 days ago

Would you prefer --boards BOARD1,BOARD2 or --board BOARD1 --board BOARD2?

Sorry that's what I was trying to say in my previous comment. Doing --boards BOARD1,BOARD2 saves me some typing when targeting more than one board, that's all.

nspin commented 6 days ago

I've made both of those changes.

Ivan-Velickovic commented 6 days ago

Cool, thanks!