On 11/04/2013 02:39 PM, Martin DeMello wrote:
How does this work without getting into a dependency loop at build time?

The std under test is not *actually* the standard library as seen by compiler and runtime; as far as the compiler is concerned it is just some library compiled with --test, that links to libextra and libstd (so when testing std there are two different copies of it in memory.. This has some complications since the standard library has some functionality (lang-items) that must not be redefined, so std has a few strategic 'cfg' attributes thrown in to avoid that.

For the most part this set up works just fine, but occasionally can result in some very hard to understand errors, especially if you run tests of the runtime without first recompiling the standard library (resulting in unsafe interoperation of incompatible type definitions).


martin

On Mon, Nov 4, 2013 at 10:55 AM, Brian Anderson <[email protected]> wrote:
On 11/03/2013 11:10 PM, Martin DeMello wrote:
I've been looking at https://github.com/mozilla/rust/issues/6085 which
seems like it should be fairly simple to fix, however, the proposed
solution involves EnumSet from libextra.

Is it possible to use stuff from libextra within libstd? It seems to
me that it would set up a circular dependency, though that could just
be my misunderstanding the rust compilation model. If it is possible,
how would I do it? If not, what would be the proper fix for issue
#6085?

As others mentioned it's not generally possible, but just for curiosity's
sake I'll point out that when running tests std *does* link to and use
features from libextra. It's mind-bending and bad.

When we decide that std absolutely can't live without features from extra,
then those features get promoted to std. The bar is pretty high though.

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to