Skip to content

Fix Traceback in CMSIS export. #4173

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

Merged
merged 1 commit into from
Apr 19, 2017
Merged

Conversation

theotherjimmy
Copy link
Contributor

@theotherjimmy 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
Copy link
Contributor

0xc0170 commented Apr 12, 2017

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

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
Copy link
Contributor Author

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

@0xc0170
Copy link
Contributor

0xc0170 commented Apr 18, 2017

/morph test-nightly

@bridadan
Copy link
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
Copy link

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- merged commit a67eca5 into ARMmbed:master Apr 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants