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

lightningd: test finding plugins path #7624

Closed

Conversation

Lagrang3
Copy link
Collaborator

@Lagrang3 Lagrang3 commented Aug 29, 2024

Description

Adds unit test to function relative that is used to compute the path to locate the builtin plugins and subdaemons.

Related Issues

It follows after #7618

@Lagrang3 Lagrang3 requested a review from rustyrussell August 29, 2024 08:20
@Lagrang3 Lagrang3 force-pushed the add-test-find-plugins branch 3 times, most recently from cd5d101 to 50b95c6 Compare August 29, 2024 10:23
Changelog-None.

Signed-off-by: Lagrang3 <[email protected]>
@Lagrang3 Lagrang3 force-pushed the add-test-find-plugins branch from 50b95c6 to 15d7416 Compare August 29, 2024 11:00
@Lagrang3 Lagrang3 added this to the v24.11 milestone Oct 29, 2024
@rustyrussell
Copy link
Contributor

We don't use path_simplify because it requires the path exist. Pretty sure I tried to make this change before and discovered I had broken things!

In fact, see the last commit message:

    And we can't use path_rel, because that requires that the path
    exist (thanks @Lagrang3!).

You were the one who pointed this out?

@Lagrang3
Copy link
Collaborator Author

Lagrang3 commented Nov 18, 2024

I think I said one couldn't use path_rel from ccan because it was relying on a kernel function realpath that in turns
requires the path to exist.
path_simplify on the other hand only calls lstat to do something (not sure exactly what) with symlinks. But it seems fine
if the path does not exist.
I'll double check this. But the tests seem to work.

UPD. path_simplify would not work correctly if the path does not exist, for example
path_simplify("/fakedir/..") yields /fakedir instead of /
and path_simplify("/fakedir/../..") triggers an assertion.

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.

2 participants