Ticket #2320 (closed defect: fixed)

Opened 11 months ago

Last modified 6 weeks ago

P4Source: ignore PATH

Reported by: sanxiyn Owned by: bdbaddog
Priority: patches-accepted Milestone: 0.8.+
Version: 0.8.6p1 Keywords: p4
Cc: bdbaddog

Description

P4Source's p4bin defaults to "p4", and the manual says "You only need to do this if the perforce binary is not in the path of the buildbot user". This is currently not the case.

P4Source sanitizes environment to include P4* variables and ultimately calls os.execvpe. But "When the environment is being replaced, the new environment is used as the source of the PATH variable" (Python Library Reference). PATH is not included in the sanitized environment.

The end result is that you get an error if your perforce binary is installed at /opt/bin/p4, even if /opt/bin is in PATH. How did this work at all? Because execvpe defaults to confstr(_CS_PATH) if PATH can't be found...

Change History

comment:1 Changed 11 months ago by dustin

  • Cc bdbaddog added

So we should not be sanitizing PATH when running p4.

Bill, can you take a look?

comment:2 Changed 11 months ago by dustin

  • Milestone changed from undecided to 0.8.+

comment:3 Changed 4 months ago by tom.prince

  • Owner set to bdbaddog
  • Priority changed from major to patches-accepted
  • Status changed from new to assigned

This should be handled in the new master-side P4 step, if appropriate, otherwise closed.

comment:4 Changed 4 months ago by bdbaddog

Should be in the P4source I believe. I'll take a look while I'm looking at 2321.

comment:5 Changed 6 weeks ago by bdbaddog

  • Status changed from assigned to closed
  • Resolution set to fixed

Fixed checked and pull request sent:

Change is: 17c00be0c01f48b4c3fd15c662c950d1189019f5

Note: See TracTickets for help on using tickets.