On Mon, Jan 15, 2024 at 10:55:09AM -0700, Thomas Bertschinger wrote:
> On Mon, Jan 15, 2024 at 12:32:23PM -0500, Kent Overstreet wrote:
> > I think there's some more rearraging we could do - it'd be cleaner if we
> > moved the C sources out of the top level directory, perhaps to c_src,
> > and then moved everything in rust-src/ to the toplevel.
> > 
> > Top level directory is getting a bit crowded, and then the new bcachefs
> > binary won't be quite so out of the way; I frequently build and run
> > without installing when I'm debugging.
> 
> I agree this makes sense. I'll work on a v2 that does this.
> 
> Thoughts on keeping Make as the top-level build tool vs. using Cargo? I
> am still fairly new to Rust/Cargo so I'm not sure how easy it would be
> to replicate all of the Makefile targets in Cargo. It does appear to be
> possible to use Cargo to invoke gcc to build the C library.
#
> I can see three approaches:
> - keep Make as the primary build tool
> - hybrid: use Cargo for source code building but keep the Makefile around
>   for the supplemental targets like "make doc", "make rpm", etc.
> - use Cargo for everything (not sure if this is easy / possible, but I
>   could look into it if desired)
> 
> I'm leaning towards keeping Make as the primary build tool for now and
> perhaps a future patch can move towards using Cargo. But other opinions
> are welcome.

Let's hold off on that for now.

I'm planning on pullling the Rust code in bch_bindgen into the kernel
soon, and I want to see how that interacts with the kernel build system.
If there's potential for commonality with the kernel build system, we
might want to take advantage of that.

(Also, if you're interested in that project, let me know! Getting that
ready for the next merge window is a high priority item, but I have a
lot of high priority items at the moment... :)

Reply via email to