Closed
Bug 1052526
Opened 11 years ago
Closed 11 years ago
mach build-docs broken from OS_LIBS refactoring
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(Not tracked)
RESOLVED
FIXED
mozilla34
People
(Reporter: gps, Assigned: gps)
References
Details
Attachments
(1 file, 1 obsolete file)
|
3.06 KB,
patch
|
glandium
:
review+
|
Details | Diff | Splinter Review |
|mach build-docs| is busted.
mach build-docs evaluates each moz.build file (not just the active moz.build files) in isolation by calling reader.walk_topsrcdir(). The assumption that CONFIG['EDITLINE_LIBS'] is defined is not valid in this execution mode.
----------
Error running mach:
['build-docs']
The error occurred in code that was called by the mach command. This is either
a bug in the called code itself or in the way that mach is calling it.
You should consider filing a bug for this issue.
If filing a bug, please include the full output of mach, including this error
message.
The details of the failure are as follows:
BuildReaderError:
==============================
ERROR PROCESSING MOZBUILD FILE
==============================
The error occurred while processing the following file:
/Users/gps/src/firefox/js/src/shell/moz.build
The error was triggered on line 33 of this file:
OS_LIBS += CONFIG['EDITLINE_LIBS']
An error was encountered as part of executing the file itself. The error appears to be the fault of the script.
The error as reported by Python is:
['ValueError: Only lists can be appended to lists.\n']
File "/Users/gps/src/firefox/tools/docs/mach_commands.py", line 49, in build_docs
for sandbox in reader.walk_topsrcdir():
File "/Users/gps/src/firefox/python/mozbuild/mozbuild/frontend/reader.py", line 712, in walk_topsrcdir
filesystem_absolute=True, read_tiers=True):
File "/Users/gps/src/firefox/python/mozbuild/mozbuild/frontend/reader.py", line 758, in read_mozbuild
sys.exc_info()[2], sandbox_exec_error=se)
| Assignee | ||
Comment 1•11 years ago
|
||
|mach build-docs| failed to parse this moz.build file in isolation
because EDITLINE_LIBS is not always defined. This patch fixes that and
unbreaks |mach build-docs|.
Attachment #8471650 -
Flags: review?(mshal)
| Assignee | ||
Updated•11 years ago
|
Assignee: nobody → gps
Status: NEW → ASSIGNED
Comment 2•11 years ago
|
||
Comment on attachment 8471650 [details] [diff] [review]
Conditionally append EDITLINE_LIBS
Can we solve this more generally by allowing '+= (None)' to do nothing? Ie: something like:
def __iadd__(self, other):
if other is None:
return self
...
If you'd rather not go that route, this patch looks fine. I think we'd probably hit similar bugs in the future, though.
Attachment #8471650 -
Flags: review?(mshal) → review+
Comment 3•11 years ago
|
||
Comment on attachment 8471650 [details] [diff] [review]
Conditionally append EDITLINE_LIBS
Review of attachment 8471650 [details] [diff] [review]:
-----------------------------------------------------------------
EDITLINE_LIBS is an AC_SUBST_LIST. When it's empty, its value is []. There must be something else wrong... like configure being outdated.
Attachment #8471650 -
Flags: review+ → review-
| Assignee | ||
Comment 4•11 years ago
|
||
EDITLINE_LIBS is not defined in my config.status and not present in my configure script. I don't see what conditional its AC_SUBST_LIST is behind. Something seems very weird.
Comment 5•11 years ago
|
||
It should be in obj/js/src/config.status, but I guess that's not sourced?
| Assignee | ||
Comment 6•11 years ago
|
||
Gah. Looking at wrong config.status. From js/src/config.status:
(''' EDITLINE_LIBS ''', list(r''' '''.split())),
| Assignee | ||
Comment 7•11 years ago
|
||
I think this is a bug in reader.walk_topsrcdir() not applying the proper config.status or descending into directories belonging to external build systems. This bug was likely uncovered by OS_LIBS foo.
Comment 8•11 years ago
|
||
(In reply to Gregory Szorc [:gps] from comment #7)
> I think this is a bug in reader.walk_topsrcdir() not applying the proper
> config.status or descending into directories belonging to external build
> systems. This bug was likely uncovered by OS_LIBS foo.
The OS_LIBS += CONFIG['EDITLINE_LIBS'] is exercised on m-c builds with a [] value already. It has to be something else.
Comment 9•11 years ago
|
||
Ah, I see what you mean.
Comment 10•11 years ago
|
||
... and I might have something related in my patch queue.
Comment 11•11 years ago
|
||
(In reply to Mike Hommey [:glandium] from comment #10)
> ... and I might have something related in my patch queue.
but it doesn't help.
So the problem is that walk_topsrcdir() doesn't follow DIRS, and doesn't pass down config environments when going through subdirectories. So js/src/moz.build does get js/src/config.status environment, but not the subdirectories.
| Assignee | ||
Comment 12•11 years ago
|
||
As a special exception, we change List's + and += operators to treat
"+ None" and "+= None" as "+ []" and "+= []" respectively.
This is a hack to make moz.build files simpler so they don't have to
perform "is x" checks before appending x.
While I was here, I fixed the implementation of List.__add__ to return a
List instead of list.
This hack solves the undefined EDITLINE_LIBS nicely. The more proper
solution is to fix walk_topsrcdir(). But that is more work because it
requires moz.build to know which files we shouldn't descend into. I'd
rather not hack up traversal right now because it's already in a "fun"
state.
Attachment #8471952 -
Flags: review?(mh+mozilla)
| Assignee | ||
Updated•11 years ago
|
Attachment #8471650 -
Attachment is obsolete: true
Updated•11 years ago
|
Attachment #8471952 -
Flags: review?(mh+mozilla) → review+
| Assignee | ||
Comment 13•11 years ago
|
||
Comment 14•11 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
Updated•11 years ago
|
QA Whiteboard: [qa-]
Updated•8 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•