Skip to content

Conversation

wittrock
Copy link
Contributor

@wittrock wittrock commented Jun 6, 2025

For projects which use upward relative paths (../<path>), the existing PathCleaner logic was insufficient. Particularly, it would output absolute paths for inputs which were specified as ../, which meant that later indexing would fail, as the arguments field likely referred to those inputs by their relative paths.

We address this with two fixes:

  1. PathCleaner now preserves (does not modify) a relative path if it starts with ../
  2. FindStableRoot now outputs the current working directory if any arguments start with ../

Many thanks to @shahms for his advice on this set of changes.

Test: Added unit tests, also verified manually that this gets the Fuchsia indexing pipeline working again
Fixes #6181

For projects which use upward relative paths (`../<path>`), the
existing PathCleaner logic was insufficient. Particularly, it would
output absolute paths for inputs which were specified as ../<path>,
which meant that later indexing would fail, as the `arguments` field
likely referred to those inputs by their relative paths.

We address this with two fixes:

1. PathCleaner now preserves (does not modify) a relative path if it
   starts with ../
2. FindStableRoot now outputs the current working directory if any
   arguments start with ../

Many thanks to @shahms for his advice on this set of changes.

Test: Added unit tests
Fixes kythe#6181
@wittrock wittrock force-pushed the cxx-extractor-path-tweaks-v3 branch from b54a63a to 8481449 Compare June 6, 2025 21:12
@varunmahajan
Copy link
Contributor

/gcbrun

@varunmahajan varunmahajan self-assigned this Jun 9, 2025
@varunmahajan varunmahajan merged commit b599b42 into kythe:master Jun 9, 2025
4 checks passed
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.

cxx_extractor: Upward-relative paths for source files not preserved
3 participants