Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upcreate a config facade #15919
create a config facade #15919
Conversation
highfive
commented
Mar 12, 2017
|
Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @cbrewster (or someone else) soon. |
highfive
commented
Mar 12, 2017
|
Heads up! This PR modifies the following files:
|
highfive
commented
Mar 12, 2017
|
If someone can help that will be great |
|
It looks like the problem is the use statement as I mentioned in the comment below. |
| /* Ref: https://github.com/servo/servo/issues/15460 for more info for why it's needed. */ | ||
|
|
||
| // TODO: write docs for this mod | ||
| use servo_config; |
This comment has been minimized.
This comment has been minimized.
canova
Mar 15, 2017
Member
You've changed the extern crate servo_config; to #[cfg(feature = "servo")] extern crate servo_config; in components/style/lib.rs.
In gecko build it tries to find this crate but fails. You can either add a cfg to this use statement or you can simply add related use statements inside servo functions.(as Manishearth wrote in issue example.)
This comment has been minimized.
This comment has been minimized.
karan1276
Mar 17, 2017
Author
Contributor
aah, that explains it. I think ill add an cfg. Just curious, how did you debug that because error did not log anything
This comment has been minimized.
This comment has been minimized.
canova
Mar 17, 2017
Member
rustc should give you an error like this when you run ./mach build-geckolib:
error[E0432]: unresolved import `servo_config`
--> /Users/canova/projects/servo/components/style/config.rs:11:5
|
11 | use servo_config;
| ^^^^^^^^^^^^ no `servo_config` in the root
error: aborting due to previous error
What OS do you use? If this didn't show up, maybe it was a rustc bug?
| * License, v. 2.0. If a copy of the MPL was not distributed with this | ||
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
|
||
| /* Ref: https://github.com/servo/servo/issues/15460 for more info for why it's needed. */ |
This comment has been minimized.
This comment has been minimized.
canova
Mar 15, 2017
Member
I think adding a brief explanation about this module with //! comments would be better instead.
|
I'm still not comfortable calling it a facade. |
|
@KiChjang I am fine calling it anything. Maybe you and @Manishearth can talk and come to a conclusion ? |
|
In the issue, @nox suggested to call it |
|
Okay, cool |
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | ||
|
|
||
| /* | ||
| * servo_config is a crate in components/config that pulls in a lot of random stuff. In gecko mode, |
This comment has been minimized.
This comment has been minimized.
canova
Mar 17, 2017
•
Member
Rustdoc uses //! for module or crate level documentation. Could you convert /* .. */ to that please? With this change you can remove the #[allow(missing_docs)] attribute in the
#[allow(missing_docs)] pub mod config; line. Also we will be able to see this comment in the doc.servo.org after this.
nit: also it would be wonderful if you can shorten these lines to match license length while you're here.
| /* Ref: https://github.com/servo/servo/issues/15460 for more info for why it's needed. */ | ||
|
|
||
| // TODO: write docs for this mod | ||
| use servo_config; |
This comment has been minimized.
This comment has been minimized.
canova
Mar 17, 2017
Member
rustc should give you an error like this when you run ./mach build-geckolib:
error[E0432]: unresolved import `servo_config`
--> /Users/canova/projects/servo/components/style/config.rs:11:5
|
11 | use servo_config;
| ^^^^^^^^^^^^ no `servo_config` in the root
error: aborting due to previous error
What OS do you use? If this didn't show up, maybe it was a rustc bug?
| #[cfg(feature = "servo")] use servo_config; | ||
|
|
||
| // prefs functions | ||
| #[cfg(feature = "servo")] #[allow(missing_docs)] |
This comment has been minimized.
This comment has been minimized.
canova
Mar 17, 2017
Member
nit: I'm not comfortable with these #[allow(missing_docs)] attributes but it's OK, I guess. At least we can move them to a separate line maybe?
|
|
|
This looks good, maybe address @canaltinova's comment about either documenting the settings or moving the
|
|
Please also remove the merge commit. |
|
Actually i tried to rebase 2-3 times but always mess it up. There are conflicts at same line for multiple commits. It gets really difficult to remove just the right change. merge on the other hand just compares final results and points out all conflicts in one go. If it's not really a big issue i would suggest we go for a merge here. |
|
No, we don't allow merge commits in general because it's a result of an improper (or absence of) rebase. If you want help with it, please ask. |
|
Yes it will be awesome if you can help. |
|
https://github.com/servo/servo/wiki/Beginner's-guide-to-rebasing-and-squashing I think this guide is very good for explaining how to do rebase and squash. But for this specific situation here's how I would do it: First you need to delete this merge commit and squash others with interactive rebase: Let us know if you still have questions. Or we can do it for you if you check the "Allow edits from maintainers" checkbox. |
|
@canaltinova Thanks! That's a good strategy. I won't follow it exactly but i will first squash and then rebase. I don't want to do them together because i suspect squash will have it's own conflicts(maybe not, not sure) and then rebase will defiantly have conflicts. And it's easier for me to handle them separately. Thanks again |
|
Yes, you can probably try to delete merge commit with |
|
|
|
|
|
|
|
These conflicts will pop up every time there is a merge in master. I would resolve them at the end just before this PR gets merged. Are there any other outstanding issues except for the conflicts? |
|
this looks good if you address @canaltinova's comment about converting |
|
some changes in #16297 are pretty major, ill remove conflicts but be cautious while reviewing |
6a1caa4
to
8ad84f7
| impl TraversalStatistics { | ||
| /// Returns whether statistics dumping is enabled. | ||
| pub fn should_dump() -> bool { |
This comment has been minimized.
This comment has been minimized.
| impl TraversalStatistics { | ||
| /// Returns whether statistics dumping is enabled. | ||
| pub fn should_dump() -> bool { | ||
| shall_stat_style_sharing() | ||
| *DUMP_STYLE_STATISTICS || config::style_sharing_stats_enabled() |
This comment has been minimized.
This comment has been minimized.
canova
Apr 11, 2017
Member
This looks wrong. Currently servo returns opts::get().style_sharing_stats and gecko returns *DUMP_STYLE_STATISTICS. We need to preserve that behavior. You should remove the *DUMP_STYLE_STATISTICS || from here and return *DUMP_STYLE_STATISTICS in gecko's style_sharing_stats_enabled function.
| if is_share_style_cache_disabled() { | ||
| ======= | ||
| if config::disable_share_style_cache_enabled() { | ||
| >>>>>>> Change code for serialization for {box,text}-shadow so blur-radius |
This comment has been minimized.
This comment has been minimized.
|
|
||
| if traversal_flags.for_reconstruct() { | ||
| if cfg!(feature = "servo") && config::nonincremental_layout_enabled() { |
This comment has been minimized.
This comment has been minimized.
|
|
Yup, you are probably right. Maybe you can tell me for sure if this pr is needed anymore ? If not then lets just shut it right away, why spend more time. |
|
Closing as it looks like this is already implemented. |
karan1276 commentedMar 12, 2017
•
edited
Ref: #15460
./mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThese changes fix #15460(github issue number if applicable).
These changes do not require tests because no new functionality is added. Existing test should cover all the changes.
This change is