On 21.12.2017 06:20, Fabrice Desre wrote:
Hi,
I feature-gated the bluetooth support in >
https://github.com/fabricedesre/servo/commit/2afbaf365f6379eedf26e36a33e7cb38aba5c00a#diff-8c43e49d8f1af13938ed86125b97244c
> > There are more changes that really needed because of rustfmt that
ran > when I saved files :( but look for the web-bluetooth feature.
Maybe we should run rustfmt once on the whole tree and then put it
into pre-commit-hook, to get consistent formatting automatically ?
In components/servo/lib.rs, you didn't disable
bluetooth_traits::BluetoothRequest.
What about the references in the Navigator JSON object ?
I'd like to make several features optional, which I'll never need >> and don't want on my systems (eg. bluetooth, webvr, ...).>>>> I've
already started w/ adding conditional compiles, but that doesn't>> catch
everything (and i don't like to patches w/ hard removals):>>>> * IDL
code generator currently processes all *.webidl files,>> no explicit
lists that can be created on build options>> * webidl doesn't have any
preprocessor/conditional compile yet> > I don't know how much of that
codegen is driven by cargo vs. mach. I > think cargo should let us do
that properly.
I'm pretty fresh w/ rust+cargo ... can you give me some hint how to
pass the chosen features down to the generator python script ?
* cargo seems to compile all *.rs files - no explicit lists, that
can be made depending on features.
using #[cfg(..)] let you do that in general by selecting the modules you
need.
Does it only compile those modules that are actually imported ?
In components/script/dom/mod.rs I see several vr* modules imported, but
not actually used. Is that for getting them compiled ?
Do they register themselves automatically ? Is that what #[dom_struct]
does ? Can we move these imports to a separate module, so we'd need
only #[cfg(...)] for that ?
* some code pieces (eg. function call parameters) cant be compiled
conditionally yet
Not sure what you mean here. Can you elaborate? For sure sometimes there
will be some refactoring needed (my patch should turn the
IpcSender<BluetoothRequest> into Option<IpcSender<BluetoothRequest>> for
instance) but that doesn't seem like a huge issue.
Yeah, the new() function takes a reference to BluetoothRequest,
therefore this needs to be defined in the first place - which I had
cut out. Note, I removed the bluetooth rs files, to make sure they
won't be compiled anywhere.
Unlike me, you didn't drop the dependencies to 'bluetooth' and
'bluetooth_traits' dependencies - wouldn't that mean they're still
compiled ? Or is rustc clever enough to skip them entirely ?
BTW: I'd also like to make the script crate smaller, as it doesn't
compile on my 32bit environment (takes >4G process size).
--mtx
_______________________________________________
dev-servo mailing list
dev-servo@lists.mozilla.org
https://lists.mozilla.org/listinfo/dev-servo