Projects
New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Ticket #16010 (closed defect: fixed)

Opened 5 months ago

Last modified 4 weeks ago

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@…
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

Changed 5 months ago by blb@…

  • keywords tcl environment added
  • summary changed from db-4.4.20 fails to patch on a system which uses a local perforce repository to Port environment not properly cleared due to Tcl env bug causing patch to try perforce
  • component changed from ports to base
  • milestone changed from Port Bugs to MacPorts base bugs

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.

Changed 4 months ago by blb@…

  • cc blb@… added

Cc Me!

Changed 4 months ago by afb@…

  • keywords leopard added
  • summary changed from Port environment not properly cleared due to Tcl env bug causing patch to try perforce to Port 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 ?

Changed 4 months 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).

Changed 4 months ago by ryandesign@…

  • cc ryandesign@… added

Changed 4 months ago by afb@…

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

Changed 4 weeks ago by blb@…

  • status changed from new to closed
  • resolution set to fixed
  • milestone changed from MacPorts base bugs to MacPorts 1.7.0

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

Note: See TracTickets for help on using tickets.