Closed
Bug 815320
Opened 12 years ago
Closed 12 years ago
Bad paths in services code
Categories
(Cloud Services :: Firefox: Common, defect)
Tracking
(firefox18 affected, firefox19 affected)
RESOLVED
INVALID
People
(Reporter: jimm, Assigned: glandium)
References
Details
Attachments
(1 file, 5 obsolete files)
(deleted),
patch
|
Details | Diff | Splinter Review |
No description provided.
Reporter | ||
Comment 1•12 years ago
|
||
Assignee: nobody → jmathies
Comment 2•12 years ago
|
||
Can you tell me why these paths are bad? resource://gre/modules is used throughout the tree. https://mxr.mozilla.org/mozilla-central/search?string=gre/modules
Reporter | ||
Comment 3•12 years ago
|
||
(In reply to Gregory Szorc [:gps] from comment #2)
> Can you tell me why these paths are bad? resource://gre/modules is used
> throughout the tree.
> https://mxr.mozilla.org/mozilla-central/search?string=gre/modules
Services code is installed in the app directory rather than platform. I'm not sure why that is. Cc'ing a few people who in who might know.
Comment 4•12 years ago
|
||
(In reply to Jim Mathies [:jimm] from comment #3)
> Services code is installed in the app directory rather than platform. I'm
> not sure why that is. Cc'ing a few people who in who might know.
The answer is likely hysterical raisins.
Parts of /services should probably be considered platform (like /services/common). Others (like /services/sync) might be a better fit for app. What's the distinction? Why does it matter?
It seems that up until now it really didn't matter and it was just a matter of paths and URIs being in agreement. You are obviously changing things for Metro, so it must matter now. What's going on?
Reporter | ||
Comment 5•12 years ago
|
||
With metro we are adding a second application with it's own app resources to the standard packaging. The work to enable this is taking place in bug 755724, which should be landing on mc here in the next few weeks. So we have two app dirs which get chosen depending on how the exe starts up. For firefox it's ./browser, for metro it's ./metro. (Also we have webaprt, which will be split out well.)
When we run xpcshell tests with this new setup by default the application directory is the gre directory. Hence these tests fail because they rely on resources that are stored in app dir modules.
Bug 810617 takes care of allowing us to set an app dir ('browser' or 'metro' or ..) per test or for a set of tests through the xpcshell.ini file, so we have that bit of logic fixed up. What's left to do involves going over all the places where test authors have assumed an app resource is available that isn't, and touching those tests up. Hence this bug. Make sense?
Comment 6•12 years ago
|
||
That does help.
Most of the code in /services isn't application specific. Most of the code in /services is expected to be able to run on multiple apps.
Therefore, I'm tempted to say that the code (read: JS modules) in /services should be installed in platform/GRE, not an app dir.
Is that reasoning proper?
Comment 7•12 years ago
|
||
(In reply to Gregory Szorc [:gps] from comment #6)
> Is that reasoning proper?
It works for me. Firefox browser-specific services code already lives in browser/ or components/ (mainly the setup UX).
services/ should be considered platform, if the alternative is to dupe-deploy it….
Assignee | ||
Comment 8•12 years ago
|
||
(In reply to Jim Mathies [:jimm] from comment #5)
> With metro we are adding a second application with it's own app resources to
> the standard packaging. The work to enable this is taking place in bug
> 755724, which should be landing on mc here in the next few weeks. So we have
> two app dirs which get chosen depending on how the exe starts up. For
> firefox it's ./browser, for metro it's ./metro. (Also we have webaprt, which
> will be split out well.)
Even before that, you could build firefox as a xulrunner application, in which case the application path and the gecko path are different. That's how firefox is built on several Linux distros.
Reporter | ||
Comment 9•12 years ago
|
||
(In reply to Gregory Szorc [:gps] from comment #6)
> That does help.
>
> Most of the code in /services isn't application specific. Most of the code
> in /services is expected to be able to run on multiple apps.
>
> Therefore, I'm tempted to say that the code (read: JS modules) in /services
> should be installed in platform/GRE, not an app dir.
>
> Is that reasoning proper?
This sounds right to me and solves the problem of having to build services twice to get the app resources in two different app dirs. I'm just curious why we put these resources in the app dir in the first place. Maybe there was good reason.
I'll experiment with moving to gre.
Comment 10•12 years ago
|
||
As I said, it was likely app for hysterical raisins.
See also bug 779370.
In short, we know the current state sucks. It just hasn't been a high priority for us to fix.
Reporter | ||
Comment 11•12 years ago
|
||
Comment on attachment 685309 [details] [diff] [review]
patch v.1
Ok, so I came at this from the wrong angle. On elm we added an include that imported the DIST_SUBDIR from the browser in services -
http://mxr.mozilla.org/projects-central/source/elm/services/defs.mk
http://mxr.mozilla.org/projects-central/source/elm/browser/defs.mk
Which put everything into dist/bin/browser. I think this was a mistake, since most of the paths in the services code already pointed to gre. So I'm removing this include and will check all the paths again to be sure we don't have any app paths.
I'll look at bug 779370 as well although it won't hold up landings on elm.
Attachment #685309 -
Attachment is obsolete: true
Assignee | ||
Comment 12•12 years ago
|
||
However, there *are* parts in browser and parts in gre, and paths added by bug 809930 and bug 802914 are wrong.
Assignee | ||
Comment 14•12 years ago
|
||
The interesting thing is that services code usually uses resource://services-common/ instead of resource:///modules/services-common/ because it's an alias it sets. So using resource://services-common/ would solve every problem with resource://{gre,}/modules/services-common/, even if services-common is moved to gre in the future
Assignee | ||
Comment 15•12 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #13)
> And bug 804491.
And many others :(
Assignee | ||
Comment 16•12 years ago
|
||
This would certainly benefit from aliases like services-common for metrics and healthreport, but i'll leave that for another bug.
Attachment #687016 -
Flags: review?(gps)
Assignee | ||
Updated•12 years ago
|
Assignee: jmathies → mh+mozilla
Reporter | ||
Comment 17•12 years ago
|
||
I don't think you want the resource://gre/ -> resource:/// conversions in metrics tests, did you migrate those from my original patch?) (which was wrong)
Reporter | ||
Comment 18•12 years ago
|
||
Also in the health report code.
Reporter | ||
Comment 19•12 years ago
|
||
For discussion, I was moving this code in the opposite direction: placing all services code in gre. This also requires a change to xpcshell and xredirprovider so that the services prefs are found.
Assignee | ||
Comment 20•12 years ago
|
||
Every js and jsm file under services/ is installed in browser.
Assignee | ||
Comment 21•12 years ago
|
||
(In reply to Jim Mathies [:jimm] from comment #19)
> Created attachment 687057 [details] [diff] [review]
> svc to gre v.1
>
> For discussion, I was moving this code in the opposite direction: placing
> all services code in gre. This also requires a change to xpcshell and
> xredirprovider so that the services prefs are found.
I'm also interested in fixing the urls in beta and aurora.
Reporter | ||
Comment 22•12 years ago
|
||
after a chat on irc, glandium is going to fix these paths for ff-on-xr on aurora/beta. We'll leave this open for continued work on moving services code to gre.
Whiteboard: [leave open]
Reporter | ||
Updated•12 years ago
|
Attachment #687057 -
Attachment is obsolete: true
Reporter | ||
Comment 23•12 years ago
|
||
I think this is the direction we want to go. The one issue I came up on was service prefs, which land in the newer 'defaults/preferences' location. From my understanding 'gre/defaults/pref' is depreciated; we keep it around due to channel-prefs.js, which we can't move easily. NS_APP_PREF_DEFAULTS_50_DIR is the constant for this older path which is recognized and returned by nsXREDirProvider, nsAppFileLocationProvider, and by xpcshell. AFAICT this constant is only used by Preferences.cpp.
So with the move of services to gre, services prefs need to get picked up by Preferences.cpp without breaking the older channel-prefs location. So I've added the new gre default prefs path to NS_APP_PREFS_DEFAULTS_DIR_LIST which is returned by nsXREDirProvider and by xpcshell, and marked NS_APP_PREF_DEFAULTS_50_DIR as depreciated.
Attachment #687136 -
Flags: review?(benjamin)
Reporter | ||
Comment 24•12 years ago
|
||
This will need to be updated to undo most of the changes in "Fix services import urls" once that lands on mc.
Reporter | ||
Comment 25•12 years ago
|
||
This removes the def.mk import and the bit of build logic that rebuilt svcs code so that it was distributed into /metro/*.
Assignee | ||
Comment 26•12 years ago
|
||
(In reply to Jim Mathies [:jimm] from comment #23)
> So with the move of services to gre, services prefs need to get picked up by
> Preferences.cpp without breaking the older channel-prefs location. So I've
> added the new gre default prefs path to NS_APP_PREFS_DEFAULTS_DIR_LIST which
> is returned by nsXREDirProvider and by xpcshell, and marked
> NS_APP_PREF_DEFAULTS_50_DIR as depreciated.
Why is there any need for changes for prefs? There's everything already to handle prefs in all the possible locations.
Reporter | ||
Comment 27•12 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #26)
> (In reply to Jim Mathies [:jimm] from comment #23)
> > So with the move of services to gre, services prefs need to get picked up by
> > Preferences.cpp without breaking the older channel-prefs location. So I've
> > added the new gre default prefs path to NS_APP_PREFS_DEFAULTS_DIR_LIST which
> > is returned by nsXREDirProvider and by xpcshell, and marked
> > NS_APP_PREF_DEFAULTS_50_DIR as depreciated.
>
> Why is there any need for changes for prefs? There's everything already to
> handle prefs in all the possible locations.
gre/defaults/preferences isn't picked up by Preferences.cpp without these changes once we split gre and app locations.
Comment 28•12 years ago
|
||
Holy cow a lot happened in just a few hours!
First, where did this C++ patch come from? AFAICT it's not related to /services and IMO should be a separate bug.
(In reply to Jim Mathies [:jimm] from comment #22)
> after a chat on irc, glandium is going to fix these paths for ff-on-xr on
> aurora/beta.
Why? What harm are they causing that warrants uplift?
Comment 29•12 years ago
|
||
See also bug 813287 for changing how the HealthReport prefs work. Not sure if that is related. I was planning on landing that soonish.
Reporter | ||
Comment 30•12 years ago
|
||
(In reply to Gregory Szorc [:gps] from comment #28)
> Holy cow a lot happened in just a few hours!
>
> First, where did this C++ patch come from? AFAICT it's not related to
> /services and IMO should be a separate bug.
>
> (In reply to Jim Mathies [:jimm] from comment #22)
> > after a chat on irc, glandium is going to fix these paths for ff-on-xr on
> > aurora/beta.
>
> Why? What harm are they causing that warrants uplift?
Reporter | ||
Updated•12 years ago
|
Attachment #687136 -
Attachment is obsolete: true
Attachment #687136 -
Flags: review?(benjamin)
Reporter | ||
Updated•12 years ago
|
Attachment #687138 -
Attachment is obsolete: true
Reporter | ||
Updated•12 years ago
|
Attachment #687143 -
Attachment is obsolete: true
Reporter | ||
Updated•12 years ago
|
Whiteboard: [leave open]
Assignee | ||
Comment 31•12 years ago
|
||
(In reply to Gregory Szorc [:gps] from comment #28)
> Holy cow a lot happened in just a few hours!
>
> First, where did this C++ patch come from? AFAICT it's not related to
> /services and IMO should be a separate bug.
>
> (In reply to Jim Mathies [:jimm] from comment #22)
> > after a chat on irc, glandium is going to fix these paths for ff-on-xr on
> > aurora/beta.
>
> Why? What harm are they causing that warrants uplift?
It breaks firefox when built as a xulrunner application, because the resource://gre/... urls are not found.
Assignee | ||
Comment 32•12 years ago
|
||
(In reply to Jim Mathies [:jimm] from comment #27)
> gre/defaults/preferences isn't picked up by Preferences.cpp without these
> changes once we split gre and app locations.
Why would there be things to pick up from gre/defaults/preferences? There shouldn't be anything in there in the first place.
Comment 33•12 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #31)
> It breaks firefox when built as a xulrunner application, because the
> resource://gre/... urls are not found.
Firefox isn't building any of that code on aurora/beta, right?
Reporter | ||
Comment 34•12 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #32)
> (In reply to Jim Mathies [:jimm] from comment #27)
> > gre/defaults/preferences isn't picked up by Preferences.cpp without these
> > changes once we split gre and app locations.
>
> Why would there be things to pick up from gre/defaults/preferences? There
> shouldn't be anything in there in the first place.
See comments in bug 817076.
Assignee | ||
Comment 35•12 years ago
|
||
(In reply to :Gavin Sharp (use gavin@gavinsharp.com for email) from comment #33)
> (In reply to Mike Hommey [:glandium] from comment #31)
> > It breaks firefox when built as a xulrunner application, because the
> > resource://gre/... urls are not found.
>
> Firefox isn't building any of that code on aurora/beta, right?
At least services/common/bagheeraclient.js and services/metrics/collector.jsm are.
BTW, there's a mistake in the patch, the manifest file should be left untouched. (bad sed)
Assignee | ||
Comment 36•12 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #35)
> BTW, there's a mistake in the patch, the manifest file should be left
> untouched. (bad sed)
services/sync/SyncComponents.manifest, that is
Comment 37•12 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #31)
> It breaks firefox when built as a xulrunner application, because the
> resource://gre/... urls are not found.
Is anyone actually complaining about this?
(In reply to Mike Hommey [:glandium] from comment #35)
> (In reply to :Gavin Sharp (use gavin@gavinsharp.com for email) from comment
> #33)
> > (In reply to Mike Hommey [:glandium] from comment #31)
> > > It breaks firefox when built as a xulrunner application, because the
> > > resource://gre/... urls are not found.
> >
> > Firefox isn't building any of that code on aurora/beta, right?
>
> At least services/common/bagheeraclient.js and
> services/metrics/collector.jsm are.
Those files shouldn't be referenced by Firefox until 20. I do not consider those files part of the public API. B2G (18) will reference them. But, B2G is not a XULRunner application and things seem to work just fine.
So, I ask again: why do we need to uplift?
Assignee | ||
Comment 38•12 years ago
|
||
(In reply to Gregory Szorc [:gps] from comment #37)
> (In reply to Mike Hommey [:glandium] from comment #31)
> > It breaks firefox when built as a xulrunner application, because the
> > resource://gre/... urls are not found.
>
> Is anyone actually complaining about this?
Me, with my Debian hat on, and the Fedora people, when they figure it out.
> (In reply to Mike Hommey [:glandium] from comment #35)
> > (In reply to :Gavin Sharp (use gavin@gavinsharp.com for email) from comment
> > #33)
> > > (In reply to Mike Hommey [:glandium] from comment #31)
> > > > It breaks firefox when built as a xulrunner application, because the
> > > > resource://gre/... urls are not found.
> > >
> > > Firefox isn't building any of that code on aurora/beta, right?
> >
> > At least services/common/bagheeraclient.js and
> > services/metrics/collector.jsm are.
>
> Those files shouldn't be referenced by Firefox until 20. I do not consider
> those files part of the public API. B2G (18) will reference them. But, B2G
> is not a XULRunner application and things seem to work just fine.
>
> So, I ask again: why do we need to uplift?
So, why are these files installed? (that's how i figured out, i have a script checking installed files for such wrong imports in the Debian package)
Comment 39•12 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #38)
> So, why are these files installed? (that's how i figured out, i have a
> script checking installed files for such wrong imports in the Debian package)
/services/common is installed because everything in /services/common is installed.
/services/metrics is installed because we wanted test coverage on as many branches as possible. The code is not intended to be used on 18 outside of B2G. We figured the desire for more test coverage outweighed shipping files that not aren't yet used.
FTR, I just see uplifting as more trouble than it's worth. I'm not going to block the effort - I just think it's a waste of time.
Assignee | ||
Comment 40•12 years ago
|
||
Ok, I'll just add an error filter, then.
Since bug 817076 was filed, I guess we can close this one.
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → INVALID
Assignee | ||
Comment 41•12 years ago
|
||
Mmmmm although it will still break those tests for me... sigh
Assignee | ||
Updated•12 years ago
|
Attachment #687016 -
Flags: review?(gps)
You need to log in
before you can comment on or make changes to this bug.
Description
•