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)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
mozilla34

People

(Reporter: gps, Assigned: gps)

References

Details

Attachments

(1 file, 1 obsolete file)

|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)
|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: nobody → gps
Status: NEW → ASSIGNED
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 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-
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.
It should be in obj/js/src/config.status, but I guess that's not sourced?
Gah. Looking at wrong config.status. From js/src/config.status: (''' EDITLINE_LIBS ''', list(r''' '''.split())),
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.
(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.
Ah, I see what you mean.
... and I might have something related in my patch queue.
(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.
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)
Attachment #8471650 - Attachment is obsolete: true
Attachment #8471952 - Flags: review?(mh+mozilla) → review+
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla34
QA Whiteboard: [qa-]
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: