mozilla / cbindgen

A project for generating C bindings from Rust code
Mozilla Public License 2.0
2.29k stars 294 forks source link

How can i offline install #918

Closed frkn4129 closed 5 months ago

frkn4129 commented 6 months ago

How can I install cbindgen on a machine without internet access?

jschwe commented 5 months ago

There is not really any difference to any other normal Rust project. You could use cargo vendor, and copy the sources to the offline machine and compile there. Alternatively, you could also (cross-) compile cbindgen for your target machine and copy the binary. Compiling for a different machine can be difficult, since your local machine might e.g. have a newer glibc than the target machine, which could lead to issues when executing the binary on the target machine. If your target system runs Linux, then compiling for -musl usually avoids such problems.