Author Topic: build bot in the github, I see one nice project  (Read 63002 times)

Offline Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 107
  • Where there is a will, there is a way.
Re: build bot in the github, I see one nice project
« Reply #45 on: September 21, 2024, 01:00:34 pm »
Hi, it's been several weeks since my last visit to CB Forums! Glad to see that you have successfully made those dependencies copied! Now, we can use the automatically built CB packages in time on Windows machines.
Maybe there's another idea. If 'arnholm' can set up a webhook that sends a message to our repository each time a commit is given, we can just achieve full automation! Just my guess...
« Last Edit: September 21, 2024, 01:02:41 pm by Grit Clef »
-Windows 7, 32-bit
-CodeBlocks r13542, gcc 14.2.0, debug version

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6064
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: build bot in the github, I see one nice project
« Reply #46 on: September 21, 2024, 02:00:39 pm »
Hi, it's been several weeks since my last visit to CB Forums! Glad to see that you have successfully made those dependencies copied! Now, we can use the automatically built CB packages in time on Windows machines.
Maybe there's another idea. If 'arnholm' can set up a webhook that sends a message to our repository each time a commit is given, we can just achieve full automation! Just my guess...

There are still some problem remains:

1, the cblauncher.exe is not built, I need that file.
2, I need to find a way to make the github action generated file (artifact file) to the release page, so it could be: "release 2024-09-21" for a release, maybe some file rename or other option is needed.

About the webhook, I have many own patches in my git repo, so when a webhook happens, I have to still need "git rebase". It is a bit complex.  :(
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6064
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: build bot in the github, I see one nice project
« Reply #47 on: September 21, 2024, 04:27:19 pm »
When I looked at the build log file of the github action:

https://github.com/asmwarrior/x86-codeblocks-builds/actions/runs/10955598063/job/30419828477

You can download that log file.

I see that

Code
2024-09-20T09:18:04.7820971Z make[4]: Entering directory '/d/a/x86-codeblocks-builds/x86-codeblocks-builds/codeblocks_sfmirror/src/tools/cb_share_config'
2024-09-20T09:18:04.8036409Z  /usr/bin/mkdir -p '/opt/codeblocks/bin'
2024-09-20T09:18:04.8174063Z  /usr/bin/mkdir -p '/opt/codeblocks/share/man/man1'
2024-09-20T09:18:04.8805600Z   /bin/sh ../../../libtool   --mode=install /usr/bin/install -c cb_share_config.exe '/opt/codeblocks/bin'
2024-09-20T09:18:04.9105299Z  /usr/bin/install -c -m 644 cb_share_config.1 '/opt/codeblocks/share/man/man1'
2024-09-20T09:18:05.2304536Z libtool: install: /usr/bin/install -c .libs/cb_share_config.exe /opt/codeblocks/bin/cb_share_config.exe
2024-09-20T09:18:05.2454246Z make[4]: Leaving directory '/d/a/x86-codeblocks-builds/x86-codeblocks-builds/codeblocks_sfmirror/src/tools/cb_share_config'
2024-09-20T09:18:05.2461699Z make[3]: Leaving directory '/d/a/x86-codeblocks-builds/x86-codeblocks-builds/codeblocks_sfmirror/src/tools/cb_share_config'
2024-09-20T09:18:05.2469742Z Making install in ConsoleRunner
2024-09-20T09:18:05.2646492Z make[3]: Entering directory '/d/a/x86-codeblocks-builds/x86-codeblocks-builds/codeblocks_sfmirror/src/tools/ConsoleRunner'
2024-09-20T09:18:05.2647480Z depbase=`echo main.o | sed 's|[^/]*$|.deps/&|;s|\.o$||'`;\
2024-09-20T09:18:05.2648537Z g++ -DHAVE_CONFIG_H -I. -I../../../src/include  -D__WXMSW__ -DCB_AUTOCONF  -DPIC   -O2 -ffast-math  -fPIC -fexceptions -MT main.o -MD -MP -MF $depbase.Tpo -c -o main.o main.cpp &&\
2024-09-20T09:18:05.2649417Z mv -f $depbase.Tpo $depbase.Po
2024-09-20T09:18:06.4095587Z /bin/sh ../../../libtool  --tag=CXX   --mode=link g++  -O2 -ffast-math  -fPIC -fexceptions  -Wl,--no-undefined  -o cb_console_runner.exe main.o  -lpthread
2024-09-20T09:18:06.9737518Z libtool: link: g++ -O2 -ffast-math -fPIC -fexceptions -Wl,--no-undefined -o .libs/cb_console_runner.exe main.o  -lpthread
2024-09-20T09:18:07.7308153Z make[4]: Entering directory '/d/a/x86-codeblocks-builds/x86-codeblocks-builds/codeblocks_sfmirror/src/tools/ConsoleRunner'
2024-09-20T09:18:07.7514147Z  /usr/bin/mkdir -p '/opt/codeblocks/bin'
2024-09-20T09:18:07.7644088Z  /usr/bin/mkdir -p '/opt/codeblocks/share/man/man1'
2024-09-20T09:18:07.8263028Z   /bin/sh ../../../libtool   --mode=install /usr/bin/install -c cb_console_runner.exe '/opt/codeblocks/bin'
2024-09-20T09:18:07.8584054Z  /usr/bin/install -c -m 644 cb_console_runner.1 '/opt/codeblocks/share/man/man1'
2024-09-20T09:18:08.1826953Z libtool: install: /usr/bin/install -c .libs/cb_console_runner.exe /opt/codeblocks/bin/cb_console_runner.exe
2024-09-20T09:18:08.1973674Z make[4]: Leaving directory '/d/a/x86-codeblocks-builds/x86-codeblocks-builds/codeblocks_sfmirror/src/tools/ConsoleRunner'
2024-09-20T09:18:08.1982839Z make[3]: Leaving directory '/d/a/x86-codeblocks-builds/x86-codeblocks-builds/codeblocks_sfmirror/src/tools/ConsoleRunner'
2024-09-20T09:18:08.1990374Z Making install in CBLauncher
2024-09-20T09:18:08.2155613Z make[3]: Entering directory '/d/a/x86-codeblocks-builds/x86-codeblocks-builds/codeblocks_sfmirror/src/tools/CBLauncher'
2024-09-20T09:18:08.2299718Z make[4]: Entering directory '/d/a/x86-codeblocks-builds/x86-codeblocks-builds/codeblocks_sfmirror/src/tools/CBLauncher'
2024-09-20T09:18:08.2301338Z make[4]: Nothing to be done for 'install-exec-am'.
2024-09-20T09:18:08.2302245Z make[4]: Nothing to be done for 'install-data-am'.
2024-09-20T09:18:08.2303972Z make[4]: Leaving directory '/d/a/x86-codeblocks-builds/x86-codeblocks-builds/codeblocks_sfmirror/src/tools/CBLauncher'
2024-09-20T09:18:08.2306123Z make[3]: Leaving directory '/d/a/x86-codeblocks-builds/x86-codeblocks-builds/codeblocks_sfmirror/src/tools/CBLauncher'
2024-09-20T09:18:08.2470671Z make[3]: Entering directory '/d/a/x86-codeblocks-builds/x86-codeblocks-builds/codeblocks_sfmirror/src/tools'
2024-09-20T09:18:08.2612747Z make[4]: Entering directory '/d/a/x86-codeblocks-builds/x86-codeblocks-builds/codeblocks_sfmirror/src/tools'
2024-09-20T09:18:08.2614203Z make[4]: Nothing to be done for 'install-exec-am'.
2024-09-20T09:18:08.2615091Z make[4]: Nothing to be done for 'install-data-am'.
2024-09-20T09:18:08.2616395Z make[4]: Leaving directory '/d/a/x86-codeblocks-builds/x86-codeblocks-builds/codeblocks_sfmirror/src/tools'
2024-09-20T09:18:08.2618080Z make[3]: Leaving directory '/d/a/x86-codeblocks-builds/x86-codeblocks-builds/codeblocks_sfmirror/src/tools'
2024-09-20T09:18:08.2632490Z make[2]: Leaving directory '/d/a/x86-codeblocks-builds/x86-codeblocks-builds/codeblocks_sfmirror/src/tools'
2024-09-20T09:18:08.2639951Z Making install in templates
2024-09-20T09:18:08.2799861Z make[2]: Entering directory '/d/a/x86-codeblocks-builds/x86-codeblocks-builds/codeblocks_sfmirror/src/templates'

It looks like the tools/CBLauncher is not built. But I'm not sure why, since the cb_console_runner.exe and cb_share_config.exe are built correctly.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6064
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: build bot in the github, I see one nice project
« Reply #48 on: September 21, 2024, 04:31:15 pm »
OK, I think I found some reason:

src/tools/cb_share_config/Makefile.am

Code
bin_PROGRAMS = cb_share_config

AM_CPPFLAGS = $(WX_CXXFLAGS) \
$(CB_GLIB2_CFLAGS) \
-I$(top_srcdir)/src/include

cb_share_config_LDFLAGS =

cb_share_config_LDADD = $(WX_LIBS)  \
$(CB_GLIB2_LIBS) \
$(CB_TINYXML_LIBS)

cb_share_config_SOURCES = app.cpp \
mainframe.cpp

noinst_HEADERS = app.h \
mainframe.h

man_MANS = cb_share_config.1

EXTRA_DIST = $(srcdir)/*.cbp \
$(srcdir)/wxsmith/*.wxs \
$(man_MANS)


When I looked at this file: src/tools/CBLauncher/Makefile.am

Code
EXTRA_DIST = 	$(srcdir)/doc/* \
$(srcdir)/icons/* \
$(srcdir)/*.cbp \
icon.rc \
mainpage.h \
launcher.cpp


So, need to modify the later file?
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 107
  • Where there is a will, there is a way.
Re: build bot in the github, I see one nice project
« Reply #49 on: September 21, 2024, 04:41:46 pm »
I have already solved the RELEASE problem.
-Windows 7, 32-bit
-CodeBlocks r13542, gcc 14.2.0, debug version

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6064
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: build bot in the github, I see one nice project
« Reply #50 on: September 21, 2024, 04:58:02 pm »
I have already solved the RELEASE problem.

Good work! I'm not sure how the release file will make, but sometimes, I will manually start the github action several times a day, so I would like the release name like: 2024-09-21-22-55? I mean the 22 and 55 are the hour and minus time stamp, maybe the svn revision can also be included.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 107
  • Where there is a will, there is a way.
-Windows 7, 32-bit
-CodeBlocks r13542, gcc 14.2.0, debug version

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6064
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: build bot in the github, I see one nice project
« Reply #52 on: September 22, 2024, 04:56:45 am »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6064
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: build bot in the github, I see one nice project
« Reply #53 on: September 22, 2024, 05:17:16 am »
https://github.com/marketplace/actions/get-timestamp-action

Thanks. Tweak the github action script is a bit complex for me, I will take some time later. Especially I have to tweak/commit/run action/fail/re-tweak many times.  >:(
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6064
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: build bot in the github, I see one nice project
« Reply #54 on: September 22, 2024, 03:46:00 pm »
https://github.com/marketplace/actions/get-timestamp-action

Thanks. Tweak the github action script is a bit complex for me, I will take some time later. Especially I have to tweak/commit/run action/fail/re-tweak many times.  >:(

Good news, I can make a first release of the github action generated zip file now, see here:

Releases asmwarrior/x86-codeblocks-builds


EDIT:

It looks like the time string release-2024-09-22-04-01-20 is not correct at least from the UTC+8 local time area. I have already set that time area in the my commit
« Last Edit: September 22, 2024, 04:33:04 pm by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline Grit Clef

  • Multiple posting newcomer
  • *
  • Posts: 107
  • Where there is a will, there is a way.
Re: build bot in the github, I see one nice project
« Reply #55 on: September 23, 2024, 05:48:09 am »
And in my repository, the svn revision and the wxWidgets version now can be Automatically detected.
« Last Edit: September 23, 2024, 06:01:34 am by Grit Clef »
-Windows 7, 32-bit
-CodeBlocks r13542, gcc 14.2.0, debug version

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6064
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: build bot in the github, I see one nice project
« Reply #56 on: September 23, 2024, 08:07:48 am »
And in my repository, the svn revision and the wxWidgets version now can be Automatically detected.

Thanks for the info. My github action code for created the release package is mainly created by chatGPT, and has some flaws. I got some warning message like below:

Quote
The following actions uses node12 which is deprecated and will be forced to run on node16: actions/create-release@v1, actions/upload-release-asset@v1. For more info: https://github.blog/changelog/2023-06-13-github-actions-all-actions-will-run-on-node16-instead-of-node12-by-default/

I think I will use your method, and by adding some time stamp for the release.

Question: why do you add a cron section?

Code
  schedule:
    - cron: '0 0 7,14,21,28 * *'

You want to run the github action every week? (chatGPT gives me the answer: the cron expression '0 0 7,14,21,28 * *' means that the job will run at midnight on the 7th, 14th, 21st, and 28th day of every month.)
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6064
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: build bot in the github, I see one nice project
« Reply #57 on: September 23, 2024, 09:07:21 am »
And in my repository, the svn revision and the wxWidgets version now can be Automatically detected.

You need to check this code for get the svn value string.

https://github.com/arnholm/codeblocks_sfmirror/blob/master/update_revision.sh

because if the git has some customized commits which does not contain the git-svn-id string, it will got empty result in your github action.

EDIT:


I think you could use:

Code
git log --graph | grep 'git-svn-id' | head -n 1 | grep -o -e "@\([0-9]*\)" | tr -d '@ '
« Last Edit: September 23, 2024, 09:27:59 am by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6064
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: build bot in the github, I see one nice project
« Reply #58 on: September 24, 2024, 03:46:57 pm »
I want to remove the hack of the dll export hack in building wxsmith plugin.

Code
# Workaround from msys2: error: definition of static data member 'wxsArrayStringEditorDlg::sm_eventTable' of dllimport'd class
# grep -rl "PLUGIN_EXPORT " src/plugins/contrib/wxSmith | xargs -i sed -i "s/PLUGIN_EXPORT //g" {}

So, I remove the hack above.

Now, I see the build error.

It looks like the dll export declaration is not defined.

But when I checked the build log, I see that:

Code
2024-09-24T11:34:32.2601440Z checking for gcc option to produce PIC... -DDLL_EXPORT -DPIC
2024-09-24T11:34:32.4010899Z checking if gcc PIC flag -DDLL_EXPORT -DPIC works... yes
...
...
...
2024-09-24T12:32:02.1013349Z libtool: compile:  g++ -DHAVE_CONFIG_H -I. -I../../../../../src/include -ID:/msys64/mingw64/lib/wx/include/msw-unicode-3.2 -ID:/msys64/mingw64/include/wx-3.2 -D_FILE_OFFSET_BITS=64 -DWXUSINGDLL -D__WXMSW__ -I../../../../../src/include -I../../../../../src/sdk/wxscintilla/include -DCB_AUTOCONF -DPIC -O2 -ffast-math -fPIC -fexceptions -MT wxsfloatproperty.lo -MD -MP -MF .deps/wxsfloatproperty.Tpo -c wxsfloatproperty.cpp  -DDLL_EXPORT -DPIC -o .libs/wxsfloatproperty.o
...
...
build failed!!!


You see, when building every plugin, the "-DDLL_EXPORT -DPIC" is defined.

But my question is: Where is the "DLL_EXPORT" get defined? I search all the C::B code git repo, and I can't find one.

When I check the cbp files, I see there is no "DLL_EXPORT" defined, instead, in the cbp file, another macro named "BUILDING_PLUGIN", this is core point, because in the

include\cbplugin.h, note this file is included in every cpp file when you need to build a plugin.

Code
#ifdef __WXMSW__
    #ifndef PLUGIN_EXPORT
        #ifdef EXPORT_LIB
            #define PLUGIN_EXPORT __declspec (dllexport)
        #else // !EXPORT_LIB
            #ifdef BUILDING_PLUGIN
                #define PLUGIN_EXPORT __declspec (dllexport)
            #else // !BUILDING_PLUGIN
                #define PLUGIN_EXPORT __declspec (dllimport)
            #endif // BUILDING_PLUGIN
        #endif // EXPORT_LIB
    #endif // PLUGIN_EXPORT
#else
    #define PLUGIN_EXPORT
#endif

So, I think we need to solve this issue.

I even checked the configure.ac file or Makefile.am file, I don't find the DLL_EXPORT definition.

Is this value a predefined string?

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6064
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: build bot in the github, I see one nice project
« Reply #59 on: September 24, 2024, 03:56:25 pm »
When I looked at the link

[MinGW] make check problem Issue #9115 protocolbuffers/protobuf

or

Make commands not working on Windows 10 at setting check up Issue #297 libcheck/check

It looks like the "DLL_EXPORT" is predefined in the auto configure tool?


EDIT:

I will try this patch below in the github action.

Code
diff --git a/src/include/cbplugin.h b/src/include/cbplugin.h
index 10258e5..a3ce67b 100644
--- a/src/include/cbplugin.h
+++ b/src/include/cbplugin.h
@@ -23,11 +23,11 @@
         #ifdef EXPORT_LIB
             #define PLUGIN_EXPORT __declspec (dllexport)
         #else // !EXPORT_LIB
-            #ifdef BUILDING_PLUGIN
+            #if defined(BUILDING_PLUGIN) || defined(DLL_EXPORT)
                 #define PLUGIN_EXPORT __declspec (dllexport)
-            #else // !BUILDING_PLUGIN
+            #else // !BUILDING_PLUGIN && !DLL_EXPORT
                 #define PLUGIN_EXPORT __declspec (dllimport)
-            #endif // BUILDING_PLUGIN
+            #endif // BUILDING_PLUGIN || DLL_EXPORT
         #endif // EXPORT_LIB
     #endif // PLUGIN_EXPORT
 #else



« Last Edit: September 24, 2024, 04:12:11 pm by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.