Closed Bug 729067 Opened 8 years ago Closed 8 years ago changes LDFLAGS before calling js/src/configure


(Firefox Build System :: General, defect)

Windows 7
Not set


(Not tracked)



(Reporter: jacek, Assigned: jacek)




(1 file, 3 obsolete files)

Attached patch fix v1.0 (obsolete) — Splinter Review
Bug 720621 introduced a pair of export/unset calls on LDFLAGS, which clears its variable, so configure ran like:

LDFLAGS="..." make -f build

won't work for js/src/configure. While we could just fix this one case, I propose more radical solution which makes already existing variable preserving stronger.
Attachment #599088 - Flags: review?(mh+mozilla)
Comment on attachment 599088 [details] [diff] [review]
fix v1.0

I tend to agree, here, but I prefer to get some more eyes on this thing. (Ted or Kyle, whoever comes first)
Attachment #599088 - Flags: review?(ted.mielczarek)
Attachment #599088 - Flags: review?(mh+mozilla)
Attachment #599088 - Flags: review?(khuey)
Attachment #599088 - Flags: review+
Comment on attachment 599088 [details] [diff] [review]
fix v1.0

Review of attachment 599088 [details] [diff] [review]:

Seems reasonable enough to me.
Attachment #599088 - Flags: review?(khuey) → review+
Thanks for reviews, pushed to m-i:
Whiteboard: [inbound]
Backed out for failing to build on all platforms. It may have just needed a clobber, but without a green try run I was hesitant to just clobber/retrigger, since in the meantime we could have had 10 other csets land all burning.
Whiteboard: [inbound]
Thanks for taking care of the backout. It looks it needs a clobber, I've pushed the patch to try to make sure:
Attachment #599088 - Flags: review?(ted.mielczarek)
Attached patch fix v1.0 (obsolete) — Splinter Review
It came out that clobbering would not be enough. libffi's configure script is invoked in a bit hackish way for MSVC, so we need to make sure CFLAGS and LDFLAGS are cleared before its invocation. The attached patch is green on try:
Attachment #602297 - Flags: review?(mh+mozilla)
Comment on attachment 602297 [details] [diff] [review]
fix v1.0

Review of attachment 602297 [details] [diff] [review]:

::: js/src/
@@ +5382,5 @@
>      # Use a wrapper script for cl and ml that looks more like gcc.
>      # autotools can't quite handle an MSVC build environment yet.
>      ac_configure_args="$ac_configure_args LD=link CPP=\"cl -nologo -EP\" SHELL=sh.exe"
> +    export LDFLAGS=
> +    export CFLAGS=

In practice, what were the flags before your patch, and what are they after? I can't tell if this is harmful without knowing that.
Attachment #602297 - Flags: review?(mh+mozilla)
They are exactly the same before and after the patch for me and contain LDFLAGS and CFLAGS that are the result of running js's configure script. These are values I get on MSVC build:

CFLAGS="-TC -nologo -W3 -Gy -Fd$(COMPILE_PDBFILE) -we4553"

The difference is that with my patch, these values get exported by top level configure, so js/src/configure modifies exported values and thus they are visible to libffi's configure.

The more I think about it, the less I like the idea of exporting these values. Perhaps avoiding the export/unset calls in the first place is the right way to go after all... I will attach an alternative patch.
Attached patch alternative patch (obsolete) — Splinter Review
The patch that avoids export/unset calls around nspr configure. Since it was introduced for Android as part of bug 720621, I can't test it locally. If we decided to go with this patch, is try build enough for testing?
Comment on attachment 602307 [details] [diff] [review]
alternative patch

Arguably, we should be doing that for all variables.

As for testing, NSPR_LDFLAGS is only set if using Android NDK >= r6b, and our build infrastructure uses r5c, so try won't tell you if that actually works.
My last attempt didn't work, because nspr configure can't handle
./configure CFLAGS="..."
syntax. I think it's because of ancient autoconf-2.13 used, but I'm not sure (my experiments suggest that's the reason, it's hard to find any info about it).

Thus, I'm back to the solution from comment 6. I will attach a patch that follows the same pattern, but does not export variables on their own. So, if these variables are exported for some reason, we'd behave correctly, but don't export them unless needed.

The patch succeeded on try:
Attached patch fix v2.1Splinter Review
Attachment #599088 - Attachment is obsolete: true
Attachment #602297 - Attachment is obsolete: true
Attachment #602307 - Attachment is obsolete: true
Attachment #605716 - Flags: review?(mh+mozilla)
Attachment #605716 - Flags: review?(mh+mozilla) → review+
Thanks for the review.
Whiteboard: [inbound]
Closed: 8 years ago
Resolution: --- → FIXED
Whiteboard: [inbound]
Target Milestone: --- → mozilla14
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.