-
Notifications
You must be signed in to change notification settings - Fork 171
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow full configuration of the cache directories used by rosdep via environment variable, deprecate --sources-cache-dir #908
Open
peci1
wants to merge
8
commits into
ros-infrastructure:master
Choose a base branch
from
peci1:update-config-cache
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
d5cc842
Support --sources-cache-dir option for the update command.
peci1 fd7bb5f
Add --meta-cache-dir option and ROSDEP_CACHE_PATH env variable.
peci1 0141233
Documented ROSDEP_CACHE_PATH and ROSDEP_SOURCE_PATH.
peci1 efd7094
Deprecate `-c` and `-m` command line options and use `ROSDEP_CACHE_PA…
peci1 da134a7
fix ci: test_rosdep_catkin_support.py
267cf6a
Add info about sudo --preserve-env option.
peci1 25e5924
Merge remote-tracking branch 'SubaruArai/fix/ci_rosdep_catkin_support…
peci1 df842ec
Fixed issues from review, added a test for conflicting ROSDEP_CACHE_P…
peci1 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
#autogenerated by rosdep, do not edit. use 'rosdep update' instead |
4 changes: 4 additions & 0 deletions
4
test/meta.cache/5c57306d8ea9d8eec9db440c6e9937664e0159b5.pickle
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#autogenerated by rosdep, do not edit. use 'rosdep update' instead | ||
yaml https://github.com/ros/rosdistro/raw/master/rosdep/base.yaml | ||
yaml https://github.com/ros/rosdistro/raw/master/rosdep/python.yaml | ||
gbpdistro https://github.com/ros/rosdistro/raw/master/releases/fuerte.yaml fuerte |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,50 @@ | ||
from rosdep2.catkin_support import get_installer, get_catkin_view, ValidationFailed, resolve_for_os | ||
|
||
from rosdep2.platforms.debian import APT_INSTALLER | ||
from rosdep2.cache_tools import CACHE_PATH_ENV | ||
from rosdep2.sources_list import SOURCE_PATH_ENV | ||
import pytest | ||
import os | ||
from tempfile import mkdtemp | ||
|
||
|
||
def get_test_dir(): | ||
return os.path.abspath(os.path.dirname(__file__)) | ||
|
||
|
||
def get_cache_dir(): | ||
# get_catkin_view calls update(), so we need a writable location | ||
return mkdtemp() | ||
|
||
|
||
def get_source_list_dir(): | ||
p = os.path.join(get_test_dir(), "sources.list.d.good") | ||
assert os.path.isdir(p) | ||
return p | ||
|
||
|
||
@pytest.mark.online | ||
def test_workflow(): | ||
old_cpe = os.getenv(CACHE_PATH_ENV, None) | ||
old_spe = os.getenv(SOURCE_PATH_ENV, None) | ||
try: | ||
os.environ[CACHE_PATH_ENV] = get_cache_dir() | ||
os.environ[SOURCE_PATH_ENV] = get_source_list_dir() | ||
installer = get_installer(APT_INSTALLER) | ||
view = get_catkin_view('fuerte', 'ubuntu', 'lucid') | ||
resolved = resolve_for_os('cmake', view, installer, 'ubuntu', 'lucid') | ||
view = get_catkin_view('noetic', 'ubuntu', 'focal') | ||
resolved = resolve_for_os('cmake', view, installer, 'ubuntu', 'focal') | ||
assert ['cmake'] == resolved | ||
resolved = resolve_for_os('python', view, installer, 'ubuntu', 'lucid') | ||
assert resolved == ['python-dev'] | ||
resolved = resolve_for_os('python3', view, installer, 'ubuntu', 'focal') | ||
assert resolved == ['python3-dev'] | ||
except ValidationFailed: | ||
# tests fail on the server because 'rosdep init' has not been run | ||
pass | ||
finally: | ||
if old_cpe is None: | ||
del os.environ[CACHE_PATH_ENV] | ||
else: | ||
os.environ[CACHE_PATH_ENV] = old_cpe | ||
if old_spe is None: | ||
del os.environ[SOURCE_PATH_ENV] | ||
else: | ||
os.environ[SOURCE_PATH_ENV] = old_spe |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer that an "invalid" custom path produce an error rather than falling back to the default since that's probably not what the user intends if they're setting this value in the first place.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a behavior this PR hasn't touched. It might seem a bit unfortunate, but I fear changing it, as this behavior has been there for 9 years already.
The env var behaves as a path list. If at least one path from it exists, it is used. If it is empty or all paths do not exist, the system default is used.