Skip to content

Canonicalize pin paths #4274

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

Merged
merged 11 commits into from
May 19, 2025
Merged

Canonicalize pin paths #4274

merged 11 commits into from
May 19, 2025

Conversation

dthaler
Copy link
Collaborator

@dthaler dthaler commented Mar 10, 2025

Description

  • Pinning related APIs should treat pin paths the same as filesystem paths and canonicalize them accordingly
  • Fix documentation error with ebpf_get_next_pinned_object_path() where the start_path cannot be null.
  • Added a test. Note that in doing so, I found and filed issue pinned_path_count is always 0 #4273 and added a TODO for that issue in the test where it should be tested.

Fixes #4239

Note: on Linux, pin paths are case sensitive, and so any programs ported from Linux may assume case sensitivity.
On Windows, it varies by filesystem, where Windows itself supports both case sensitive filesystems and case insensitive filesystems. The latter is the normal filesystem on Windows, but if we later support a BPF filesystem, we can make it be case sensitive, for ease of porting from Linux. As such, this PR uses case sensitive pin paths. This is not a change for ebpf-for-windows, which already had case-sensitive pin paths.

Testing

This PR contains associated tests.

Documentation

This PR includes a design doc added to the docs directory.

Installation

No impact.

@dthaler dthaler requested a review from lmb March 10, 2025 19:36
@dthaler dthaler changed the title Canonicalize paths Canonicalize pin paths Mar 10, 2025
Alan-Jowett
Alan-Jowett previously approved these changes Mar 11, 2025
@dthaler dthaler force-pushed the canonicalize-paths branch from 888ff28 to 8717508 Compare March 14, 2025 15:55
@dthaler dthaler force-pushed the canonicalize-paths branch 5 times, most recently from 81b2d93 to a20d9c8 Compare March 18, 2025 15:54
@dthaler dthaler requested a review from lmb March 31, 2025 15:24
@dthaler dthaler force-pushed the canonicalize-paths branch from bb70b64 to b5fc392 Compare March 31, 2025 15:28
@dthaler dthaler force-pushed the canonicalize-paths branch 3 times, most recently from 38dae0b to 180a1c9 Compare May 5, 2025 20:42
@dthaler dthaler requested review from saxena-anurag and lmb May 6, 2025 02:09
@@ -325,8 +325,8 @@ function Invoke-CICDTests
# That causes the regression test to fail. So, we are skipping this test for now.

$TestList = @(
(New-TestTuple -Test "api_test.exe" -Arguments "~`"load_native_program_invalid4`"" -Timeout 600),
(New-TestTuple -Test "bpftool_tests.exe"),
(New-TestTuple -Test "api_test.exe" -Arguments "~`"load_native_program_invalid4`" ~pinned_map_enum" -Timeout 600),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: unrelated to this PR: test case load_native_program_invalid4 has been deleted from the repo for some time now. And now that we dont run regression tests against 0.17, we can remove this exclusion of load_native_program_invalid4

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since unrelated to this PR, please file a separate issue so we can discuss it in triage meeting. :)

@saxena-anurag
Copy link
Contributor

Added a couple of minor comments. Rest looks fine.

dthaler added 10 commits May 7, 2025 07:54
Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
Don't test literal pin paths in this tool

Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
Per feedback from Anurag

Signed-off-by: Dave Thaler <dthaler1968@gmail.com>
@dthaler dthaler force-pushed the canonicalize-paths branch from 7ccd608 to 59ad375 Compare May 7, 2025 15:12
@dthaler dthaler requested a review from saxena-anurag May 7, 2025 17:59
@dthaler
Copy link
Collaborator Author

dthaler commented May 7, 2025

@saxena-anurag @lmb please re-review/approve now that I have addressed Anurag's feedback. Thanks!

@dthaler
Copy link
Collaborator Author

dthaler commented May 12, 2025

@saxena-anurag @lmb please re-review/approve now that I have addressed Anurag's feedback. Thanks!

@dthaler
Copy link
Collaborator Author

dthaler commented May 15, 2025

@Alan-Jowett or @lmb please re-review/approve now that I have addressed Anurag's feedback. Thanks!

@dthaler dthaler added this pull request to the merge queue May 19, 2025
Merged via the queue into microsoft:main with commit 4b2c370 May 19, 2025
150 of 151 checks passed
@dthaler dthaler deleted the canonicalize-paths branch May 19, 2025 16:28
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.

Pinning related APIs should treat names as paths and canonicalize them
4 participants