Closed Bug 338305 Opened 20 years ago Closed 19 years ago

XUL Preprocessor (preprocessor.pl) does not handle define names with dots in them (debug builds fail if your user name contains a period)

Categories

(Firefox Build System :: General, defect)

defect
Not set
major

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.9alpha1

People

(Reporter: Gavin, Assigned: Gavin)

References

()

Details

Attachments

(2 files, 1 obsolete file)

-DDEBUG_foo.bar will cause an error, because it tries to match -D parameters against either ^(\w+)=(.*)$ or ^(\w+)$, and the period character is not in the \w class. This is fallout from the "try this" fix in bug 337875. It happens when a user name has a period in it (see bug 337875 comment 7). I think we could probably change \w to \S in the /^(\w+)=(.*)$/ case.
Summary: XUL Preprocessor (preprocessor.pl) does not handle define names with dots in them → XUL Preprocessor (preprocessor.pl) does not handle define names with dots in them (debug builds fail if your user name contains a period)
Attached patch patch? (obsolete) — Splinter Review
Maybe \S is too lenient, I'm not sure. I guess it might be worth changing the parsing of the other parameters to match if we take this, too.
Assignee: nobody → gavin.sharp
Status: NEW → ASSIGNED
Attachment #222373 - Flags: superreview?(benjamin)
Attachment #222373 - Flags: review?(ian)
Comment on attachment 222373 [details] [diff] [review] patch? how about [^\s=|\(\)] we definitely don't want variable names to contain those characters, because it makes parsing impossible.
Attachment #222373 - Flags: superreview?(benjamin)
Attachment #222373 - Flags: superreview-
Attachment #222373 - Flags: review?(ian)
Attached patch minimal patchSplinter Review
Attachment #222373 - Attachment is obsolete: true
Attachment #223404 - Flags: review?(benjamin)
Comment on attachment 223404 [details] [diff] [review] minimal patch I still like my regexp better, but this at least fixes the bug.
Attachment #223404 - Flags: review?(benjamin) → review+
Whiteboard: [checkin needed]
Checked in that fix.
Status: ASSIGNED → RESOLVED
Closed: 20 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
Target Milestone: --- → mozilla1.9alpha
It seems like we might want to keep macro names something identifier-like -- perhaps the DEBUG_* defining should strip out the chars that aren't identifier-like out of the user name?
This bug still happen when I build the latest trunk. I have checked the file preprocessor.pl, it's up-to-date. for i in ./security-prefs.js; \ do /usr/bin/perl ../../../config/preprocessor.pl -DOSTYPE=\"SunOS5\" -DOSARCH=\"SunOS\" -DBUILD_ID=0000000000 -DIMPL_NS_NET -DMOZILLA_VERSION=\"1.9a1\" -DMOZILLA_VERSION_U=1.9a1 -DSOLARIS=1 -DNSCAP_DISABLE_DEBUG_PTR_TYPES=1 -DD_INO=d_ino -DSTDC_HEADERS=1 -DHAVE_ST_BLKSIZE=1 -DHAVE_SIGINFO_T=1 -DHAVE_INT16_T=1 -DHAVE_INT32_T=1 -DHAVE_INT64_T=1 -DHAVE_UINT=1 -DHAVE_UINT_T=1 -DHAVE_UINT16_T=1 -DHAVE_DIRENT_H=1 -DHAVE_SYS_BYTEORDER_H=1 -DHAVE_GETOPT_H=1 -DHAVE_MEMORY_H=1 -DHAVE_UNISTD_H=1 -DHAVE_NL_TYPES_H=1 -DHAVE_MALLOC_H=1 -DHAVE_X11_XKBLIB_H=1 -DHAVE_SYS_STATVFS_H=1 -DHAVE_SYS_STATFS_H=1 -DHAVE_LIBM=1 -DHAVE_LIBDL=1 -DHAVE_LIBSOCKET=1 -DFUNCPROTO=15 -DHAVE_XSHM=1 -D_REENTRANT=1 -DHAVE_RANDOM=1 -DHAVE_STRERROR=1 -DHAVE_LCHOWN=1 -DHAVE_FCHMOD=1 -DHAVE_SNPRINTF=1 -DHAVE_MEMMOVE=1 -DHAVE_RINT=1 -DHAVE_STAT64=1 -DHAVE_LSTAT64=1 -DHAVE_FLOCKFILE=1 -DHAVE_LOCALTIME_R=1 -DHAVE_STRTOK_R=1 -DHAVE_LANGINFO_CODESET=1 -DVA_COPY=va_copy -DHAVE_VA_COPY=1 -DHAVE_I18N_LC_MESSAGES=1 -DMOZ_EMBEDDING_LEVEL_DEFAULT=1 -DMOZ_EMBEDDING_LEVEL_BASIC=1 -DMOZ_EMBEDDING_LEVEL_MINIMAL=1 -DMOZ_PHOENIX=1 -DMOZ_BUILD_APP=browser -DMOZ_XUL_APP=1 -DMOZ_DEFAULT_TOOLKIT=\"gtk2\" -DMOZ_WIDGET_GTK2=1 -DMOZ_ENABLE_XREMOTE=1 -DMOZ_X11=1 -DMOZ_DISTRIBUTION_ID=\"org.mozilla\" -DMOZ_ENABLE_XFT=1 -DMOZ_ENABLE_GNOMEUI=1 -DOJI=1 -DIBMBIDI=1 -DMOZ_VIEW_SOURCE=1 -DACCESSIBILITY=1 -DMOZ_XPINSTALL=1 -DMOZ_JSLOADER=1 -DNS_PRINTING=1 -DNS_PRINT_PREVIEW=1 -DMOZ_NO_XPCOM_OBSOLETE=1 -DMOZ_XTF=1 -DMOZ_MATHML=1 -DMOZ_ENABLE_CANVAS=1 -DMOZ_SVG=1 -DMOZ_UPDATE_CHANNEL=default -DMOZ_PLACES=1 -DMOZ_FEEDS=1 -DMOZ_STORAGE=1 -DMOZ_SAFE_BROWSING=1 -DMOZ_URL_CLASSIFIER=1 -DMOZ_LOGGING=1 -DMOZ_USER_DIR=\".mozilla\" -DHAVE_STDINT_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_SYS_INT_TYPES_H=1 -DHAVE_UINT64_T=1 -DMOZ_XUL=1 -DMOZ_PROFILELOCKING=1 -DMOZ_MORKREADER=1 -DMOZ_DLL_SUFFIX=\".so\" -DXP_UNIX=1 -DUNIX_ASYNC_DNS=1 -DJS_THREADSAFE=1 -DMOZ_REFLOW_PERF=1 -DMOZ_REFLOW_PERF_DSP=1 -DMOZ_ACCESSIBILITY_ATK=1 -DATK_MAJOR_VERSION=1 -DATK_MINOR_VERSION=11 -DATK_REV_VERSION=4 -DMOZILLA_LOCALE_VERSION=\"1.9a1\" -DMOZILLA_REGION_VERSION=\"1.9a1\" -DMOZILLA_SKIN_VERSION=\"1.8\" -DDEBUG -D_DEBUG -DDEBUG_leon.sha -DTRACING $i > ../../../dist/bin/greprefs/`basename $i`; \ done not a valid variable name: 'DEBUG_leon.sha' gmake[2]: *** [libs] Error 2 gmake[2]: Leaving directory `/export/home/leon.sha/uild/firefox/build0616/mozilla/netwerk/base/public' gmake[1]: *** [libs] Error 2 gmake[1]: Leaving directory `/export/home/leon.sha/uild/firefox/build0616/mozilla/netwerk/base' gmake: *** [all] Error 2
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Attached patch fix other casesSplinter Review
Attachment #225901 - Flags: review?(benjamin)
Leon: could you test this patch and let me know if it fixes all the issues?
(In reply to comment #9) > Leon: could you test this patch and let me know if it fixes all the issues? > Yes, it works. To me there is no more issues.
Attachment #225901 - Flags: review?(benjamin) → review+
Whiteboard: [checkin needed]
mozilla/config/preprocessor.pl 3.34
Status: REOPENED → RESOLVED
Closed: 20 years ago19 years ago
Resolution: --- → FIXED
Whiteboard: [checkin needed]
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: