Skip to content
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 erroneous relative path resolution #726

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

ivanvig
Copy link

@ivanvig ivanvig commented Jan 24, 2025

Currently FuseSoC has two problems related to relative path resolution,

The more severe one occurs when the fusesoc.conf file is in the current directory, in that case the code

files_read = self._cp.read(config_files)

returns only the file name, then in the function _resolve_path_from_cfg when os.path.dirname is called, an empty string is returned and when joined to form the final path we get a broken result

A second issue that I found is when referencing to a relative path starting with a dot, for example ./build_root that dot stays in the path producing a result like /abs/path/to/./build_root which although is a valid path, fails path comparisons, like the ones that are done for ignored_dirs

This PR includes tests for both cases and fixes them.

Fixed wrong path resolution when fusesoc.conf file is in current dir,
also improved path resolution to avoid erros when comparing paths
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant