Skip to content

Readable error when toolchain paths not set. #2405

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

Closed
wants to merge 1 commit into from

Conversation

sarahmarshy
Copy link
Contributor

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)

Fixes ARMmbed#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)
@0xc0170
Copy link
Contributor

0xc0170 commented Aug 10, 2016

LGTM

@theotherjimmy @screamerbg please review

@bridadan
Copy link
Contributor

@sarahmarshy yay for better errors!

This problem affects build.py, test.py, and other script that actually uses the toolchains as well, not just make.py. Maybe there's a common place this can be implemented? My first thought was in settings.py, but that might not work correctly since it doesn't know what toolchain is actually being used.

This might need to go in tools/toolchains/__init__.py or something. Then it could error at runtime if it can't find it's own binary or something.

@sarahmarshy
Copy link
Contributor Author

sarahmarshy commented Aug 10, 2016

@bridadan I also thought of settings.py, but we don't want to error on a missing path for a tool not in use, as you said. I think the same problem might arise in tools/toolchain/__init__.py. It might be better suited in the constructor of each respective toolchain.

@sarahmarshy
Copy link
Contributor Author

I would like to put it in the base class constructor, so we could have minimal changes, but the class names do not correspond 1:1 with the dictionary keys in TOOLCHAIN_PATHS. ARM_MICRO (class) uses ARM path to find system libraries. I will look into and submit a new PR.

@bridadan
Copy link
Contributor

@sarahmarshy Yeah I think the constructor is probably the way to go, though @screamerbg may have a different idea.

@theotherjimmy
Copy link
Contributor

I disagree with adding it to the toolchains' constructor for several reasons:

  • It allows a constructor to fail
  • Many uses of the toolchain classes do not invoke a compiler
    • the online export system, for example, would not be able to export to any non-armc5 export. That would be a BAD THING (TM)

Maybe we should check for the binaries at the moment we know that the mbedToolchain instance is going to need the executable. I'm thinking in the compile_sources method, the build_library method, and the link_program method. Personally (for reuse purposes) I would make it a decorator, and simply add the decorator to all the mentoined methods.

@sarahmarshy
Copy link
Contributor Author

Moved to #2416

@bridadan
Copy link
Contributor

@theotherjimmy Really good point, let's continue the discussion on #2416

@sarahmarshy
Copy link
Contributor Author

@theotherjimmy one considetation: at the time of those functions, resource scan has already happened. It would just take some extra time to fail, but it is marginal.

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.

4 participants