Making libraries in current version

Source code related resources

Moderator: Rathinagiri

User avatar
kcarmody
Posts: 152
Joined: Tue Oct 07, 2014 11:13 am
Contact:

Making libraries in current version

Post by kcarmody »

I've downloaded the current version of HMG from Github https://github.com/HMG-Official/HMG . I tried to run two batch files in the root directory, BuildLib32.bat and BuildAllLib32.bat.

Both of these batch files say they cannot find hbmk2. This is the Harbour make utility, which is in HARBOUR\bin\ in 3.4.4 and in HARBOUR\bin\win\mingw\ in the new version. The batch files are unchanged from 3.4.4 and have not been updated to reflect the new location of the Harbour executables. I'm therefore unable to make HMG libraries or executables with this new version in its current configuration.

In addition, Mingw and the lib folder have been omitted from the new version. I think that every new version should include Mingw and compiled libraries in the lib folder, and it should be properly tested before release, including building the libraries and some demos.

I don't think it's a good idea to change the location of hbmk2 and other Harbour and Mingw components. Critical folder locations should not be changed unless necessary, as it may break users' batch files.
User avatar
AUGE_OHR
Posts: 2062
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Making libraries in current version

Post by AUGE_OHR »

kcarmody wrote: Sun Nov 01, 2020 6:51 pm I've downloaded the current version of HMG from Github https://github.com/HMG-Official/HMG . I tried to run two batch files in the root directory, BuildLib32.bat and BuildAllLib32.bat.
try to run in CMD BOX
BUILD.BAT "only" before BuildLib32.bat / BuildAllLib32.bat.
have fun
Jimmy
User avatar
kcarmody
Posts: 152
Joined: Tue Oct 07, 2014 11:13 am
Contact:

Re: Making libraries in current version

Post by kcarmody »

AUGE_OHR wrote: Sun Nov 01, 2020 8:00 pm
kcarmody wrote: Sun Nov 01, 2020 6:51 pm I've downloaded the current version of HMG from Github https://github.com/HMG-Official/HMG . I tried to run two batch files in the root directory, BuildLib32.bat and BuildAllLib32.bat.
try to run in CMD BOX
BUILD.BAT "only" before BuildLib32.bat / BuildAllLib32.bat.
OK, I opened a command box at the HMG root directory. I typed build and got this:

Code: Select all

| was unexpected at this time.
Then I typed buildlib32 and pressed Enter when it asked me to select an option. I got this:

Code: Select all

 Build Library:         UNICODE

'hbmk2' is not recognized as an internal or external command,
operable program or batch file.

Press any key to continue . . .
Is this what you meant? build.bat is meant to be followed by a source file name, and buildlib32 needs to be able to find hbmk2, but the path that is within buildlib32.bat is not where hbmk2 actually is.

I could make buildlib32.bat work by moving the Harbour executables around and copying Mingw from 3.4.4. My point is that these steps should not be necessary. The HMG master on Github should be set up so that these batch files work. And more than that, it should not necessary to compile the libraries -- they should be in the HMG master, ready for everyone to build applications.
User avatar
AUGE_OHR
Posts: 2062
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Making libraries in current version

Post by AUGE_OHR »

hi

Ok, i understand : Environment is missing :!:

like under Cl*pper i recommend to set Path, INCLUDE and LIB

run this

Code: Select all

rundll32.exe sysdm.cpl,EditEnvironmentVariables
hbEnv.JPG
hbEnv.JPG (33.74 KiB) Viewed 9212 times
add Path, INCLUDE and LIB (here 64 Bit Version)

Code: Select all

INCLUDE=c:\hmg.3.4.4\HARBOUR-64\include\;c:\hmg.3.4.4\INCLUDE\;
LIB=c:\hmg.3.4.4\HARBOUR-64\lib\;c:\hmg.3.4.4\LIB-64\;
PATH=c:\hmg.3.4.4\HARBOUR-64\bin\;
last line will point to hbmk2

re-Login to get new Environment

C:\hmg.3.4.4\build64.bat have some more "SET" which is need before BuildLib work correct
have fun
Jimmy
User avatar
kcarmody
Posts: 152
Joined: Tue Oct 07, 2014 11:13 am
Contact:

Re: Making libraries in current version

Post by kcarmody »

AUGE_OHR wrote: Mon Nov 02, 2020 12:24 amlike under Cl*pper i recommend to set Path, INCLUDE and LIB
Yes, I can do that or something like that, but I was not asking how to fix it for myself. I was telling everyone who maintains the Github master that nothing like this should be necessary. In the past, HMG worked without such modifications, and it should continue to do so. HMG is broken and should be fixed. The maintainers of the HMG master broke it, and they should fix it.

Look at the first few lines of BuildAllLib32.bat. It adjusts the user's path so that it can find hbmk2 and other executables it needs. The user does not have to do this -- the batch file does it. The problem is that, in the master, these executables have been moved, but these lines were not changed. So this batch file no longer works. The maintainers of the HMG master should fix everything that they broke.
User avatar
AUGE_OHR
Posts: 2062
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: Making libraries in current version

Post by AUGE_OHR »

hi,

yes you are absolute right.

i had that Problem with Environment as Newbie when i want to include change to Debugger.

---

i have compare *.BAT files with my from 2016 and they are same :?:
so it must have change before 2016.
can you upload "old" files please.
have fun
Jimmy
Carlos Britos
Posts: 245
Joined: Sat Aug 02, 2008 5:03 pm

Re: Making libraries in current version

Post by Carlos Britos »

Hi
If you want to compile the source in hmg official or in your fork use this script.

To compile your fork you must replace HMG-Official with kcarmody

This will build all hmg libs and harbour binaries

hmg34offi_all_hb32_mgw930_32b_uni.yml

This will build all hmg libs and harbour binaries.

To run it open Action in github and create a new.

Actions -> new workflow -> manual workflow -> setup this workflow

Replace the text in there with this script and Start commit

This will run the script and create (if all is ok) the Artifac with the zip file.

After that, every time you commit something this will be triggered unless you disable it.

This compilation will use harbour binaries created on 2020/10/27

Code: Select all

name: HMG official all libs 32bit MinGW 930 unicode

on:
    push:

jobs:
  build:
    runs-on: windows-latest

    if: github.actor == github.event.repository.owner.login

    steps:
    - name: Checkout HMG-Official repo
      uses: actions/checkout@v2
      with:
       repository: HMG-Official/HMG
       path: HMG-Official/HMG

    - name: Install dependencies
      run: |
        (new-object System.Net.WebClient).DownloadFile('https://bitbucket.org/lorenzodla/mod_harbour_actions_resources/downloads/mingw32.zip', 'C:\temp\mingw32.zip')
        Expand-Archive -LiteralPath C:\temp\mingw32.zip -DestinationPath C:\mingw32 -Force
        (new-object System.Net.WebClient).DownloadFile('https://github.com/asistex/HMG/raw/master/workflows/hb32_mgw930_32b_2020_10_27.zip', 'C:\temp\harbour.zip')
        Expand-Archive -LiteralPath C:\temp\harbour.zip -DestinationPath C:\harbour -Force
        gcc --version

    - name: Building lib HMG
      shell: cmd
      run: |
        cd HMG-Official\hmg
        set path=c:\mingw32\mingw32\bin;c:\harbour\bin;%path%
        BuildAllLib32.bat

    - name: Create output folders...
      shell: cmd
      run: |
        mkdir output

        robocopy HMG-Official\hmg\source output\source /E
        if %ERRORLEVEL% EQU 1 set ERRORLEVEL=0

        robocopy HMG-Official\hmg\lib output\lib /E
        if %ERRORLEVEL% EQU 1 set ERRORLEVEL=0

        robocopy HMG-Official\hmg\include output\include /E
        if %ERRORLEVEL% EQU 1 set ERRORLEVEL=0

        robocopy HMG-Official\hmg\doc output\doc /E
        if %ERRORLEVEL% EQU 1 set ERRORLEVEL=0

        robocopy HMG-Official\hmg\samples output\samples /E
        if %ERRORLEVEL% EQU 1 set ERRORLEVEL=0

        robocopy HMG-Official\hmg\hfsl output\hfsl /E
        if %ERRORLEVEL% EQU 1 set ERRORLEVEL=0

        robocopy HMG-Official\hmg\resources output\resources /E
        if %ERRORLEVEL% EQU 1 set ERRORLEVEL=0

        robocopy HMG-Official\hmg\workflows output\workflows /E
        if %ERRORLEVEL% EQU 1 set ERRORLEVEL=0

        robocopy HMG-Official\hmg\harbour output\harbour /E
        if %ERRORLEVEL% EQU 1 set ERRORLEVEL=0

        copy HMG-Official\hmg\*.* output\

    - name: Get current time
      uses: srfrnk/current-time@master
      id: current-time
      with:
        format: YYYY_MM_DD

    - name: Create artifact
      env:
        TIME: "${{ steps.current-time.outputs.formattedTime }}"
      uses: actions/upload-artifact@v2
      with:
        name: hmg34offi_all_hb32_mgw930_uni_${{ env.TIME }}
        path: output
Regards/Saludos, Carlos (bcd12a)
User avatar
kcarmody
Posts: 152
Joined: Tue Oct 07, 2014 11:13 am
Contact:

Re: Making libraries in current version

Post by kcarmody »

Carlos Britos wrote: Mon Nov 02, 2020 10:32 amIf you want to compile the source in hmg official or in your fork use this script....
Thanks, it's good to know. Have you tested this? It calls BuildAllLib32.bat, which I have already shown is broken.

Even if it does work, it still is not a solution to the problems I first reported. The Harbour binaries would still be in the wrong place, and Mingw would be missing from the distribution. All of these issues need to be fixed in the master.

It would be good if the maintainers of the HMG master would use a procedure like this on the master. Then everyone would have the binaries and would not need to compile the libraries themselves.
User avatar
kcarmody
Posts: 152
Joined: Tue Oct 07, 2014 11:13 am
Contact:

Re: Making libraries in current version

Post by kcarmody »

AUGE_OHR wrote: Mon Nov 02, 2020 8:55 ami have compare *.BAT files with my from 2016 and they are same :?:
so it must have change before 2016.
can you upload "old" files please.
No, the change was made after 3.4.4 (2017-03-29, batch files modified 2016-05-01). In the original distribution of 3.4.4, the Harbour executables were in HARBOUR\bin\ . In the Github distribution of 3.4.4, they were in HARBOUR\bin\win\mingw\ . They are still there in current Github distribution.

You can download version 3.4.3 at https://sourceforge.net/projects/hmg/ . I don't know where you download 3.4.4.
User avatar
mustafa
Posts: 1158
Joined: Fri Mar 20, 2009 11:38 am
DBs Used: DBF
Location: Alicante - Spain
Contact:

Re: Making libraries in current version

Post by mustafa »

Post Reply