Hi - Comments in line.
On Sun, Mar 15, 2026 at 12:06 PM Shiva K <[email protected]> wrote: > Hi Rocky, > > I'm Shiva and I'm interested in porting libcdio's components to Rust. > As per your suggestion in another thread, I've been looking at the > iso9660 library for a start. > I have a few questions on the same: > > 1. How do we go about the build system? > As libcdio uses Makefiles, shall we use them with rustc directly, > or with Cargo? > Cargo seems to make sense here. > > 2. Can we change the layout of arbitrarily sized structs? > As you've rightly mentioned in another thread, > > DSTs in Rust are a half baked feature for now. > https://doc.rust-lang.org/nomicon/exotic-sizes.html > It's not a blocker though, we'd have to be careful > and use a bit of unsafe. > However, there is a crate that helps with them. > https://crates.io/crates/slice-dst > > From my observation, looks like `struct iso9660_stat_s` is the > only struct that is arbitrarily sized in the iso9660 library. > Alternatively, could we avoid the problem entirely by > changing the layout of this struct to hold a pointer and a length > for the `filename` field? > That would be fine. The important part, though, is that when written to disk or memory that purports to be an IS9660 file, it is in the format defined by ISO9660 :-) > ``` > struct iso9660_stat_s { > // ... > // char filename[EMPTY_ARRAY_SIZE]; // instead of this > size_t filename_length; > char *filename; // equivalent to this in Rust > } > ``` > I understand that we'd have to modify existing code that > expects the layout to be this way. > Is this feasible, or am I missing anything, > such as an ABI compatibility requirement? > To start out with, assume there is no ABI compatibility requirement. It may turn out eventually that there is a desire to have this interact with C programs (that haven't been converted to Rust yet). But for simplicity, I'd think of that as a separate data structure conversion problem, which I think can be independent of the main idea here. Have one less program written in C using more modern technology and type saftey. > > Thanks. > Shiva > > Good luck!
