-
Notifications
You must be signed in to change notification settings - Fork 904
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 CLN service startup failure by trimming trailing spaces in config parameters #7251
Fix CLN service startup failure by trimming trailing spaces in config parameters #7251
Conversation
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.
Thanks for this, looks good to me
I was wondering if it is possible move this trim
function inside tal string https://github.com/rustyrussell/ccan/blob/master/ccan/tal/str/str.h
Do you mean to also change the function to use tal for allocating memory for the lines then? I thought it was not necessary since they were already allocated, but I can of course fix that if it is desirable. @vincenzopalazzo |
No I mean to have like |
Pardon me, but I don't fully understand what you mean. Could you elaborate on your suggestion? To my understanding, the |
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.
Nice PR! It's a neat solution to the problem. I agree with Vincenzo - so long as a ccan library is being modified, it would be nice to go ahead and trim the leading whitespace too and resize the buffer (which would make this a tal/str operation). It's not a significant difference in this case, but it could be more useful for the library. I'm okay with either approach.
Thanks for the comment @endothermicdev, I'll start doing a strtrim function in tal tomorrow if you both think that is more useful then 👍 |
a1f61f0
to
73363f8
Compare
@vincenzopalazzo & @endothermicdev , I've now changed to using |
e0cbfa2
to
3c829f0
Compare
@endothermicdev I am having some issues with tests on my local machine using |
3c829f0
to
22314d3
Compare
The local test I have tried is to add a space after a config varible in the |
c8b062d
to
9504f5d
Compare
If someone could have a look at the pytest and tell me if something is wrong in it, that would be appreciated. |
Hi @maxrantil sorry this has been so long before I review! The concept is great, the implementation needs some work though. There are a few config options where we don't want to trim whitespace. In particular,
Thanks! |
Hi @rustyrussell , |
0cd4f10
to
bb11af4
Compare
8205779
to
7ef7407
Compare
@rustyrussell or @endothermicdev , do you find it acceptable to manipulate a |
Given how close we are to rc1, I simply added a commit with various cleanups. Thanks for this work! |
Signed-off-by: Max Rantil <rantil@pm.me>
1) We can't simply cast away const to manipulate a string, the compiler can assume we don't. The type must be made non-const. 2) cisspace() is nicer to use than isspace() (no cast required!) 3) Simply place a NUL terminator instead of using memmove to set it. 4) Use cast_const to add const to char **, where necessary. 5) Add Changelog line, for CHANGELOG.md Changelog-Fixed: Config: whitespace at the end of (most) options is now ignored, not complained about. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
3bc3f0b
to
2a234b2
Compare
That's fine @rustyrussell ! I learned some new things from studying your changes. I'm not sure how to fix the error in the test that is failing now, tho. |
THose issues were from master, fortunately! |
Is there any chance of getting the sphinx bounty of 100k sats for this? 😊 I can't get Sphinx Chat to work with Core lightning on my umbrel node. Is there another way to get the payout if i am eligible for it? |
DM sent to @max54302324 |
fixes #7132
I would really appreciate some friendly feedback on this, as it is my first PR to the project and I might have misunderstood or missed important details.
I did find a similar functionstrip_trailing_whitespace
inplugins/bcli.c
, but from what I understand, havingvoid trim_trailing_spaces(char *str);
inccan
would still be beneficial, right?