CCS 未在用于 CI 构建的 Windows Docker 容器中检测已安装的编译器工具
大家好!
背景:我正在尝试使用 Windows Docker 容器为 CC2640处理器设置 CI 构建。 我需要使用 Windows、而不是 Linux、因为用于 CC2640的 BLE SDK 仅支持 Windows 开发(ugh)
到目前为止、我构建了 Docker 容器并与 CCS 和我们所需的各种 SDK 和库配合使用:
CCS (我已尝试11.2.0.00007和最新的12.4.0.00007)
CC2640 BLE SDK 2.01.00.444423
SimpleLink TIRTOS 2.13.00.06
编译器:TI CGT TMS470 16.9.3LTS (也试用了最新版本16.9.11 LTS)
所有这些工具的安装都是成功且有效的。
问题:
在 Docker 容器中编译代码时、CCS 无法找到 CGT TMS470编译器。
我将关注此文档以在 software-dl.ti.com/.../ccs_projects-command-line.html 命令行上使用 CCS。
可以找到其他 SDK 软件包、并可以通过此命令正确地包含这些软件包
eclipsec.exe -noSplash -data C:\\workspace1 -application com.ti.common.core.initialize -rtsc.productDiscoveryPath c:\ti\tirtos_simplelink_2_13_00_06
eclipsec.exe -noSplash -data C:\\workspace1 -application com.ti.common.core.initialize -rtsc.productDiscoveryPath c:\ti\xdctools_3_31_01_33_core
C:\ti\ccs1240\ccs\eclipse>eclipsec.exe -noSplash -data C:\\workspace1 -application com.ti.common.core.initialize -rtsc.productDiscoveryPath c:\ti\tirtos_simplelink_2_13_00_06 SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See www.slf4j.org/codes.html for further details. Searching for deleted extension-sites to uninstall: Finished! Searching for new extension-sites to install: Discovered new extension-site: c:\ti\tirtos_simplelink_2_13_00_06 Installing new extension-sites... done! Finished! C:\ti\ccs1240\ccs\eclipse>eclipsec.exe -noSplash -data C:\\workspace1 -application com.ti.common.core.initialize -rtsc.productDiscoveryPath c:\ti\xdctools_3_31_01_33_core SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See www.slf4j.org/codes.html for further details. Searching for deleted extension-sites to uninstall: Finished! Searching for new extension-sites to install: Discovered new extension-site: c:\ti\xdctools_3_31_01_33_core Installing new extension-sites... done! Finished! C:\ti\ccs1240\ccs\eclipse>
不过、CCS 编译器搜索失败
eclipsec -nosplash -data C:\\workspace1 -application com.ti.common.core.initialize -ccs.toolDiscoveryPath C:\ti\ccs1240\ccs\tools\compiler\ti-cgt-arm_16.9.11.LTS
这里是编译器目录、我从 CMD 而 不是 PowerShell 运行命令、因为 PowerShell 与 CCS 有问题。
PS C:\ti\ccs1240\ccs\eclipse> dir ..\tools\compiler\ Directory: C:\ti\ccs1240\ccs\tools\compiler Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 9/28/2023 3:59 PM ti-cgt-arm_16.9.11.LTS d----- 9/28/2023 3:58 PM ti-cgt-arm_16.9.3.LTS
C:\ti\ccs1240\ccs\eclipse>eclipsec -nosplash -data C:\\workspace1 -application com.ti.common.core.initialize -ccs.toolDiscoveryPath C:\ti\ccs1240\ccs\tools\compiler\ti-cgt-arm_16.9.11.LTS SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See www.slf4j.org/codes.html for further details. Searching for deleted extension-sites to uninstall: Finished! Searching for new extension-sites to install: Finished! C:\ti\ccs1240\ccs\eclipse>
当我运行时:
eclipsec.exe -verbose -noSplash -data C:\\workspace1 -application com.ti.ccstudio.apps.inspect -ccs.product
我没有看到编译器、但我看到安装了软件包。
C:\ti\ccs1240\ccs\eclipse>eclipsec.exe -verbose -noSplash -data C:\\workspace1 -application com.ti.ccstudio.apps.inspect -ccs.product SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder". SLF4J: Defaulting to no-operation (NOP) logger implementation SLF4J: See www.slf4j.org/codes.html for further details. Product location: C:/ti/ccs1240/ccs Compilers: Products: sysconfig [SysConfig]: 1.17.0 [C:/ti/ccs1240/ccs/utils/sysconfig_1.17.0] com.ti.rtsc.TIRTOSsimplelink [TI-RTOS for SimpleLink Wireless MCUs]: 2.13.0.06 [c:/ti/tirtos_simplelink_2_13_00_06] com.ti.rtsc.XDCtools [XDCtools]: 3.62.1.16_core [C:/ti/ccs1240/xdctools_3_62_01_16_core] 3.31.1.33_core [C:/ti/xdctools_3_31_01_33_core] C:\ti\ccs1240\ccs\eclipse>
现在、我四处搜索、在运行编译器搜索命令后、我看到这个文件
C:\ti\ccs1240\ccs\eclipse\configuration\com.ti.common.project.core>type compilerProperties.cache.log
Total tool discovery time: 203 ms Discovered a total of 2 tools: C:\ti\ccs1240\ccs\tools\compiler\ti-cgt-arm_16.9.11.LTS : 16.9.11.LTS C:\ti\ccs1240\ccs\tools\compiler\ti-cgt-arm_16.9.3.LTS : 16.9.3.LTS C:\ti\ccs1240\ccs\eclipse\configuration\com.ti.common.project.core>
缓存文件也会显示此情况、因此我看到 CCS 正在检测编译器并且只是没有安装它们。
C:\ti\ccs1240\ccs\eclipse\configuration\com.ti.common.project.core>type compilerProperties.cache
cacheFileNamet Ljava/lang/String;L indext ☼Ljava/util/Map;xpt ↑compilerProperties.cachesr ↨java.util.LinkedHashMap4�N\►l��☻ Z ♂accessOrderxr ◄java.util.HashMap���▬`� ☻F �� L pathq ~ xpt 7C:\ti\ccs1240\ccs\tools\compiler\ti-cgt-arm_16.9.11.LTSw☻ \xsr 9com.ti.common.project.core.tools.AToolType$ToolProperties ☻ L propertiesq ~ ☻L ◄toolTypeClassNameq ~ L versionq ~ xpsq ~ ?@ ♀ ► t toolFamilyt Armx t *com.ti.ccstudio.buildmodel.CodegenToolTypet ♂16.9.11.LTSsq ~t 6C:\ti\ccs1240\ccs\tools\compiler\ti-cgt-arm_16.9.3.LTSw☻ \xsq ~ ♂sq ~ ?@ ♀ ► q ~ ♫q ~ ☼x q ~ ►t 16.9.3.LTSx
有趣的是、当我在我一直在 CCS UI 中进行开发的本地计算机上运行时、它确实起作用、并且编译器已安装。 但此命令行编译器的功能在 Docker 系统中不起作用。
我用于设置系统的 Dockerfile 看起来如此
#Dockerfile # Full windows base image. FROM mcr.microsoft.com/windows:ltsc2019 # Metadata indicating an image maintainer. LABEL maintainer="xxx" SHELL ["cmd", "/S", "/C"] RUN "mkdir work" ADD CCS12.4.0.00007_win64.zip 'c:/work' ADD ble_cc26xx_setupwin32_2_01_00_44423.exe 'c:/work' ADD ble_sdk_install.bat 'c:/work' ADD tirtos_simplelink_setupwin32_2_13_00_06.exe 'c:/work' ADD ti_cgt_tms470_16.9.3.LTS_windows_installer.exe 'c:/work' ADD ti_cgt_tms470_16.9.11.LTS_windows_installer.exe 'c:/work' ADD python-3.11.5-amd64.exe 'c:/work' ADD fw.tar 'c:/work' RUN ["powershell.exe", "Expand-Archive -LiteralPath 'C:/work/CCS12.4.0.00007_win64.zip' -DestinationPath 'c:/work'"] RUN ["powershell.exe", "Start-Process -FilePath 'ccs_setup_12.4.0.00007.exe' -ArgumentList '--mode unattended --disable-components PF_MSP430,PF_MSP432' -WorkingDirectory 'work/CCS12.4.0.00007_win64' -Wait"] WORKDIR /work RUN tirtos_simplelink_setupwin32_2_13_00_06.exe --mode unattended RUN ti_cgt_tms470_16.9.3.LTS_windows_installer.exe --mode unattended --prefix C:\ti\ccs1240\ccs\tools\compiler RUN ti_cgt_tms470_16.9.11.LTS_windows_installer.exe --mode unattended --prefix C:\ti\ccs1240\ccs\tools\compiler RUN python-3.11.5-amd64.exe /quiet RUN ble_sdk_install.bat CMD ["powershell.exe", "-NoLogo", "-ExecutionPolicy", "Bypass"]