lighthouse
lighthouse copied to clipboard
feat(scripts): fix bug about `sed -i`
Issue Addressed
Which issue # does this PR address?
appear error when run ./setup_time.sh genesis.json:
grep: invalid option -- Psed: 1: "genesis.json": extra characters at the end of g command- typo:
taifinscripts/local_testnet/README.md - The lost of
--debug-levelflag inbootnode.sh - Avoid using GNU sed/grep in macOS system.
Proposed Changes
Please list or describe the changes introduced by this PR.
Additional Info
Please provide any additional information. For example, future considerations or information useful for reviewers.
which OS are you using where it didn't work? AFAIK our scripts are working on Linux and macOS. Are you using a BSD?
which OS are you using where it didn't work? AFAIK our scripts are working on Linux and macOS. Are you using a BSD?
My OS is macOS m3.
which OS are you using where it didn't work? AFAIK our scripts are working on Linux and macOS. Are you using a BSD?
On mac you need to install gnu sed and gnu grep to run these scripts. If these changes work for linux an mac out of the box, it'd be nice.
@mask-pp would you mind signing the CLA?
@mask-pp would you mind signing the CLA?
Done!
Thanks for the PR, left some comments
Thanks very much for your review man.
Thanks for the PR, left some comments
Thanks very much for your review man.
I am good with the proposed change since it does the same thing, and it will be good for other users using MacOS trying to run a local testnet using the scripts. So I am happy to recommend merging this PR.
Thanks again!
Edit: how about the change in bootnode logs from to setup.sh: https://github.com/sigp/lighthouse/pull/5169#discussion_r1576198261
It is not a major thing, but may I know the motivation behind? I think that should work on MacOS? If so, we can remain that part the same
Thanks for the PR, left some comments
Thanks very much for your review man.
I am good with the proposed change since it does the same thing, and it will be good for other users using MacOS trying to run a local testnet using the scripts. So I am happy to recommend merging this PR.
Thanks again!
Edit: how about the change in bootnode logs from to setup.sh: #5169 (comment)
It is not a major thing, but may I know the motivation behind? I think that should work on MacOS? If so, we can remain that part the same
Yeah, the bootnode change is optional. It is correct to write the bootnode log into bootnode.log. In order to reduce unnecessary changes I have reverted it.
Thanks @mask-pp
This seems to be a cleaner solution to enable MacOS to work with the script with sed -i: https://www.reddit.com/r/linux4noobs/comments/ne0ti8/why_does_sed_i_not_work_on_my_mac/
Could you give this a try and see if it works? If so, I can test linux on my end and we can use this cleaner solution
Thanks @mask-pp
This seems to be a cleaner solution to enable MacOS to work with the script with
sed -i: https://www.reddit.com/r/linux4noobs/comments/ne0ti8/why_does_sed_i_not_work_on_my_mac/Could you give this a try and see if it works? If so, I can test linux on my end and we can use this cleaner solution
It works with sed -i '' in macOS, but it doesn't work in linux.
The best way I can imagine to be compatible with mac and linux is don't use the parameter "-i".
Thanks for this PR!
I also noticed that we need to remove these lines from local-testnet.yml to avoid using GNU sed/grep in CI for macOS:
https://github.com/sigp/lighthouse/blob/8cd2b1ca87a7bf660130279558ed5dd9e91dda75/.github/workflows/local-testnet.yml#L42-L47
and the README in the local_testnet directory:
https://github.com/sigp/lighthouse/blob/003bb0ae3cc41e082c1e5462cfcd9341a4785bfc/scripts/local_testnet/README.md#L11
Deleted.
I am not sure why we need to delete the line on the README.md file? @ackintosh
As for the local-testnet.yml, does #5643 fix it?
I am not sure why we need to delete the line on the README.md file? @ackintosh
If my understanding of this PR is correct, it eliminates the need for macOS users to install GNU sed/grep. They can now run start_local_testnet.sh using the built-in sed/grep commands. So the line in the README.md that encourages macOS users to install GNU sed/grep can be removed.
Thanks @mask-pp, LGTM.
Could you please update the
Proposed Changessection of this comment?
changed.
Thank you so much for your contribution @mask-pp, but we recently replaced our local testnet scripts with kurtosis
- https://github.com/sigp/lighthouse/pull/5865