Conversation
|
@eval-exec Do you want this change to be included in the release version? cc @chenyukang |
| println!("cargo:rustc-cfg=has_asm") | ||
| "riscv64" => { | ||
| cc::Build::new() | ||
| .compiler(clang_finder::find()) |
There was a problem hiding this comment.
Not sure do we really need to hardcode clang and ignore CC env var here?
cc-rs allow cargo usage like: CC=clang cargo build .....
There was a problem hiding this comment.
Good idea, perhaps we don't need to specify compiler.
There was a problem hiding this comment.
However, if we do this, we will always need to set the CC environment variable when compiling on Windows, see https://github.com/nervosnetwork/ckb-vm/actions/runs/24328961143/job/71030179557?pr=512
There was a problem hiding this comment.
Or should we do it the old way: not specifying a compiler on Unix, but specifying a compiler on Windows?
There was a problem hiding this comment.
How about create .cargo/Cargo.toml, config CC=clang in [env]?
https://doc.rust-lang.org/cargo/reference/config.html#env
Or should we do it the old way: not specifying a compiler on Unix, but specifying a compiler on Windows?
Both are fine.
There was a problem hiding this comment.
Not a good idea. On Windows, clang is simply called clang, but on Unix, clang is usually named clang-19, clang-20, clang-21, and so on. This is why I initially introduced the clang-finder package.
There was a problem hiding this comment.
cc-rs support: <var>_<target> - for example:
- CC_x86_64_pc_windows_msvc
- CC_x86_64_unknown_linux_gnu
There was a problem hiding this comment.
Does ckb-vm have min/max version requirements for clang?
There was a problem hiding this comment.
There are no restrictions on clang versions.
Ref #511