-
Notifications
You must be signed in to change notification settings - Fork 3k
Allow the use of Mbed Studio's version of ARMC6 #10114
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
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
9ac08e6
Whitespace clean up
bridadan bc06c53
Conditionally enable --ide=mbed from ARMC6 based on compiler version.
bridadan b135709
Remove stray prints and whitespace
bridadan c4a9fb3
Test detection of Mbed Studio version of ARMC6
bridadan 9824c3c
Clean up some whitespace
bridadan 6e629de
Version check the compiler in all build functions
bridadan e382b50
Add comments about the proper use of specific ARMC6 arguments
bridadan File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,7 +13,7 @@ | |
distributed under the License is distributed on an "AS IS" BASIS, | ||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
See the License for the specific language governing permissions and | ||
limitations | ||
limitations | ||
""" | ||
|
||
import sys | ||
|
@@ -84,16 +84,41 @@ def test_armc5_version_check(_run_cmd): | |
def test_armc6_version_check(_run_cmd): | ||
set_targets_json_location() | ||
notifier = MockNotifier() | ||
print(TARGET_MAP["K64F"]) | ||
toolchain = TOOLCHAIN_CLASSES["ARMC6"](TARGET_MAP["K64F"], notify=notifier) | ||
print(toolchain) | ||
_run_cmd.return_value = (""" | ||
Product: ARM Compiler 6.11 Professional | ||
Component: ARM Compiler 6.11 | ||
Tool: armclang [5d3b4200] | ||
""", "", 0) | ||
|
||
toolchain.version_check() | ||
assert notifier.messages == [] | ||
assert notifier.messages == [] | ||
assert not toolchain.is_mbed_studio_armc6 | ||
|
||
_run_cmd.return_value = (""" | ||
armclang: error: Failed to check out a license. | ||
The provided license does not enable these tools. | ||
Information about this error is available at: http://ds.arm.com/support/lic56/m5 | ||
General licensing information is available at: http://ds.arm.com/support/licensing/ | ||
If you need further help, provide this complete error report to your supplier or [email protected]. | ||
- ARMLMD_LICENSE_FILE: unset | ||
- LM_LICENSE_FILE: unset | ||
- ARM_TOOL_VARIANT: unset | ||
- ARM_PRODUCT_PATH: unset | ||
- Product location: C:\MbedStudio\tools\ac6\sw\mappings | ||
- Toolchain location: C:\MbedStudio\tools\ac6\bin | ||
- Selected tool variant: product | ||
- Checkout feature: mbed_armcompiler | ||
- Feature version: 5.0201810 | ||
- Flex error code: -5 | ||
Product: ARM Compiler 6.11 for Mbed Studio | ||
Component: ARM Compiler 6.11 | ||
Tool: armclang [5d3b3c00] | ||
""", "", 0) | ||
|
||
toolchain.version_check() | ||
assert notifier.messages == [] | ||
assert toolchain.is_mbed_studio_armc6 | ||
|
||
@patch('tools.toolchains.iar.run_cmd') | ||
def test_iar_version_check(_run_cmd): | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not convinced that mbed os tools should have special logic based on a single product. Not sure if there is a better way of fixing it but it should be worth double checking before merging it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It also limit options to make any changes in product name if needed. As old mbed os versions will be already released.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Considering the compiler has special behavior in this single product, I don't know if we have much of a choice 😄. The license shipped with Mbed Studio must be supplied to the compiler shipped with Mbed Studio in order to build anything. However if you have any alternatives/suggestions do let me know.
This is the only way I know of to identify this build of the compiler. As you can see, the output of
armclang --vsn
is quite similar between the different builds:ARMC6 Professional:
ARMC6 from Mbed Studio:
And we shouldn't be switching this behavoir based on the commit since that will change with new releases of the compiler.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with @arekzaluski, managing specific cases like this is problematic and prone to breaking. For example, we plan to move the installation directory of the tools in the next release of Mbed Studio.
At a higher level, requiring Mbed Studio to be installed for this functionality to work makes little sense IMO.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@thegecko I understand your concern, it definitely reduces the flexibility of how Mbed Studio is internally organized.
This isn't immediately a problem for this implementation, as it only requires the
ac6-license.dat
file to be placed in any parent directory of the compiler binary.Mbed Studio is only required to be installed if you wish to take advantage of the development license and corresponding compiler provided by Mbed Studio. You can of course still use the professional versions of the Arm Compiler 6 and license.
Another option is that I completely remove all of the "license detection" features at the expense of user experience. This would mean the user would now be responsible for the following:
ac6-license.dat
file in the Mbed Studio installationARMLMD_LICENSE_FILE
environment variable to their shell and set it to the path to theac6-license.dat
file.We can of course document all of this, but that also means we need to keep this documentation up to date whenever the structure of Mbed Studio changes.
If the license detection feature is something that we need to ship though, I really need an alternative suggestion from your team. I'll happily parse a file to get the exact location. Maybe you could place a dedicated file next to the armc6 binaries? That file could point to the correct location of the license.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking about it and I think that the best way would be to remove license detection feature from mbed-os tools. Instead, it should be
applications
(Mbed Studio, mbed-cli, possible other in the future) that controls specific compilation behavior. Only they know location of all of the files.At the moment Mbed Studio handles cases when
ARMLMD_LICENSE_FILE
env variable is set or/and AC6 compiler is installed on user's system. It simply overrides it and set its own path for both license and compiler location. It overrides it only for a single build process so user's environment variables are not changed.I believe that the best way forward is to add similar logic in mbed-cli. For example installers of mbed-cli can be shipped with ARMC6 and valid license. Installer knows installation location so it can ask user at the end of installation if env variables should be updated or not.
Of course it should be also well documented for users that do not use installers to install mbed-cli.
@bridadan What do you think about it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the least contentious way forward, so I'll go with that. Moving this functionality to the installers doesn't sound like a bad idea either 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@bridadan Checking since this PR has passed CI checks.
I'm assuming the above will be planned for 5.13, and not squeezed into 5.12.0, correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Based on the feedback from the Mbed Studio folks it sounds like they are not comfortable with this PR going in as-is for 5.12, so I think I have to make the tool changes now. The installers will not be ready though for sometime.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For what its worth I have the changes almost ready. I don't have access to a mac to test though.