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

Fix Traceback in CMSIS export. #4173

Merged
merged 1 commit into from Apr 19, 2017

Conversation

Projects
None yet
5 participants
@theotherjimmy
Contributor

theotherjimmy commented Apr 11, 2017

How to reproduce

Then try to export any project online to cmsis. You will get this
trackback (unbeknownst to you):

TypeError: join() takes at least 1 argument (0 given)
  File "django/core/handlers/base.py", line 132, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "django/views/decorators/csrf.py", line 58, in wrapped_view
    return view_func(*args, **kwargs)
  File "django/contrib/auth/decorators.py", line 22, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "mbed/repositories/views.py", line 1601, in web_export
    name=repo.slug)
  File "mbed_compiler/export.py", line 149, in export
    notify=notify
  File "tools/project_api.py", line 222, in export_project
    macros=macros)
  File "tools/project_api.py", line 89, in generate_project_files
    exporter.generate()
  File "tools/export/cmsis/__init__.py", line 147, in generate
    'project_files': tostring(self.group_project_files(srcs, Element('files'))),
  File "tools/export/cmsis/__init__.py", line 131, in group_project_files
    f.name = os.path.join(*spl[1:])

That should not happen

New behavior

Export works.

Testing

¯\_(ツ)_/¯

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Apr 12, 2017

Might be worth adding to the commit message how this fixes it (why <= 2).

Fix Traceback in CMSIS export.
The traceback was caused when a file without a parent directory (which
is implicitly ".") is added to the resources object. The code assumed
that all files within the resources object would have a parent
directory.

This commit changes the check to account for files that are in the root
directory of a project and have no preceding `./`

@theotherjimmy theotherjimmy force-pushed the theotherjimmy:fix-cmsis-traceback branch to 6a32567 Apr 12, 2017

@theotherjimmy

This comment has been minimized.

Contributor

theotherjimmy commented Apr 12, 2017

@0xc0170 Included explanation of why this is fixed in the commit message.

@0xc0170

This comment has been minimized.

Member

0xc0170 commented Apr 18, 2017

/morph test-nightly

@0xc0170 0xc0170 added needs: CI and removed needs: review labels Apr 18, 2017

@bridadan

This comment has been minimized.

Contributor

bridadan commented Apr 18, 2017

^ Actually not the worst thing the bot wasn't listening then, you want the export test for this 😄

/morph export-build

@mbed-bot

This comment has been minimized.

mbed-bot commented Apr 19, 2017

Result: SUCCESS

Your command has finished executing! Here's what you wrote!

/morph export-build

Output

mbed Build Number: 7

All exports and builds passed!

@sg- sg- added ready for merge and removed needs: CI labels Apr 19, 2017

@sg- sg- merged commit a67eca5 into ARMmbed:master Apr 19, 2017

4 checks passed

Cam-CI uvisor Build & Test Success
Details
ci/morph-export-build Job has completed
Details
continuous-integration/jenkins/pr-head This commit looks good
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment