-
Notifications
You must be signed in to change notification settings - Fork 486
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
Fix usage of relative paths with environment variables #2890
Conversation
Signed-off-by: Louise Poubel <louise@openrobotics.org>
If I understand this correctly, the priority of the paths to search would change from previous releases, where environment variables + relative names where the only option and now it will check for absolute path and afterwards will fallback to the previous behavior. Is this correct? In that case, I think we could find some regressions due to some scenarios where resources use the same name. Changing the order of checking would make sense? |
So, this is the situation:
I'd have to think of a way of doing this, it wouldn't be trivial with the current architecture. But in any case, I think that checking relative to the file first is the behavior that users may expect, and it follows the order explained in the Finding resources design document. |
Sounds good to me. The problem of fixing behavior/features in minor releases is that can change current results from previous versions of the same major serie. The PR solves the situation introduced in |
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.
It's hard to detect failures related these specific changes in the set of failing tests but I can not detect any regression looking at the latest gazebo11 branch CI builds.
Yeah I'll add a note as I merge to prevent CI being retriggered here 👍 |
Signed-off-by: Louise Poubel <louise@openrobotics.org>
I noticed that some tests started failing since #2765, such as UNIT_Actor_TEST:
UNIT_Actor_TEST failure
That's a use case for relative paths that I overlooked on the other pull request. Resources could be found with paths relative to environment variables like
GAZEBO_RESOURCE_PATH
andGAZEBO_MODEL_PATH
. But when I added the conversion to full paths relative to the SDF file, I didn't give Gazebo a chance to also look for the files relative to those environment variables.This PR changes the
asFullPath
function to only return the full path in case it exists on disk. This allows the search to continue using the environment variable in case there's no matching file relative to the SDF.I changed some worlds to more robust URIs, but left some others to make sure those use cases still work.