Closed Bug 296426 Opened 20 years ago Closed 18 years ago

nsIXULRuntime should provide selected build config info

Categories

(Toolkit Graveyard :: XULRunner, enhancement, P4)

enhancement

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: jens.b, Assigned: benjamin)

References

Details

Attachments

(1 file, 1 obsolete file)

There should be a way to programmatically access some parts of the build config.
Most importantly, these are OS_TARGET and TARGET_ABI, the latter being
introduced by bug 294835. bsmedberg proposed adding these to nsIXULRuntime.

In case we don't have exact knowledge about the compiler being used, TARGET_ABI
won't be set - the corresponding property should then just be null.
Robert, I noticed that Reporter parses about:buildconfig to get the configure
arguments. I thought it might be a good idea to have a less fragile way of
accessing these (and to use the current method as a fallback for old builds). I
propose adding a property to the nsIXULRuntime interface that holds these
arguments. If you agree, you'd only have to convince bsmedberg that it's
valuable enough to be included...
I think this is a good idea too.  Right now, people end up having to grok
similar information from nsIHttpProtocolHandler, and that is not such a great
solution.
Blocks: 297222
I decided not to do .getFeature for this because it seems like overkill and I
really don't intend to freeze this any time soon.
Assignee: jens.b → benjamin
Status: NEW → ASSIGNED
Attachment #185811 - Flags: first-review?(darin)
Comment on attachment 185811 [details] [diff] [review]
Add nsIXULRuntime.OS and XPCOMABI

Looks ok, but I'd probably make XPCOMABI only expose the value of
TARGET_XPCOM_ABI since the combined value could then be formed from OS and
XPCOMABI.  plus it is confusing that XPCOMABI != TARGET_XPCOM_ABI.
Attachment #185811 - Flags: first-review?(darin) → first-review+
I second Darin's suggestion of XPCOMABI = TARGET_XPCOM_ABI. In fact, that is the
way I had implemented it. Both variables should just represent the configure
variables.

Oh, is there a reason for making these attributes ALLCAPS and not mixedCase? I'd
simply go for "xpcomABI" and "osTarget"... The latter is especially nice because
the name alone already emphasizes on *which* of our countless OS-related
configure vars it is based, e.g. not TARGET_OS.
bsmedberg and I talked about how to name these things, and we decided that
XPCOMABI is the best choice because it is afterall an acronym.
Make XPCOMABI just <processor>-<compilerABI> per review, carrying over review.
Attachment #185811 - Attachment is obsolete: true
Attachment #185854 - Flags: first-review+
Attachment #185854 - Flags: approval-aviary1.1a2?
Attachment #185854 - Flags: approval-aviary1.1a2? → approval-aviary1.1a2+
Comment on attachment 185854 [details] [diff] [review]
Add nsIXULRuntime.OS and XPCOMABI, rev. 2 [checked in]

Checked XPCOMABI revision 2 in, leaving this bug open for possible inclusion of
configure args as a propertybag.
Attachment #185854 - Attachment description: Add nsIXULRuntime.OS and XPCOMABI, rev. 2 → Add nsIXULRuntime.OS and XPCOMABI, rev. 2 [checked in]
nsIHttpProtocolHandler is also the only way to determine the Gecko revision (via
a substring of the "misc" portion of the UA string). What do you all think,
should we include that in nsIXULRuntime as well? I think it could improve
version distinction in extensions (especially when interfaces change), and it
would be nice to have it as a separate, well-documented attribute.
nsIXULAppInfo.geckoBuildID reports the datestamp of the Gecko build, but it does
not report the version.  I agree that the Gecko version should be exposed
someplace on this object.  Maybe both should be on nsIXULRuntime.
the reporter tool is a consumer of all done so far (and future todo's).  

Currently I am using a mess of code to pull the buildconfig string out of
about:buildconfig.  A more reliable method would obviously be welcome.  The
method we are doing right now is somewhat fragile (if buildconfig's html were to
change were busted).  

I'm not sure how much use it would be to others.  But I would be able to make
good use of a better method.
The remaining bits of this bug are not 1.8 material.
Priority: -- → P4
Target Milestone: --- → mozilla1.9alpha1
*** Bug 124968 has been marked as a duplicate of this bug. ***
Marking this fixed. If somebody wants configure flags as a propertybag they may use a separate bug.
Status: ASSIGNED → RESOLVED
Closed: 18 years ago
Resolution: --- → FIXED
Product: Toolkit → Toolkit Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: