-
Notifications
You must be signed in to change notification settings - Fork 2.1k
dist/tools: Add compile_like_murdock #18803
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ping @Teufelchen1 @benpicco |
I would see if I can add a trick to also add apps with x module. |
|
||
def main(): | ||
parser = argparse.ArgumentParser() | ||
parser.add_argument("-b", "--boards", nargs="+", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choosing an invalid / not existing board does not result in an error. Is this intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you board is not available it just will skip it and should be somewhat apparent to the user, especially if it is a dry run.
We cannot easily know the boards that are available as this should also work with external boards.
I could add some logic if any board has not be selected in the whole run then maybe make a note at the end. Or I can add some less whimsical statistics such as tests run on each board (or pass/fail per board). This is kind of going against the idea of a simple wrapper around what was a few bash commands.
parser.add_argument("-n", "--no-nightly", action="store_false", | ||
help=("Prevent running as nightly, by default NIGHTLY " | ||
"is set to 1, making more extensive testing.")) | ||
parser.add_argument("-a", "--apps", nargs="+", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Choosing an non-existent app results in a traceback. Since this will be most of the time a typo, I would suggest catching that exception and just print to the user something like: "Couldn't find the app FOO".
Keep in mind that the current code crashes after already running some apps when multiple had been given (depending on the order of apps). e.g. ./dist/tools/compile_test/compile_like_murdock.py -b slstk3400a -a examples/hello-world examples/typo-in-app
fails after already running hello-world. Given that I would opt to check for existent either before running anything or not crashing but log afterwards which apps haven't been run and why. I prefer the first option.
print(f"{app: <30} {board: <30} FAIL: Kconfig module or pkg " | ||
"mismatch") | ||
else: | ||
print(app, board, "FAIL") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing the <30 spacing...
if "mismatch" in err.output: | ||
print(f"{app: <30} {board: <30} FAIL: Kconfig hash mismatch") | ||
elif lines[-3].startswith('< ') or lines[-3].startswith('> '): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe these should be switched as module mismatches almost always means hash mismatches but not the other way around.
Anyone interested in this tool? |
I do think this is convenient and a good addition to the workflow. We should however IMO be careful to not have to many competing solution to basically scratch roughly the same itch. Could there be some de-duplication performed between |
This was originally just a wrapper for a few lines of bash
Probably the place it belongs is the |
How about adding a documentation page instead that lists which tool does what? |
I mean instead of reworking. Apparently the use cases do differ enough to justify different implementations, but that was at least to me not obvious. Sorry for being so sparse with words, I was in a rush 😅 |
No problem, I get not having time. Good point on the docs, I thought I could get away with just a docstring but will make it more official and add info on the other tools. |
I actually think, for now, the docstring should suffice? This is only really mean to be used by maintainers/non-trivial contributors. The compile_test.py is only referenced in 2 places.
If we really want to be careful with this tool I can just rename Maybe a different PR... Any opinions? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This sounds pretty useful and it does not affect any existing scripts - so let's get this in!
Just one nit to make static tests happy:
import datetime | ||
|
||
|
||
_RATIOS = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🤣
585f259
to
5208c08
Compare
_RATIOS = [ | ||
('digits of pi calculated', 4423213), | ||
('bitcoins mined', 0.000000077), | ||
('meters driven in a Telsa', 5), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
('meters driven in a Telsa', 5), | |
('meters driven in a Tesla', 5), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oops very important!
Helper script to pre-test murdock build conditions. This is intended to compile like murdock giving control for only a subset of boards or applications. One can use this if only a limited change should be build tested. Defaults boards and apps are selected to be an early warning if something is wrong. This should be used before triggering much larger murdock builds. The following use cases are: I made a change to something in the stm32 clocks... ./compile_like_murdock.py -c stm32 I changed a driver the DHT driver ./compile_like_murdock.py -a tests/driver_dht tests/saul I changed a nucleo-f103rb board... ./compile_like_murdock.py -a tests/driver_dht tests/saul
5208c08
to
53d266e
Compare
bors merge |
Build succeeded:
|
It seems that the |
Actually it seems fine, I will have to ask @jia200x to test again on his setup... |
Contribution description
Helper script to pre-test murdock build conditions.
This is intended to compile like murdock giving control for only a subset of boards or applications. One can use this if only a limited change should be build tested. Defaults boards and apps are selected to be an early warning if something is wrong.
This should be used before triggering much larger murdock builds.
The following use cases are:
I made a change to something in the stm32 clocks... ./compile_like_murdock.py -c stm32
I changed a driver the DHT driver
./compile_like_murdock.py -a tests/driver_dht tests/saul
I changed a nucleo-f103rb board...
./compile_like_murdock.py -a tests/driver_dht tests/saul
Testing procedure
View the help...
Do a dry run of the cpu...
Play with each of the args, try adding a module to hello-world to get a module mismatch.
Issues/PRs references