On 6/25/24 11:08, Manos Pitsidianakis wrote:
On Tue, 25 Jun 2024 19:00, Zhao Liu <zhao1....@intel.com> wrote:
[snip]
This is for future-proofing the Rust integration in general. I
haven't been
able to compile under macos yet because bindgen cannot find the system clang
header. I also don't have a windows pc to test it on. But it should work
theoretically under all three.

Yes, they should work. EMM, but there is no particular need for them at
the moment, so just to be safe, we can put these two platforms on hold
for now, and they can be easily added when the tests are covered.

A TODO can remind support for them.

I'm still trying to figure out why bindgen doesn't find the /Library/***
include paths.. it's frustrating! I will remove them if I don't succeed
and also no one volunteers to attempt a windows build. :)


I'm currently doing it, and managed to run until bindgen step. Same problem that you found on MacOS, it can't locate some headers (strings.h, included from osdep.h). I'll try to dig into this, but if you found a solution already, you're welcome to share it.

'gcc | grep' command you used should work, but should be adapted because windows paths start with C:/ instead of /.

[snip]

Could we decouple 'optimization' with cargo's opt-level (maybe in the future)?

Or we could add new option to specify custom rust opt-level, which will
set the environment varialbe CARGO_PROFILE_<profile_name>_OPT_LEVEL and
override the default opt-level in Cargo.toml.

optimization here refers to LLVM's opt flags directly, so I think it makes
sense to follow the project-wide compiler settings?

Oh, yes. But I think the choice of debug or release is best based on the
debug info. What about this?

if get_option('debug')
    rs_build_type = 'debug'
else
    rs_build_type = 'release'
endif

get_option('debug') would apply -g flag, and that flag is mapped to debuginfo=2,
which is the default debuginfo level for debug version.

But wait, I just noticed rs_build_type should be 'dev' not 'debug'. You
can build with optimizations and keep debuginfo if you override the
'release' profile or use a different profile altogether.

I will correct the optimization and debuginfo mappings in the next
version.

It's a totally new file, and it is used to derive other files. These
are
all significant changes. At least for 2024, I think you can declare
copyright here. :-)

Heh yes :)


Thanks,
Zhao


Reply via email to