Closed Bug 137059 Opened 22 years ago Closed 22 years ago

configure outputs incorrect definition for DEFINES if whoami returns a name with a space

Categories

(SeaMonkey :: Build Config, defect, P4)

x86
Windows XP

Tracking

(Not tracked)

RESOLVED FIXED
mozilla1.2alpha

People

(Reporter: jonwil, Assigned: netscape)

References

Details

Attachments

(1 file, 2 obsolete files)

On my system, whoami (from cygwin) returns Jonathan Wilson
This causes something inside configure to define DEFINES as 
-DDEBUG_Jonathan=Wilson\ 1 (plus other defines).

Is this infact a problem with configure and if so, what do we do to fix it?
This is questionably a problem with configure.  We don't support spaces in
usernames and that's what's causing whomai to return that bogus value.
Status: UNCONFIRMED → NEW
Ever confirmed: true
Accepting this bug, fix should be available shortly
Status: NEW → ASSIGNED
Blocks: 134113
I got a fix for this bug available but I cant make a patch since my configure.in
files have changed because of bug 134113
You change line 323 of nsprpub/configure.in to this
    AC_DEFINE_UNQUOTED(DEBUG_`$WHOAMI | sed -e's/ /_/g;'`)
and line 3316 of configure.in to this
        MOZ_DEBUG_ENABLE_DEFS="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`echo ${USERNAME}
| sed -e's/ /_/g;'`"

Anyone that has vanila configure.in files want to do the changes then post a fix
to the bug?
Attached patch Jonathan's patch (obsolete) — Splinter Review
Attached patch Corrected patch (obsolete) — Splinter Review
Attachment #81145 - Attachment is obsolete: true
I suggest that we simply not define the DEBUG_`$WHOAMI` macro.
This is what I will do to the NSPR build system (bug 140399).
In fact I doubt anyone is using the DEBUG_`$WHOAMI` macro now.
Depends on: 140399
Well, it's not used in NSPR but it is used all over the rest of the tree, as an
lxr for DEBUG_ will show (or DEBUG_<your favorite hacker here>).  I don't see
any benefit of dropping the define at this point. 
Priority: -- → P4
Target Milestone: --- → mozilla1.0.1
Target Milestone: mozilla1.0.1 → mozilla1.1beta
*** Bug 89302 has been marked as a duplicate of this bug. ***
Attachment #81147 - Attachment is obsolete: true
Target Milestone: mozilla1.1beta → mozilla1.2alpha
Comment on attachment 94527 [details] [diff] [review]
drop whoami for win32 & fix ldap too

r=dmose@netscape.com
Attachment #94527 - Flags: review+
Comment on attachment 94527 [details] [diff] [review]
drop whoami for win32 & fix ldap too

r=mcs
The patch has been checked into:
mozilla trunk
nspr trunk
ldap trunk
nspr NSPRPUB_PRE_4_2_CLIENT_BRANCH
ldap ldapcsdk_50_client_branch
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
Comment on attachment 94527 [details] [diff] [review]
drop whoami for win32 & fix ldap too

>+    case "${target_os}" in
>+    beos*)
>+        DEFINES="$DEFINES -DDEBUG_${USER}"
>+        ;;
>+    msvc*|mksnt*|cygwin*|mingw*)
>+        DEFINES="$DEFINES -DDEBUG_`echo ${USERNAME} | sed -e 's| |_|g'`"
>+        ;;
>+    *) 
>+        DEFINES="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`$WHOAMI`"
>+        ;;
>+    esac

MOZ_DEBUG_ENABLE_DEFS is not defined in mozilla/nsprpub/configure.in.
Perhaps the code for the default case should say:
	  DEFINES="$DEFINES -DDEBUG_`$WHOAMI`"
Just wondering:
Why is "whoami" used at all ? AFAIK the ${LOGNAME} env variable provides the
same info...
Comment on attachment 94527 [details] [diff] [review]
drop whoami for win32 & fix ldap too

In nsprpub/configure.in, I changed
	DEFINES="$MOZ_DEBUG_ENABLE_DEFS -DDEBUG_`$WHOAMI`"
to
	DEFINES="$DEFINES -DDEBUG_`$WHOAMI`"
on the tip and NSPRPUB_PRE_4_2_CLIENT_BRANCH of NSPR.

The same change needs to be made to directory/c-sdk/configure.in.
Attachment #94527 - Flags: needs-work+
wtc:
Any idea why we use "whoami" and not $LOGNAME ?
The use of "whoami" comes from the original
Netscape browser build system (ns/config/*.mk).
I don't know why it used "whoami", not $LOGNAME.
Wan-Teh Chang wrote:
> I don't know why it used "whoami", not $LOGNAME

What about killing all the "whoami" stuff and simply use $LOGNAME instead ?
FWIW, $LOGNAME is not universal either.  LOGNAME is not set when using the BeOS
version of bash.  $USER is as close as you'll get to having universal coverage
afaict and even that's not set by win32's cmd.exe.
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: