celestia-node icon indicating copy to clipboard operation
celestia-node copied to clipboard

feat: Improve Windows compatibility.

Open HoytRen opened this issue 2 years ago • 10 comments

closes #2189

We could run build.ps1 to build executables for Windows now.

However the lint and test have some problems, I don't think it's my fault. Let me simply create the PR because merging the new commits again and again is boring work.

HoytRen avatar Jun 27 '23 01:06 HoytRen

Codecov Report

Attention: Patch coverage is 34.21053% with 25 lines in your changes are missing coverage. Please review.

Project coverage is 44.78%. Comparing base (c1ab9c5) to head (7ba89a4). Report is 24 commits behind head on main.

Files Patch % Lines
nodebuilder/config.go 22.22% 12 Missing and 2 partials :warning:
nodebuilder/init.go 30.00% 6 Missing and 1 partial :warning:
libs/keystore/fs_keystore.go 33.33% 0 Missing and 2 partials :warning:
libs/keystore/key_access_unix.go 66.66% 1 Missing and 1 partial :warning:
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2403      +/-   ##
==========================================
- Coverage   52.08%   44.78%   -7.31%     
==========================================
  Files         183      264      +81     
  Lines       11594    14603    +3009     
==========================================
+ Hits         6039     6540     +501     
- Misses       5043     7313    +2270     
- Partials      512      750     +238     

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

codecov-commenter avatar Jun 27 '23 03:06 codecov-commenter

hi @HoytRen - thanks for this PR! I think that the failing tests may be because the linting logic on main doesn't have potential changes needed to support linting for the windows build feature.

i plan to use this build pipeline to add windows support for a desktop application, so thanks again for the PR!

would you be able to rebase this PR?

jcstein avatar Jul 31 '23 09:07 jcstein

thanks @HoytRen - i'd like to test this out. can you please give me instructions on how to build this on windows?

jcstein avatar Jul 31 '23 14:07 jcstein

Hi @jcstein, I put a .ps1 file in the root folder, you could simply execute it in powershell without any parameters, it will buid celestia and cel-key binary into build/ folder. But you may need to enable ps scripts first by execute 'set-executionpolicy remotesigned' in powershell. If you don't like to enable script, simply copy paste the commands in the script to powershell.

Sure, you must install Go for Win first, and maybe other prerequests that I'm not sure. Just let me know if you can't get through.

I rebased the commits, but I don't like it because it destoried all my local history, and the process is a little triky that I almost resolved all comflicts again however I already did it long ago.

Had you tried squash-merge feature for PR on github? It create a new commit that rollup all contributer's commit into one so that don't mess up your main branch. I believe it's much friendly to contributers since they even don't need to know your convention of commit. This is the recommended approch of github official team.

HoytRen avatar Jul 31 '23 17:07 HoytRen

Hi @jcstein, I updated this PR again with the latest main. Tested on both Win and Linux on arabica-10.

HoytRen avatar Sep 11 '23 03:09 HoytRen

cc @celestiaorg/celestia-node for visibility to review this! thank you @HoytRen

jcstein avatar Sep 11 '23 14:09 jcstein

We will need to look into the new fslock dependency introduced. How maintained is it and what features provide. In general, it's ok to remove our custom code to maintain less

Wondertan avatar Sep 13 '23 15:09 Wondertan

fslock got updated a few days ago, it's still in maintenance. but the update isn't relative to us, so I don't import it.

HoytRen avatar Sep 14 '23 01:09 HoytRen

I just checkout on your branch, and it works well

Wondertan avatar Oct 26 '23 16:10 Wondertan

I bump fslock component to the latest version so that compiles with new go version.

HoytRen avatar Mar 06 '24 03:03 HoytRen

Hey @HoytRen. After careful investigation, we migrated over to a different fslock library, which supports windows as well. We should stick to it in this PR as well.

Wondertan avatar Mar 26 '24 14:03 Wondertan

Hey @Wondertan, happy to hear that. As I tried, the main branch works on Windows currently. Then, let me close this PR.

HoytRen avatar Mar 27 '24 06:03 HoytRen