This functionality was already present in the ARM toolchain script, but
this commit adds this across all toolchain scripts. Solves an issue that
cropped up where a build error wasn't being printed unless the verbose
flag was used. This should now print any existing error messages that have
been printed when the compiler output is being parsed.
Previously, when building tests with test.py, if an exception occurred, the
error message would be masked by the function 'build_tests'. This commit
handles NotSupportedExceptions and ToolExceptions, but lets all other
Exceptions propigate up to the caller function. In most cases, this is the
CLI scripts, which will print a traceback. This will allow us to better
debug the python tools if errors occur.
This commit fixes an issue where the output from memap.py was not
consistent across all output formats. This issue stemmed from the fact
that a few important calculations were being performed at output
generation time. This has been moved to the 'parse' function and saved for
future use by the 'generate' functions.
Because this commit saves more data to the MemapParser instance, there
were some name collisions. The public member 'mem_summary' has been
renamed to 'mem_report'. 'mem_report' contains the data structure used by
the json generator. This includes both the section data and the memory
summary. The 'mem_summary' member now just contains the summary. The
summary includes total allocated heap, total static RAM, etc.
*Changes*
- Parallel export
- mbed-os tests added
- specified release version (default to 5)
- default tests AND targets dependent on specified release version
This addresses the issue where building tests via test.py always triggered
a clean build. This is because the mbed_config.h file was being deleted from
the shared OS build to ensure that the correct config was always being
used. However, this contanstly triggered a rebuild of the OS since the
config file was not present.
Due to the shared build, having multiple app configurations that could
override the OS settings is not possible. For this reason, we now ignore
app config files unless explicitly set via the command line option
'--app-config'. Though there will now be two mbed_config.h files in the
include path of the build, it shouldn't matter since the contents will be
the same.
The previous code used a variable that was internal to the Target class.
This commit removes the argument to `set_targets_json_location`
completely, which forces Target to use the default locatio internally.
Custom targets were the origin of a number of issues with the mbed
tools, so it was decided that they need to be removed. This PR does just
that (and moves the "custom_targets" part of the config system tests
into a separate, per-test "targets.json" file to preserve the test
functionality).
uVision4 is no longer maintained by the Keil team (support was stopped
long time ago).
This is why we need to make the uvision exporter able to generate uVision5
projects by default (which is based on software packs).
Also, adding note that the uvision4 exporter is now deprecated and will be
removed in the future.
Simplicity Studio exporter doesnt really support header files in the root directory (looking at you, mbed_config.h), so this is a workaround for that issue.
The previous way of finding group names found the encompassing directory of each file. If the project is exported from the online compiler, this resulted in temporary folder names like tmpyKKWv_ showing up as group names.
I propose defaulting to the project name if the file is in the project root.
The dict allows the user of the exporter api to specify the result directory
of particular groups of scanned dirs. This will be used by the online exporters
to spoof everything being in the same directory when they are not. It may also
be used by tests, if they would like to export something that looks exactly
like a normal project.
Affects these ides:
- Atmel Studio
- Code Red (I don't think we support this)
- Coide
- DS-5
- E2Studio
- EMblocks
- KDS
- Simplicity v3
- SW 4 STM32
also corrects flags usage in EMBlocks
Makes several broad changes:
- removes dead code that dealt with the online build system
- replaces export function with a much simpler one that:
- does not copy any sources
- the zip file hits the disk
- the mbed_config.h hits the disk
- the project files hit the disk
- nothing else hits the disk
- exporters use Resource object scanned with a toolchain
- progen exporters don't optionally build a project instead they have a
build function that may be called afterwards
- much of the code passes pylint (have a score of 9 or above):
- project.py
- project_api.py
- export/__init__.py
- export/exporters.py
- test/export/build_test.py
#2613 should be merged first
Using test_api, I found that the test names were dependent on where mbed-os (if that is the root) is stored on disk if you provide anything other than '.' as the root directory.
This would change names like:
```
repos-mbed-os-example-blinky-mbed-os-features-storage-feature_storage-tests-cfstore-example3
```
to
```
features-storage-feature_storage-tests-cfstore-example3
```
The shared `prepare_toolchain` and `scan_resources` functions in build_api
expect a list, not a string. This is different from the
toolchain.scan_resources function. Now the functions are being used
correctly within the `find_tests` function in test_api
This came up when building tests, but affects any library that's built
that uses config and included as "source" with the mbed tools.
JSON files are not copied by default when building a library, so when this
is built it loses the config data associated with the library. This commit
copies all JSON files into the build directory when building libraries.
This leads to two mbed_config.h files existing if the build directories
are different between the library and application build. This is the case
when building tests, so an option build_library was added to remove the
mbed_config.h file when compilation is done. This disabled by default when
building libraries, but it is enabled when building tests.
These two flags are already tested in tools/toolchains/gcc.py but can't
be used at the moment because they are not part of the argument list of
the option parameter.
Keep track of the current size allocated, maximum size allocated,
number of allocations, failed allocations and total size allocated for
both GCC and ARM. Report the maximum size allocated at the end of
testing.
Also, add a test to verify heap metrics are working as expected.
The output of the GCC compiler is such that the toolchain regex sometimes
got hung up on the ':' charcter being printed in front of the drive letter when
running on Windows. This PR changes the matching logic to be more flexible
by using 'search' to check the entire string for a match, not just the
beginning of the string.
`build_lib` wasn't aware of configuration data, so some of the source
files that depends on configuration data fail to compile. This commit
fixes that by making `build_lib` aware of configuration data.
Fixes#2360.
New error:
[Error] Toolchain path does not exist for IAR.
Current value: /default/path/that/doesnt/exist
(System exit before any build system calls)
Previously, build_mbed_libs didn't take into account the configuration.
This is a problem when doing a binary release, since mbed_lib.json
contains configuration data relevant to the binary release.
The micro:bit is running rtos tests, even though this is a 16K device
that should not be using multiple threads. This patch removes it from
the 2.0 RTOS tests.
Now "all" depend on the project merged with the soft device,
the goal merged has been renamed into the file it generate and now depend
on the realization of $(PROJECT).hex
At some point, the actual code that did the "clean" for build_library was
removed. This also affected building and cleaning tests. This adds this
capability back to the build API.
Unlike other libraries, uvisor is currently integrated into the build
system, with special cases based on its addition as a feature. This
suggests we should also have tests for these special cases.
Previously a scanning for config terminated on comparison of the feature
set, however at some point the set was changed to a list. This resulted
in non-deterministic failures based on list order.
Except for IAR, it does not support the --preinclude option for assembly
files but all of the other exporters can. It was less code to remove it
in IAR than to explicitly add it in all of the other exporters.
This PR enforces that the default_build in a target's definition in
hal/targets.json is set to standard to be included in the version 5
release.
This is being enforced because small builds do not support
multi-threading. This makes the capabilities more consistent across all
boards in the version 5 release.
NOTE: This removes the MOTE_L152RC and the LPC11U68
from the version 5 release list because the 'default_build' for these
targets is currently set to 'small'.
The key 'release' in hal/targets.json is ambiguous. This changes the key
to 'release_versions' to emphasize that the entries should be version
numbers/strings and that it should be an array, not a singular value.
This modifies the behavior of 'mcu_toolchain_matrix' in build_api.py. It
now prints release version support in the matrix. It also defaults to only
showing targets in mbed OS 5. You can still show older release versions by
modifying the 'release_version' parameter of the function.
Previously, the condition for including a target in a release was decided
by a 'release' key being set to 'true' in hal/targets.json. This doesn't
have enough granularity when we release multiple versions of mbed. This PR
changes the 'release' key to an array of strings, where each member is a
version that the target supports. Currently the valid versions are '2' and
'5'.
This PR also adds more robust checking for invalid target configurations
in a release. This is enforced whenever the release list is built from the
data, preventing invalid targets from coming into the release.
Finally, it updates the build_release.py script to use the new api for
fetching release targets.
Move the library files used by both nanostack and client into a common
location. This allows both client and nanostack to be built stand-alone.
The patch moves the following libraries into a common location:
-mbed-client-c
-mbed-client-randlib
-mbed-trace
-nanostack-hal-mbed-cmsis-rtos
-nanostack-libservice
-sal-stack-nanostack-eventloop
And moves the library 'coap-service' from client into nanostack.
Previously, test discovery throught test.py used its own logic to find
tests. This was mostly a subset of the rules used during the build
process. It respected .mbedignore files, but it did not respect TARGET_,
TOOLCHAIN_, and FEATURES_ directories. This change now uses the same logic
used during building to respect these folders. Tests under these folders
that are not being pulled in for the given target will be ignored.