Skip to content

Check toolchain license prior to initial CMake invocation #581

@jkrech

Description

@jkrech

Describe The Problem To Be Solved
Duplicated from here: ARM-software/vscode-cmsis-csolution#478

If cmake invokes a UBL license protected compiler toolchain and the license check fails or runs in a time-out the user experience is bad, as it is not immediately obvious what went wrong.

There a number of scenarios for a failed license:
a) license activation failed or ignored by user
b) the license cache expired and the license server is not reachable (e.g. outside of the company network)

-- Check for working C compiler: /home/codespace/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/armclang
-- Check for working C compiler: /home/codespace/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/armclang - broken
-- Configuring incomplete, errors occurred!

-- stderr output is:
CMake Error at /home/codespace/.vcpkg/artifacts/2139c4c6/tools.kitware.cmake/3.31.5/share/cmake-3.31/Modules/CMakeTestCCompiler.cmake:67 (message):
  The C compiler

    "/home/codespace/.vcpkg/artifacts/2139c4c6/compilers.arm.armclang/6.24.0/bin/armclang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: '/workspaces/vscode-get-started/tmp/1/CMakeFiles/CMakeScratch/TryCompile-RQkBpB'

(Optional): Suggest A Solution
In cbuild we could check whether armclang is "operational" before kicking off cmake.

Step one: check the active toolchain of the active target-set.

In case of AC6 already a version check failing in case of problems with the license

armclang --version
armclang: error: Failed to check out a license.

If it fails we print an error instead of starting cmake. In VS Code the build button and related commands could be disabled.

We could also implement that in cbuild
A concise description of your preferred solution. Things to address include:

  • Details of the technical implementation
  • Tradeoffs made in design decisions
  • Caveats and considerations for the future

If there are multiple solutions, please present each one separately. Save comparisons for the very end.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions