amarmaduke / chez-rs

Rust bindings for embedding the Chez Scheme interpreter and compiler in Rust applications
Apache License 2.0
1 stars 2 forks source link

How to access SCHEME_BOOT_PATH env variable? #1

Open 1player opened 2 years ago

1player commented 2 years ago

First of all, thanks for this package.

I'd like to access the SCHEME_BOOT_PATH environment variable in my application with env!, but cargo complains that environment variable isn't defined. I'm pretty new to build variables, but I seem to understand they would be available to this crate only (https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-envvarvalue), so chez-sys would have to export some helper constants/methods to expose SCHEME_BOOT_PATH and PETITE_BOOT_PATH to any crate that depends on it.

Isn't this the case? Could you please provide a simple example of how to access that variable?

ruffianeo commented 8 months ago

The documentation seems out of lock step with the way the crate currently works.

chez_sys::PETITE_BOOT_FILE_BYTES chez_sys::SCHEME_BOOT_FILE_BYTES

petite_boot_file_bytes.len() = 1814553 scheme_boot_file_bytes.len() = 947884

hint, that the contents is statically linked to the crate.

But of course, this raises the question, how to use it, since there is no chez_sys::Sregister_boot_file(arg1) equivalent which allows using those byte arrays instead.

Probably easiest fix is to update documentation.