Opened 16 years ago

Closed 16 years ago

#16010 closed defect (fixed)

Port environment not properly cleared due to Leopard's Tcl env bug causing patch to try perforce

Reported by: gboyce@… Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 1.7.0
Component: base Version: 1.6.0
Keywords: tcl environment leopard Cc: blb@…, ryandesign (Ryan Carsten Schmidt)
Port:

Description

My company utilizes Perforce as a revision control system, and it appears that port attempts to synchronize a file from our local perforce server when attempting to build db44.

Clearing my P4CONFIG and P4PORT variables allows the build to function properly.

--

---> Fetching db44 ---> Attempting to fetch db-4.4.20.tar.gz from http://download-west.oracle.com/berkeley-db/ ---> Verifying checksum(s) for db44 ---> Extracting db44 ---> Applying patches to db44 Error: Target org.macports.patch returned: shell command " cd "/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_databases_db44/work/db-4.4.20" && patch -p0 < '/opt/local/var/macports/distfiles/db44/patch.4.4.20.1'" returned error 2 Command output: Get file qam/qam_files.c from Perforce with lock? [y] Perforce client error:

Connect to server failed; check $P4PORT. TCP connect to perforce:1666 failed. connect: perforce:1666: Connection refused

patch: Can't get file qam/qam_files.c from Perforce

Error: The following dependencies failed to build: openldap db44 perl5.8 python24 Error: Status 1 encountered during processing.

Change History (7)

comment:1 Changed 16 years ago by blb@…

Component: portsbase
Keywords: tcl environment added
Milestone: Port BugsMacPorts base bugs
Summary: db-4.4.20 fails to patch on a system which uses a local perforce repositoryPort environment not properly cleared due to Tcl env bug causing patch to try perforce

This is an interesting edge case of the Tcl env bug (ticket #13930). Namely, even though port clears the environment of those P4* variables, they are still set to a blank string (the Tcl env bug itself), and apparently even when set only to "", patch tries to access perforce.

I'm able to fix this by using afb's unsetenv function, but that requires the package require Pextlib 1.0 in macports.tcl (proc mportinit) to be moved up prior to handling the environment, since unsetenv is in Pextlib.

comment:2 Changed 16 years ago by blb@…

Cc: blb@… added

Cc Me!

comment:3 Changed 16 years ago by afb@…

Keywords: leopard added
Summary: Port environment not properly cleared due to Tcl env bug causing patch to try perforcePort environment not properly cleared due to Leopard's Tcl env bug causing patch to try perforce

So using the new base (from trunk) fixes this issue ?

comment:4 Changed 16 years ago by blb@…

The current workaround in trunk doesn't seem to fix this one, so I had to use your unsetenv also in mportinit (at line 667. After that, the env was properly cleaned (it seems to happen earlier than the typical occurrence of the Tcl env bug).

comment:5 Changed 16 years ago by ryandesign (Ryan Carsten Schmidt)

Cc: ryandesign@… added

comment:6 Changed 16 years ago by afb@…

Fix applied in r39016, after Pextlib 1.0 has been loaded.

comment:7 Changed 16 years ago by blb@…

Milestone: MacPorts base bugsMacPorts 1.7.0
Resolution: fixed
Status: newclosed

Closing since this'll be in 1.7.0 and was fixed for that by afb@.

Note: See TracTickets for help on using tickets.