-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Tools: Extract resources object and implement incremental scan #7183
Conversation
b52881d
to
1fe20b1
Compare
@cmonr 🤞 I got the last "use paths" bug. That should unblock Oulu CI. Ready for review. |
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.
LGTM. A couple of nits and questions, but should be good to go afterwards.
tools/.#make.py
Outdated
@@ -0,0 +1 @@ | |||
jimmy@archlinux.3808:1528302063 |
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.
Something tells me this shouldn't be here
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.
Oh for sure. I'm going to rebase and purge it from the history.
tools/build_api.py
Outdated
# library | ||
|
||
# A number of compiled files need to be copied as objects as opposed to | ||
# way the linker search for symbols in archives. These are: |
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.
- the way
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.
lol. I'll fix that.
@@ -976,141 +907,138 @@ def build_mbed_libs(target, toolchain_name, clean=False, macros=None, | |||
properties - UUUUHHHHH beats me |
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 should probably get a better description at some point.
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.
At some point, when I see it used. (I have not seen it passed in)
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.
I just looked around, and it seems that there were plans for a thing called properties, but no implementation using them...
mbed_resources = Resources(notify).scan_with_toolchain( | ||
[MBED_DRIVERS, MBED_PLATFORM, MBED_HAL], toolchain) | ||
|
||
incdirs = cmsis_res.inc_dirs + hal_res.inc_dirs + library_incdirs |
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.
Beautiful
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.
Thanks.
b4a0ba2
to
ba35a00
Compare
@cmonr I rebased out those problems that you commented on. |
Master:
This branch:
|
2a0e535
to
0942442
Compare
|
d1d720c
to
32398d4
Compare
Some changes have been made since last review.
32398d4
to
fa2369c
Compare
rebased. |
@cmonr Ready for review. |
tools/get_config.py
Outdated
if options.tool is None: | ||
args_error(parser, "argument -t/--toolchain is required") | ||
toolchain = options.tool[0] | ||
toolchain = options.tool[0] if options.tool is not None else None |
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.
Any reason this couldn't be shrunk to options.tool[0] if options.tool else None
?
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.
No. Originally we had to worry about empty strings and what not.
(headername, " ".join(locations))) | ||
return count | ||
|
||
def win_to_unix(self): |
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.
💯
8af900c
to
750a2ac
Compare
All conflicts were with my other PRs... |
/morph build |
Build : SUCCESSBuild number : 2619 Triggering tests/morph test |
Exporter Build : SUCCESSBuild number : 2259 |
Test : SUCCESSBuild number : 2368 |
Looks like this PR has a dependency on another PR targeted for 5.10. |
As usual, dependency might be the wrong word here. It was definitely rebased on top of mayn other PRs. |
Correct, it was. Not sure what a better term would be, but what I do know was that this PR made changes on top of this (#7133) PR, which caused pytest and build failures. |
Tools: Extract resources object and implement incremental scan
Description
I found that the resource object being part of the tool chain, and depending on
tool chain infrastructure was a bit odd, so I extracted resources from tool
chains. The resulting code is quite a bit more clear in it's purpose and can be a
tad smaller (extra documentation and formatting excluded). I made the resources
object fully incremental, meaning that the scan stops early otfen for targets,
toolchains and features, and can easily pick itself back up where it left off.
A side effect of fully incremental scan is that configuration, which cannot depend
on a tool chain, does not need a tool chain specified to work correctly. I updated
get_config.py (
mbed compile --config
's back end) to reflect this.Fixes #6038 (
--source
with a path starting with../
shows incorrectly in memap)Fixes #5357 (
--source
with uvision exporter creates broken project files)(Possibly more as I find issues fixed by being up front about our data model)
TODO
file_basepath
member with something more suitabletoolchain.scan_resources
andscan_resources
Pull request type