I am planning on doing Git PR

Discussion about CodeLite development process and patches
stahta01
CodeLite Enthusiast
Posts: 14
Joined: Thu Dec 29, 2011 10:07 pm
Genuine User: Yes
IDE Question: C++
Contact:

I am planning on doing Git PR

Post by stahta01 »

I am planning on doing Git pull-request (PR) and I wish to confirm that it is best to do either dos2unix or unix2dos followed by clang-format before doing the changes I wish to do. The clang-format does a lot of changes that are hard to follow sometimes.

I have found that windows .rc files should be using CRLF; and, so far most everything else should be just LF.

I plan to do two commits for each set of changes.

  1. The reformatting using dos2unix or unix2dos followed by clang-format
  2. The code fix/change

That should allow you to see the real code change and since it is a PR you should be able to condense the two commits into one.
I hope that is easy to do; I am not sure if it is easy.

I am working on three tasks in CodeLite

  1. Fixing minor wxWidget Windows code issues like the adding of "wx/msw/wrapwin.h" to reduce possible problems and warning like "Please include winsock2.h before windows.h".

  2. Getting an MSys2 codelite package to build using wxWidgets 3.1.5 or newer. It is having linking issues related to DLL import/export naming.

  3. Improving wxconfig.exe

Tim S.

User avatar
eranif
CodeLite Plugin
Posts: 6175
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: I am planning on doing Git PR

Post by eranif »

LF line ending (UNIX style). All files should be formatted using our .clang-format file, something like:

Code: Select all

clang-format --style=file -i /path/to/source.cpp

Q: what is the wxWidgets build method you are using to build wx on MSYS2? I tried that (1-2 years ago) and it failed using the configure and the cmake methods

I would be interested in building wxWidgets on MSYS2

Make sure you have read the HOW TO POST thread
stahta01
CodeLite Enthusiast
Posts: 14
Joined: Thu Dec 29, 2011 10:07 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: I am planning on doing Git PR

Post by stahta01 »

eranif wrote: Fri May 28, 2021 10:45 am

LF line ending (UNIX style). All files should be formatted using our .clang-format file, something like:

Code: Select all

clang-format --style=file -i /path/to/source.cpp

I did like the above; but, without "--style=file" option; I will redo with that.
Are you saying you want all text files to use "LF"?
I am asking because the Windows resource files are mixed LF and CRLF and I want to fix three of them.
I was thinking doing the wxWidgets get repo way of using CRLF in Windows resource files (*.rc).
But your post stongly suggests you want LF for all text file.

eranif wrote: Fri May 28, 2021 10:45 am

Q: what is the wxWidgets build method you are using to build wx on MSYS2? I tried that (1-2 years ago) and it failed using the configure and the cmake methods

I would be interested in building wxWidgets on MSYS2

I am trying to create an MSys2 package file (PKGBUILD) that uses your codelite git repo and MSys2 wxWidgets 3.1 package.
It fails because of an long linking error; it looks to be an DLL import/export naming issue.

Looks like an library missing from link command. I just found the build line that likely showing the problem.

Code: Select all

cd /C/Users/stahta01/devel/MINGW-packages-dev/mingw-w64-codelite-git/src/build-x86_64-w64-mingw32/LiteEditor && /C/building/msys64/mingw64/bin/g++.exe -march=x86-64 -mtune=generic -O2 -pipe -ggdb -Og -fdebug-prefix-map=/c/Users/stahta01/devel/MINGW-packages-dev/mingw-w64-codelite-git/src=/usr/src/debug -Wno-deprecated-declarations -std=gnu++11 -g -O0 -fpermissive -pipe -Wl,--dynamicbase,--high-entropy-va,--nxcompat,--default-image-base-high -Wl,--whole-archive CMakeFiles/codelite.dir/objects.a -Wl,--no-whole-archive -o ../bin/codelite.exe -Wl,--out-implib,../lib/libcodelite.dll.a -Wl,--major-image-version,0,--minor-image-version,0  -LC:/building/msys64/mingw64/lib -pipe -Wl,--dynamicbase,--high-entropy-va,--nxcompat,--default-image-base-high -Wl,--subsystem,windows -mwindows -lwx_mswu_aui-3.1 -lwx_baseu-3.1 -lwx_mswu_core-3.1 -lwx_mswu_html-3.1 -lwx_mswu_propgrid-3.1 -lwx_baseu_xml-3.1 -lwx_mswu_xrc-3.1 -lwx_baseu_net-3.1 -lwx_mswu_stc-3.1 -lwx_mswu_ribbon-3.1 -lwx_mswu_richtext-3.1 -L"C:/Users/stahta01/devel/MINGW-packages-dev/mingw-w64-codelite-git/src/build-x86_64-w64-mingw32/lib" ../lib/libplugin.dll.a ../lib/libcodelite.dll.a ../lib/libwxsqlite3.dll.a -LC:/building/msys64/mingw64/lib -pipe -Wl,--dynamicbase,--high-entropy-va,--nxcompat,--default-image-base-high -Wl,--subsystem,windows -mwindows -L"C:/Users/stahta01/devel/MINGW-packages-dev/mingw-w64-codelite-git/src/build-x86_64-w64-mingw32/lib" -lsqlite3 -lssh -lws2_32 -luchardet -luxtheme -lwx_mswu_aui-3.1 -lwx_baseu-3.1 -lwx_mswu_core-3.1 -lwx_mswu_html-3.1 -lwx_mswu_propgrid-3.1 -lwx_baseu_xml-3.1 -lwx_mswu_xrc-3.1 -lwx_baseu_net-3.1 -lwx_mswu_stc-3.1 -lwx_mswu_ribbon-3.1 -lwx_mswu_richtext-3.1 -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 

The creation of the exe is overwriting the import library for the DLL.

Now, I need to see if it is a patch I wrote or the MSys2 people wrote or an cmake issue in your repo.
Edit: It looks to be a patch the MSys2 people wrote; I will skip the patch and see where it errors out.

Tim S.

User avatar
eranif
CodeLite Plugin
Posts: 6175
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: I am planning on doing Git PR

Post by eranif »

All new files should have LF. (the --style=file means to use the settings from the .clang-format file )
I have no problems with fixing the line endings in the resource files (they are rarely touched)

Make sure you have read the HOW TO POST thread
stahta01
CodeLite Enthusiast
Posts: 14
Joined: Thu Dec 29, 2011 10:07 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: I am planning on doing Git PR

Post by stahta01 »

clang-format does a very poor job on the CMakeLists.txt files; so, I will only be doing dos2unix on them.

I have still not gotten CodeLite (Git repo) MSYs2 package to build using wxWidgets 3.1.5; but, I am making progress.

Tim S.

stahta01
CodeLite Enthusiast
Posts: 14
Joined: Thu Dec 29, 2011 10:07 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: I am planning on doing Git PR

Post by stahta01 »

I have gotten CodeLite (Git repo) MSYs2 package to build using wxWidgets 3.1.5;
I am now skipping patches that I believe is not needed to get a good build.

I did a simple cmake PR https://github.com/eranif/codelite/pull/2743 that fixes two old problems and the new one that was triggered by building with wxWidgets 3.1.5. I have no idea how wxWidgets triggered this build/link error.

My next PR is going to be on the 4 windows RC files that give duplicate value warnings.

Tim S.

User avatar
eranif
CodeLite Plugin
Posts: 6175
Joined: Wed Feb 06, 2008 9:29 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: I am planning on doing Git PR

Post by eranif »

thanks. will check this.

FYI: because you brought this up, I played with MYS2 installation of wxWidgets and I saw (I was not aware of that) that they provide mingw64 compiler + wxWidgets builds (3.1.3) that can be used from simple CMD terminal.
The problem is that the wx-config that they provide is bash script that can not work with the CMD terminal (it also does not support --rcflags)

The wx-config that comes with CodeLite can not work MSYS2 installation of wxWidgets (different layout etc)
So I wrote a new wx-config-msys2 executable which basically allows you to use CodeLite + MSYS2 installation of wxWidgets

https://github.com/eranif/wx-config-msys2

Make sure you have read the HOW TO POST thread
stahta01
CodeLite Enthusiast
Posts: 14
Joined: Thu Dec 29, 2011 10:07 pm
Genuine User: Yes
IDE Question: C++
Contact:

Re: I am planning on doing Git PR

Post by stahta01 »

Link to my CodeLite MSys2 Package https://github.com/stahta01/MINGW-packa ... delite-git

Edit: Add direct link to build file https://github.com/stahta01/MINGW-packa ... t/PKGBUILD

I will look at the wx-config-msys2 repo. Thank you for it.

Tim S.

Post Reply