Opened 8 years ago

Closed 7 years ago

#2320 closed defect (fixed)

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 (5)

comment:1 Changed 8 years 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 8 years ago by dustin

  • Milestone changed from undecided to 0.8.+

comment:3 Changed 7 years 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 7 years ago by bdbaddog

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

comment:5 Changed 7 years ago by bdbaddog

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

Fixed checked and pull request sent:

Change is: 17c00be0c01f48b4c3fd15c662c950d1189019f5

Note: See TracTickets for help on using tickets.