-
Notifications
You must be signed in to change notification settings - Fork 3k
Fix CI for branch feature-public-headers #11093
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
Changes from all commits
e1cb2e8
2e5809e
8253495
f9d0147
a2ef5bc
dd2459f
cd29eea
34cfa94
78b84a4
2c0f1e0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"name": "usb" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -397,14 +397,27 @@ def get_arch_file(self, objects): | |
|
||
# THIS METHOD IS BEING CALLED BY THE MBED ONLINE BUILD SYSTEM | ||
# ANY CHANGE OF PARAMETERS OR RETURN VALUES WILL BREAK COMPATIBILITY | ||
def compile_sources(self, resources, inc_dirs=None): | ||
def compile_sources(self, resources, inc_dirs=None, exclude_paths=None): | ||
# Web IDE progress bar for project build | ||
files_to_compile = ( | ||
resources.get_file_refs(FileType.ASM_SRC) + | ||
resources.get_file_refs(FileType.C_SRC) + | ||
resources.get_file_refs(FileType.CPP_SRC) | ||
) | ||
self.to_be_compiled = len(files_to_compile) | ||
# Remove files from paths to be excluded from the build and create | ||
# a compilation queue. | ||
compile_queue = ( | ||
files_to_compile | ||
if not exclude_paths | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think the ternary operator here makes the code more difficult to read, a simple |
||
else [ | ||
file_to_compile | ||
for exclude_path in exclude_paths | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure this list comprehension does what you want. It works ok when there is a single exclude path, but when there are multiple exclude paths the file to compile with be included once for every exclude path. I don't think it would be a bad idea to break out this functionality into a small function and unit test. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The scope of this change is to provide a short-term workaround to maintain Mbed OS 2 compatibility until legacy build support is removed. |
||
for file_to_compile in files_to_compile | ||
if exclude_path not in file_to_compile.path | ||
] | ||
) | ||
|
||
self.to_be_compiled = len(compile_queue) | ||
self.compiled = 0 | ||
|
||
self.notify.cc_verbose("Macros: " + ' '.join([ | ||
|
@@ -434,8 +447,8 @@ def compile_sources(self, resources, inc_dirs=None): | |
self.dump_build_profile() | ||
|
||
# Sort compile queue for consistency | ||
files_to_compile.sort() | ||
for source in files_to_compile: | ||
compile_queue.sort() | ||
for source in compile_queue: | ||
object = self.relative_object_path(self.build_dir, source) | ||
|
||
# Queue mode (multiprocessing) | ||
|
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 addition of the
exclude_paths
parameter will mean that it will be included the statement:It would be possible to remove this parameter when legacy build support is removed but I'm sure by then we would have forgotten. My suggestion would be to create a private function which has this parameter but leave this interface as it is, e.g.
I would also ask whether there is a different between
dirs
andpaths
the two different terminologies in the parameter list might be confusing.