Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid using `include!()` for platform modules #132

Merged
merged 5 commits into from Jan 16, 2017

Conversation

@antrik
Copy link
Contributor

antrik commented Jan 16, 2017

Using include!() apparently breaks debug info, according to
#108 (comment) -- so
avoid it by going back to per-backend modules.

(Extracted from #108 , since
it's unrelated to the actual purpose of that PR.)

This PR also contains a couple of more or less related cleanups.

vvuk and others added 5 commits Sep 9, 2016
Using `include!()` apparently breaks debug info, according to
#108 (comment) -- so
avoid it by going back to per-backend modules.

(Extracted from #108 , since
it's unrelated to the actual purpose of that PR.)
It could be argued that the explicit exports of each individual symbol
are actually useful here, since in a way they define the common API that
the various back-ends need to expose. I don't actually have a clear
preference either way; but since this is really orthogonal to the
purpose of the original import change, I'd rather keep the original
behaviour. (It can be changed in a separate PR if desired.)

Using an extra layer of indirection, we can preserve/restore the
individual imports, but without the duplication needed in the initial
version of #108
Instead of having the same conditions in two different places for `mod`
and `use` statements, put the two items for every distinct condition
next to each other.

This should make it a bit easier to follow.
Rather than defining this helper class directly in the `platform` branch
module, wrap it in a separate leaf module. (But keep it in the same file
for simplicity.)

This seems more elegant; and it avoids redundant conditionals.
This helper class is trivial and has no dependencies -- so I don't see
much benefit from excluding it from the build on platforms that don't
need it. Removing the conditional should reduce maintenance burden.
@emilio
Copy link
Member

emilio commented Jan 16, 2017

@bors-servo
Copy link
Contributor

bors-servo commented Jan 16, 2017

📌 Commit 09e22f6 has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Jan 16, 2017

Testing commit 09e22f6 with merge 8cc5a53...

bors-servo added a commit that referenced this pull request Jan 16, 2017
Avoid using `include!()` for platform modules

Using `include!()` apparently breaks debug info, according to
#108 (comment) -- so
avoid it by going back to per-backend modules.

(Extracted from #108 , since
it's unrelated to the actual purpose of that PR.)

This PR also contains a couple of more or less related cleanups.
@bors-servo
Copy link
Contributor

bors-servo commented Jan 16, 2017

💔 Test failed - status-travis

@jdm
Copy link
Member

jdm commented Jan 16, 2017

@bors-servo: retry

@bors-servo
Copy link
Contributor

bors-servo commented Jan 16, 2017

Testing commit 09e22f6 with merge 0c881ec...

bors-servo added a commit that referenced this pull request Jan 16, 2017
Avoid using `include!()` for platform modules

Using `include!()` apparently breaks debug info, according to
#108 (comment) -- so
avoid it by going back to per-backend modules.

(Extracted from #108 , since
it's unrelated to the actual purpose of that PR.)

This PR also contains a couple of more or less related cleanups.
@bors-servo
Copy link
Contributor

bors-servo commented Jan 16, 2017

☀️ Test successful - status-appveyor, status-travis

@bors-servo bors-servo merged commit 09e22f6 into servo:master Jan 16, 2017
3 checks passed
3 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.