While the build system could be improved to actually support those
cases, because of all the legacy things involved, it would be a lot more
work for a low reward.
Instead, we forbid them, which allows to remove the non-unified builds
exception in xpcom/rust/gtest.
Differential Revision: https://phabricator.services.mozilla.com/D127035
Automatically generated path that adds flag `REQUIRES_UNIFIED_BUILD = True` to `moz.build`
when the module governed by the build config file is not buildable outside on the unified environment.
This needs to be done in order to have a hybrid build system that adds the possibility of combing
unified build components with ones that are built outside of the unified eco system.
Differential Revision: https://phabricator.services.mozilla.com/D122345
In the Itanium C++ ABI VTables contain extra fields before the virtual function
pointer list for RTTI information, and these fields are not eliminated even
when RTTI is disabled using -fno-rtti. The two relevant fields for rust-xpcom's
vtables are the "offset to top" field, which contains the displacement to the
top of the object from the corresponding vtable pointer as a `ptrdiff_t`
(`isize`), and the "typeinfo pointer" field which points to the typeinfo object
and is null when building with -fno-rtti. The VTable pointer points after these
fields to the beginning of the virtual function pointer list.
While these extra fields would generally not be accessed in -fno-rtti
situations, gcc and clang still support `dynamic_cast<void*>` even when
-fno-rtti is passed, meaning that the "offset to top" field should be present.
Although I was unable to find documentation for the C++ ABI used on Darwin, it
appears to behave the same as the Itanium C++ ABI when it comes to VTable
layout.
In order to include these fields in the manual vtables built by the rust-xpcom
macros, a `&'static VTableExtra<VTableType>` is used instead of directly using
the vtable type, and the vtable reference stored in the struct is offset into
the allocation.
As the only platform I know of to not include these extra fields is Windows,
they are generated on all non-Windows platforms.
Differential Revision: https://phabricator.services.mozilla.com/D115085
This also introduces a thread_sanitizer feature to gkrust for any other
crates that need similar special handling. (`cfg(sanitizer="thread")` is
unfortunately an unstable feature, so it isn't useful here.)
Differential Revision: https://phabricator.services.mozilla.com/D95950
This also introduces a thread_sanitizer feature to gkrust for any other
crates that need similar special handling. (`cfg(sanitizer="thread")` is
unfortunately an unstable feature, so it isn't useful here.)
Differential Revision: https://phabricator.services.mozilla.com/D95950
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Make some ad-hoc manual updates to `testing/marionette/client/setup.py`, `testing/marionette/harness/setup.py`, and `testing/firefox-ui/harness/setup.py`, which have hard-coded regexes that break after the reformat.
5. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
Allow-list all Python code in tree for use with the black linter, and re-format all code in-tree accordingly.
To produce this patch I did all of the following:
1. Make changes to tools/lint/black.yml to remove include: stanza and update list of source extensions.
2. Run ./mach lint --linter black --fix
3. Make some ad-hoc manual updates to python/mozbuild/mozbuild/test/configure/test_configure.py -- it has some hard-coded line numbers that the reformat breaks.
4. Add a set of exclusions to black.yml. These will be deleted in a follow-up bug (1672023).
# ignore-this-changeset
Differential Revision: https://phabricator.services.mozilla.com/D94045
Allow Rust Futures to be polled to completion on the current thread's
`nsIEventTarget`.
Futures don't need to be `Send` since they are polled on the thread spawning the
task responsible to completing the Future.
Differential Revision: https://phabricator.services.mozilla.com/D89694
When I originally wrote rust-xpcom support, it wasn't possible to implement
generic vtables in Rust. With updates and improvements to the language since
then, it is now possible to do, so this patch adds support for implementing
xpcom interfaces on generic structs.
All generic parameters to these structs are required to have a `'static`
lifetime bound, as it is not possible to safely represent xpcom interface
objects which contain internal non-'static references.
Differential Revision: https://phabricator.services.mozilla.com/D89950
Previously, this code used a &'static T in order to get the null pointer
optimization. Since the code was written, `NonNull` has been stabilized, and now
should be used instead.
Differential Revision: https://phabricator.services.mozilla.com/D89947