build_sdk.py: add support for minimal build#131
Conversation
Would this be solved once the SDK is released? |
|
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. |
|
Yep I agree I just meant if your specific use-case would still need these options. |
|
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. |
|
Yes, those demos will use the binary release. |
|
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. |
|
I changed it to take multiple |
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 |
|
The PR as is allows one to specify Would you prefer I'll add the existence check. |
build_sdk.py
Outdated
| with tar_open(source_tar_file, "w:gz") as tar: | ||
| for filename in filenames: | ||
| tar.add(filename, arcname=source_prefix / filename, filter=tar_filter) | ||
| if not args.skip_source_tarball: |
There was a problem hiding this comment.
This skips both the SDK tar and the source tar. Can you call this option just --skip-tar instead?
Sorry that's what I was trying to say in my previous comment. Doing |
|
I've made both of those changes. |
build_sdk.py
Outdated
| parser.add_argument("--boards", metavar="BOARDS", help="Comma-separated list of boards to support. When absent, all boards are supported.") | ||
| parser.add_argument("--configs", metavar="CONFIGS", help="Comma-separated list of configurations to support. When absent, all configurations are supported.") | ||
| parser.add_argument("--skip-docs", action="store_true", help="Docs will not be built") | ||
| parser.add_argument("--skip-tar", action="store_true", help="Source tarball will not be built") |
There was a problem hiding this comment.
| parser.add_argument("--skip-tar", action="store_true", help="Source tarball will not be built") | |
| parser.add_argument("--skip-tar", action="store_true", help="SDK and source tarballs will not be built") |
There was a problem hiding this comment.
Sorry, one more minor thing and then it's good to merge.
Signed-off-by: Nick Spinale <nick@nickspinale.com>
|
Cool, thanks! |
This PR adds four new options to the
build_sdk.pyCLI:--only-board <board>: only artifacts for<board>will be built--only-config <config>: only artifacts for<config>(either"debug"or"release") will be built--skip-docs: docs will not be built--skip-source-tarball: source tarball will not be builtThese 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.