目前共有4篇帖子。
字體大小:較小 - 100% (默認)  內容轉換:不轉換
 
點擊 回復
128 3
sessionRelationalIT.cpp: Unable to find clang-format on path
巨大八爪鱼
武林盟主 二十一級
回復
1樓 發表於:2026-6-3 18:17
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  34.129 s
[INFO] Finished at: 2026-06-03T17:30:35+08:00
[INFO] ------------------------------------------------------------------------
[INFO] 66 goals, 60 executed, 6 from cache, saving at least 1s
[INFO] Build cache (/home/oct1158/.m2/.develocity/build-cache/v1) removing files not accessed on or after Wed May 27 17:30:35 CST 2026.
[INFO] Build cache (/home/oct1158/.m2/.develocity/build-cache/v1) cleanup deleted 0 files/directories.
[INFO] Build cache (/home/oct1158/.m2/.develocity/build-cache/v1) cleaned up in 0.023 secs.
[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.44.5:check (spotless-check) on project client-cpp: Unable to check file /home/oct1158/Documents/Code/C/iotdb/iotdb-cpp/iotdb-client/client-cpp/src/test/cpp/sessionRelationalIT.cpp: Unable to find clang-format on path
[ERROR] You can download clang-format from https://releases.llvm.org and then point Spotless to it with {@code pathToExe('/path/to/clang-format')} or you can use your platform's package manager:
[ERROR]   win:   choco install llvm --version 17.0.6  (try dropping version if it fails)
[ERROR]   mac:   brew install clang-format (TODO: how to specify version?)
[ERROR]   linux: apt install clang-format  (try clang-format-17.0.6 with dropped minor versions)
[ERROR]     github issue to handle this better: https://github.com/diffplug/spotless/issues/673
[ERROR] > arguments: [sh, -c, which clang-format]
[ERROR] > exit code: 1
[ERROR] >    stdout: (empty)
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :client-cpp
巨大八爪鱼
武林盟主 二十一級
回復
2樓 發表於:2026-6-3 18:18
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  17.698 s
[INFO] Finished at: 2026-06-03T17:32:23+08:00
[INFO] ------------------------------------------------------------------------
[INFO] 66 goals, 59 executed, 7 from cache, saving at least 6s
[ERROR] Failed to execute goal com.diffplug.spotless:spotless-maven-plugin:2.44.5:check (spotless-check) on project client-cpp: Unable to check file /home/oct1158/Documents/Code/C/iotdb/iotdb-cpp/iotdb-client/client-cpp/src/test/cpp/sessionRelationalIT.cpp: You specified version 17.0.6, but Spotless found 14.0.0-1ubuntu1.1
[ERROR] You can tell Spotless to use the version you already have with {@code clangFormat('14.0.0-1ubuntu1.1')}or you can download the currently specified version, 17.0.6.
[ERROR] You can download clang-format from https://releases.llvm.org and then point Spotless to it with {@code pathToExe('/path/to/clang-format')} or you can use your platform's package manager:
[ERROR]   win:   choco install llvm --version 17.0.6  (try dropping version if it fails)
[ERROR]   mac:   brew install clang-format (TODO: how to specify version?)
[ERROR]   linux: apt install clang-format  (try clang-format-17.0.6 with dropped minor versions)
[ERROR]     github issue to handle this better: https://github.com/diffplug/spotless/issues/673
[ERROR] > arguments: [/usr/bin/clang-format, --version]
[ERROR] > exit code: 0
[ERROR] >    stdout: Ubuntu clang-format version 14.0.0-1ubuntu1.1
[ERROR] -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
[ERROR]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn <args> -rf :client-cpp
巨大八爪鱼
武林盟主 二十一級
回復
3樓 發表於:2026-6-3 20:09

解决办法:安装clang-format-17。

wget https://apt.llvm.org/llvm.sh

chmod +x llvm.sh
sudo ./llvm.sh 17
sudo apt install clang-format-17
巨大八爪鱼
武林盟主 二十一級
回復
4樓 發表於:2026-6-4 10:09

vi ~/.bashrc

在最后一行添加export PATH=$PATH:/usr/lib/llvm-17/bin

然后关闭终端重新打开,就可以使用clang和clang-format命令了,问题就解决了。


Welcome to Ubuntu 22.04.5 LTS (GNU/Linux 6.8.0-111-generic x86_64)

 * Documentation:  https://help.ubuntu.com
 * Management:     https://landscape.canonical.com
 * Support:        https://ubuntu.com/pro

Expanded Security Maintenance for Applications is not enabled.

101 updates can be applied immediately.
To see these additional updates run: apt list --upgradable

12 additional security updates can be applied with ESM Apps.
Learn more about enabling ESM Apps service at https://ubuntu.com/esm

Failed to connect to https://changelogs.ubuntu.com/meta-release-lts. Check your Internet connection or proxy settings

*** System restart required ***
Last login: Thu Jun  4 09:32:29 2026 from 192.168.71.128
oct1158@oct1158-ubuntu:~$ clang -v
Ubuntu clang version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm-17/bin
Found candidate GCC installation: /usr/lib/gcc/x86_64-linux-gnu/11
Selected GCC installation: /usr/lib/gcc/x86_64-linux-gnu/11
Candidate multilib: .;@m64
Candidate multilib: 32;@m32
Candidate multilib: x32;@mx32
Selected multilib: .;@m64
oct1158@oct1158-ubuntu:~$ clang-format -version
Ubuntu clang-format version 17.0.6 (++20231209124227+6009708b4367-1~exp1~20231209124336.77)
oct1158@oct1158-ubuntu:~$

回覆帖子
內容:
用戶名: 您目前是匿名發表。
驗證碼:
看不清?換一張
(快捷鍵:Ctrl+Enter)
本帖信息
點擊數:128 回複數:3
作者:巨大八爪鱼
最後回覆:巨大八爪鱼
最後回復時間:2026-6-4 10:09
公告板