Skip to content

Conversation

0xc0170
Copy link
Contributor

@0xc0170 0xc0170 commented Jun 27, 2016

tested with export using mbed (the change, introducing a flag to indicate if we use relative paths or not) and project.py (no regression there as copied flag for progen stays as it was). The fix is the first commit .

The second commit is a cosmetic change , that actually can be breaking for callers of export as I renamed the default argument from relative to sources_relative, as it is more clear what's the intention. I can revert it , just proposing an unification of this flag in the 2 files.

Tested with uvision and IAR (checked the paths are correct ). Using master of project generator (v0.9x should work as there are no changes required for this patch in the progen).

@bogdanm @theotherjimmy

0xc0170 added 2 commits June 27, 2016 15:25
if we work with relative sources, the flag should be set to True, otherwise
False.

This fixes wrong paths when exporting with --source argument. The exporter would
assume sources were copied, and thus reference them all within the root of the generated
project.
relative did not contain enough details what's the intention with
this flag.
@bogdanm
Copy link
Contributor

bogdanm commented Jun 27, 2016

LGTM. A quick scan for relative confirms that the second commit is very likely not a breaking change:

>grep -rsInw relative tools
tools/build_release.py:173:    parser.add_option("", "--build-tests", dest="build_tests", help="Build all tests in the given directories (relative to /libraries/tests)")
tools/export/exporters.py:128:    def scan_and_copy_resources(self, prj_paths, trg_path, relative=False):
tools/export/exporters.py:156:        if not relative:
tools/export/simplicityv3_slsproj.tmpl:27:{# Add all include paths to the managed build compiler, paths relative to project #}
tools/export/simplicityv3_slsproj.tmpl:85:{# Add all include paths to the managed build compiler, paths relative to project #}
tools/export/sw4stm32_language_settings_commom.tmpl:8:                  <provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="1343080084626211886" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
tools/export/sw4stm32_language_settings_commom.tmpl:19:                 <provider class="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" console="false" env-hash="1343080084626211886" id="fr.ac6.mcu.ide.build.CrossBuiltinSpecsDetector" keep-relative-paths="false" name="Ac6 SW4 STM32 MCU Built-in Compiler Settings" parameter="${COMMAND} ${FLAGS} -E -P -v -dD &quot;${INPUTS}&quot;" prefer-non-shared="true">
tools/export/__init__.py:61:           tempdir=None, clean=True, extra_symbols=None, zip=True, relative=False, build_url_resolver=online_build_url_resolver):
tools/export/__init__.py:78:            exporter.scan_and_copy_resources(project_path, tempdir, relative)
tools/export/__init__.py:105:                    exporter.scan_and_copy_resources(project_path, tempdir, relative)
tools/project.py:141:    # source_dir = use relative paths, otherwise sources are copied
tools/project.py:214:        tmp_path, report = export(project_dir, project_name, ide, mcu, project_dir[0], project_temp, clean=clean, zip=zip, extra_symbols=lib_symbols, relative=sources_relative)
tools/targets.py:161:        # 'progen' needs the full path to the template (the path in JSON is relative to tools/export)
tools/test_api.py:873:            # When the build and test system were separate, this was relative to a

But cc @screamerbg for good measure.

@screamerbg
Copy link
Contributor

screamerbg commented Jun 27, 2016

LGTM 👍

@bogdanm bogdanm merged commit 104b8fa into ARMmbed:master Jun 27, 2016
@0xc0170 0xc0170 deleted the fix_paths branch June 27, 2016 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants