Skip to content

Commit

Permalink
Pass necessary environment variable via sudo.
Browse files Browse the repository at this point in the history
  • Loading branch information
nuclearsandwich committed Aug 9, 2024
1 parent 8ce4a75 commit 2c76686
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/rosdep2/platforms/pip.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,10 @@ class PipInstaller(PackageManagerInstaller):
def __init__(self):
super(PipInstaller, self).__init__(pip_detect, supports_depends=True)

# Pass necessary environment for pip functionality via sudo
if self.as_root and self.sudo_command != '':
self.sudo_command += ' --preserve-env=PIP_BREAK_SYSTEM_PACKAGES'

def get_version_strings(self):
pip_version = importlib_metadata.version('pip')
# keeping the name "setuptools" for backward compatibility
Expand Down

0 comments on commit 2c76686

Please sign in to comment.