On Mon, Feb 27, 2017, at 02:33 AM, Henri Sivonen wrote: > On Thu, Feb 23, 2017 at 4:37 PM, Ted Mielczarek <t...@mielczarek.org> > wrote: > > On Thu, Feb 23, 2017, at 06:40 AM, Emilio Cobos Álvarez wrote: > >> On Thu, Feb 23, 2017 at 08:25:30AM +0200, Henri Sivonen wrote: > >> > On Wed, Feb 22, 2017 at 5:49 PM, Ted Mielczarek <t...@mielczarek.org> > >> > wrote: > >> > > Given that > >> > > the C API here is under your complete control, it seems like it's > >> > > possible to generate a cross-platform header > >> > > >> > I believe the header is cross-platform, yes. > >> > > >> > > Alternately you could just generate it at build time, and we could pass > >> > > the path to $(DIST)/include in a special environment variable so you > >> > > could put the header in the right place. > >> > > >> > So just https://doc.rust-lang.org/std/env/fn.var.html in build.rs? Any > >> > naming conventions for the special variable? (I'm inferring from the > >> > way you said it that DIST itself isn't being passed to the build.rs > >> > process. Right?) > >> > >> FWIW, in Stylo we use MOZ_DIST[1], which is passed to the build script, > >> not sure if it's stylo only though. > >> > >> [1]: > >> https://searchfox.org/mozilla-central/rev/b1044cf7c2000c3e75e8181e893236a940c8b6d2/servo/components/style/build_gecko.rs#48 > > > > So if you're only concerned about it working in Gecko--there you go! > > Thanks. I'm interested both in the Gecko case and the general case. > > When doing a parallel build, I see an interleave of C++ and Rust build > system output. What guarantees that a build.rs that exports headers > runs before the C++ compiler wants to see the headers?
Oh, it's about C++ header generated from Rust? I don't think it is possible given the current architecture. How build-time bindgen currently works is that, the Rust build script generates binding files from exported C++ headers, and there is a test to ensure their signatures are identical in the Rust side. So if it is Rust library exposing C API, it is probably responsibility of the Rust library to also provide a C header for other code to use. - Xidorn _______________________________________________ dev-platform mailing list dev-platform@lists.mozilla.org https://lists.mozilla.org/listinfo/dev-platform