Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problems installing BGRA dependencies #33

Open
kfilippenok opened this issue Nov 24, 2024 · 6 comments
Open

Problems installing BGRA dependencies #33

kfilippenok opened this issue Nov 24, 2024 · 6 comments

Comments

@kfilippenok
Copy link

kfilippenok commented Nov 24, 2024

Log:

Run gcarreno/setup-lazarus@v3
Starting the installation process.
Installing Lazarus IDE
Lazarus installation completed.
Installing Additional Packages
  Packages to install: BGRABitmap,  BGLControls
  Requested Lazarus packages: BGRABitmap,  BGLControls
  _getPackageList: Fetching package list from https://packages.lazarus-ide.org/packagelist.json
  Fetched 207 package items.
  Installing packages: BGRABitmap
  _download: Downloading https://packages.lazarus-ide.org/BGRABitmap.zip to D:\a\_temp\BGRABitmap.zip
  _extract: Extracting D:\a\_temp\BGRABitmap.zip to D:\a\_temp\bac5d21d452bcad92fa6ac0[8](https://github.com/kfilippenok/tilesdownloader/actions/runs/11998225905/job/33444732821#step:3:9)49250200
  "C:\Program Files\PowerShell\7\pwsh.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ; try { [System.IO.Compression.ZipFile]::ExtractToDirectory('D:\a\_temp\BGRABitmap.zip', 'D:\a\_temp\bac5d21d452bcad[9](https://github.com/kfilippenok/tilesdownloader/actions/runs/11998225905/job/33444732821#step:3:10)2fa6ac0849250200', $true) } catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath 'D:\a\_temp\BGRABitmap.zip' -DestinationPath 'D:\a\_temp\bac5d21d452bcad92fa6ac0849250[20](https://github.com/kfilippenok/tilesdownloader/actions/runs/11998225905/job/33444732821#step:3:22)0' -Force } else { throw $_ } } ;"
  Unzipped to: "D:\a\_temp\bac5d[21](https://github.com/kfilippenok/tilesdownloader/actions/runs/11998225905/job/33444732821#step:3:23)d452bcad92fa6ac0849250200/BGRABitmap/"
  Adding and compiling package: D:\a\_temp\bac5d21d452bcad92fa6ac0849250200\BGRABitmap\bglcontrols\bglcontrols.lpk
  D:\a\_temp\installers\lazarus\lazbuild.exe D:\a\_temp\bac5d21d452bcad92fa6ac0849[25](https://github.com/kfilippenok/tilesdownloader/actions/runs/11998225905/job/33444732821#step:3:27)0200\BGRABitmap\bglcontrols\bglcontrols.lpk
  CopySecondaryConfigFile D:\a\_temp\installers\lazarus\environmentoptions.xml -> C:\Users\runneradmin\AppData\Local\lazarus\environmentoptions.xml
  Error: (lazbuild) Broken dependency: BGLControls 1.2->BGRABitmapPack
  D:\a\_temp\installers\lazarus\lazbuild.exe D:\a\_temp\bac5d21d452bcad92fa6ac0849250200\BGRABitmap\bglcontrols\bglcontrols.lpk
  Error: (lazbuild) Broken dependency: BGLControls 1.2->BGRABitmapPack
  Error: Installation failed: The process 'D:\a\_temp\installers\lazarus\lazbuild.exe' failed with exit code 3
  Error: Installation process failed: The process 'D:\a\_temp\installers\lazarus\lazbuild.exe' failed with exit code 3
  Error: The process 'D:\a\_temp\installers\lazarus\lazbuild.exe' failed with exit code 3

Workflow:

name: Build Snapshot
on: [push]

env:
  release_tag: snapshot

jobs:
  build:
    strategy:
      matrix:
        operating-system: [windows-latest, ubuntu-latest]
    runs-on: ${{ matrix.operating-system }}
    steps:
      - name: Checkout Tiles Downloader
        uses: actions/checkout@v4
      - name: Setup Lazarus  
        uses: gcarreno/setup-lazarus@v3
        with:
          lazarus-version: "dist"
          include-packages: "BGRABitmap, BGLControls"
          with-cache: true
      - name: Build
        run: lazbuild -B --bm="Release" src/tilesdownloader.lpi

https://github.com/kfilippenok/tilesdownloader/actions/runs/11998225905/job/33444732821

@kfilippenok
Copy link
Author

I conducted an experiment and decided to reproduce the setup-lazarus tasks:

$ wget https://packages.lazarus-ide.org/BGRABitmap.zip
$ cd BGRABitmap
$ /home/kirill/fpc_lazarus/fixes/lazarus/lazbuild /home/kirill/tmp/bgra/BGRABitmap/bgrabitmap/bgrabitmappack.lpk

The package has been compiled successfully.

(1008) 236465 lines compiled, 4.5 sec
(1021) 44 warning(s) issued
(1022) 1074 hint(s) issued
(1023) 668 note(s) issued

Compile project:

$ /home/kirill/fpc_lazarus/fixes/lazarus/lazbuild /home/kirill/Projects/tilesdownloader/src/tilesdownloader.lpi

And all succes:

(1008) 1258 lines compiled, 1.1 sec
(1022) 27 hint(s) issued
(1023) 16 note(s) issued

Pure Lazarus was used, builded through fpcupdeluxe. Still in the process of studying why your project believes that you first need to install bgracontrols,lpk

@kfilippenok
Copy link
Author

After analyzing it, I realized that the behavior that causes the error is in the _installLpkFile function.

It installs all packages recursively in order (not sure, but it looks like it). The first in order is the bglcontrols folder where there is a bglcontrols.lpk file and it is he who is put first, which is why the error occurs. But is this a setup-lazarus problem? Is it possible to determine which package is "main"? I don't know

@kfilippenok
Copy link
Author

I solved this problem for myself by manually installing dependencies. In a good way, we need to decide how to more correctly organize the installation of dependencies. I attach the resulting action file below.

name: Build Snapshot
on: [push]

env:
  release_tag: snapshot

jobs:
  build:
    strategy:
      matrix:
        operating-system: [windows-latest, ubuntu-latest]
    runs-on: ${{ matrix.operating-system }}
    steps:
      - name: Checkout Tiles Downloader
        uses: actions/checkout@v4
        
      - name: Setup Lazarus
        uses: gcarreno/setup-lazarus@v3
        with:
          lazarus-version: "dist"
          with-cache: false
          
      - name: Download BGRABitmapPack Windows
        if: ${{ matrix.operating-system == 'windows-latest' }}
        run: Invoke-WebRequest -Uri https://packages.lazarus-ide.org/BGRABitmap.zip -OutFile BGRABitmap.zip
      - name: Download BGRABitmapPack Linux
        if: ${{ matrix.operating-system == 'ubuntu-latest' }} 
        run: wget https://packages.lazarus-ide.org/BGRABitmap.zip

      - name: Unzip BGRABitmapPack Windows
        if: ${{ matrix.operating-system == 'windows-latest' }}
        run: Expand-Archive -Path BGRABitmap.zip -DestinationPath . -Force
      - name: Unzip BGRABitmapPack Linux  
        if: ${{ matrix.operating-system == 'ubuntu-latest' }} 
        run: unzip BGRABitmap.zip

      - name: Build BGRABitmapPack
        run: lazbuild BGRABitmap/bgrabitmap/bgrabitmappack.lpk
        
      - name: Build Tiles Downloader
        run: lazbuild -B --bm="Release" src/tilesdownloader.lpi

@kfilippenok
Copy link
Author

I looked at what information is in the list of Lazarus packages. BGRABitmap has the following information:

"PackageData14" : {
    "Name" : "BGRABitmap",
    "DisplayName" : "BGRABitmap",
    "Category" : "Graphics",
    "CommunityDescription" : "Set of units to create/modify images with transparency (alpha channel). Allows direct pixel access for fast processing.",
    "ExternalDependecies" : "",
    "OrphanedPackage" : 0,
    "RepositoryFileName" : "BGRABitmap.zip",
    "RepositoryFileSize" : 7759722,
    "RepositoryFileHash" : "bac5d21d452bcad92fa6ac0849250200",
    "RepositoryDate" : 4.5389345113657408E+004,
    "PackageBaseDir" : "BGRABitmap\\/",
    "HomePageURL" : "http://wiki.freepascal.org/BGRABitmap",
    "DownloadURL" : "https://raw.githubusercontent.com/bgrabitmap/bgrabitmap/master/update_BGRABitmap.json",
    "SVNURL" : ""
  },
  "PackageFiles14" : [
    {
      "Name" : "bglcontrols.lpk",
      "Description" : "Drawing routines with alpha blending and antialiasing",
      "Author" : "Circular",
      "License" : "modified LGPL",
      "RelativeFilePath" : "bglcontrols\\/",
      "VersionAsString" : "1.2.0.0",
      "LazCompatibility" : "2.2.0, 2.2.4, 3.0.0, Trunk",
      "FPCCompatibility" : "3.2.0, 3.2.2, 3.2.4",
      "SupportedWidgetSet" : "gtk2, win32/win64",
      "PackageType" : 0,
      "DependenciesAsString" : "BGRABitmapPack, lazopenglcontext, LCL, FCL(1.0)"
    },
    {
      "Name" : "bgrabitmappack.lpk",
      "Description" : "Drawing routines with alpha blending and antialiasing",
      "Author" : "Circular",
      "License" : "modified LGPL",
      "RelativeFilePath" : "bgrabitmap\\/",
      "VersionAsString" : "11.6.2.0",
      "LazCompatibility" : "2.2.0, 2.2.4, 3.0.0, Trunk",
      "FPCCompatibility" : "3.2.0, 3.2.2, 3.2.4",
      "SupportedWidgetSet" : "gtk2, win32/win64",
      "PackageType" : 2,
      "DependenciesAsString" : "LCL, FCL(1.0)"
    }
  ]

We should be interested in the "Package Files", which should specify the file through which the installation should go. For some reason, bglcontrols is the first one. I continue to study the problem

@gcarreno
Copy link
Owner

Hey Kirill(@kfilippenok),

There was a known bug with the order that the dependencies where setup in the list for installation.

I think that bug is now solved with the latest version. Can you please give it another go and see if it now works for you?

If all works well, then please close this issue. If not, please report what's happening now.

Cheers,
Gus

@kfilippenok
Copy link
Author

kfilippenok commented Jan 26, 2025

I checked for the dist version. The problem remains

Config:

name: Build Snapshot
on: [push]

env:
  release_tag: snapshot

jobs:
  build:
    strategy:
      matrix:
        operating-system: [windows-latest, ubuntu-latest]
    runs-on: ${{ matrix.operating-system }}
    steps:
      - name: Checkout Tiles Downloader
        uses: actions/checkout@v4
        
      - name: Setup Lazarus
        uses: gcarreno/setup-lazarus@v3
        with:
          lazarus-version: "dist"
          with-cache: false
          include-packages: "BGRABitmap"

      - name: Build Tiles Downloader
        run: lazbuild -B --bm="Release" src/tilesdownloader.lpi

Image

Run gcarreno/setup-lazarus@v3
  with:
    lazarus-version: dist
    with-cache: false
    include-packages: BGRABitmap
  env:
    release_tag: snapshot
Starting the installation process.
Installing Lazarus IDE
  installLazarus -- Installing Lazarus dist on platform: "win3[2](https://github.com/kfilippenok/tilesdownloader/actions/runs/12973807375/job/36182917456#step:3:2)"; arch: "x64"
  _downloadLazarus - Downloading https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2064%20bits/Lazarus%20[3](https://github.com/kfilippenok/tilesdownloader/actions/runs/12973807375/job/36182917456#step:3:3).6/lazarus-3.6-fpc-3.2.2-win6[4](https://github.com/kfilippenok/tilesdownloader/actions/runs/12973807375/job/36182917456#step:3:4).exe
  _downloadLazarus - Downloaded into D:\a\_temp\installers\lazarus-3.6.exe
  D:\a\_temp\installers\lazarus-3.6.exe /VERYSILENT /SP- /DIR=D:\a\_temp\installers\lazarus
  _downloadLazarus - Adding 'D:\a\_temp\installers\lazarus' to PATH
  _downloadLazarus - Adding 'D:\a\_temp\installers\lazarus\fpc\3.2.2\bin\x86_64-win64' to PATH
Lazarus installation completed.
Installing Additional Packages
  Packages to install: BGRABitmap
  Requested Lazarus packages: BGRABitmap
  _getPackageList: Fetching package list from https://packages.lazarus-ide.org/packagelist.json
  Fetched 208 package items.
  Installing packages: BGRABitmap
  _download: Downloading https://packages.lazarus-ide.org/BGRABitmap.zip to D:\a\_temp\BGRABitmap.zip
  _extract: Extracting D:\a\_temp\BGRABitmap.zip to D:\a\_temp\bac[5](https://github.com/kfilippenok/tilesdownloader/actions/runs/12973807375/job/36182917456#step:3:5)d21d452bcad92fa6ac0849250200
  "C:\Program Files\PowerShell\7\pwsh.exe" -NoLogo -NoProfile -NonInteractive -ExecutionPolicy Unrestricted -Command "$ErrorActionPreference = 'Stop' ; try { Add-Type -AssemblyName System.IO.Compression.ZipFile } catch { } ; try { [System.IO.Compression.ZipFile]::ExtractToDirectory('D:\a\_temp\BGRABitmap.zip', 'D:\a\_temp\bac5d21d452bcad92fa[6](https://github.com/kfilippenok/tilesdownloader/actions/runs/12973807375/job/36182917456#step:3:6)ac0849250200', $true) } catch { if (($_.Exception.GetType().FullName -eq 'System.Management.Automation.MethodException') -or ($_.Exception.GetType().FullName -eq 'System.Management.Automation.RuntimeException') ){ Expand-Archive -LiteralPath 'D:\a\_temp\BGRABitmap.zip' -DestinationPath 'D:\a\_temp\bac5d21d452bcad92fa6ac0[8](https://github.com/kfilippenok/tilesdownloader/actions/runs/12973807375/job/36182917456#step:3:9)49250200' -Force } else { throw $_ } } ;"
  Unzipped to: "D:\a\_temp\bac5d21d452bcad[9](https://github.com/kfilippenok/tilesdownloader/actions/runs/12973807375/job/36182917456#step:3:10)2fa6ac0849250200/BGRABitmap/"
  Adding and compiling package: D:\a\_temp\bac5d21d452bcad92fa6ac0849250200\BGRABitmap\bglcontrols\bglcontrols.lpk
  D:\a\_temp\installers\lazarus\lazbuild.exe D:\a\_temp\bac5d21d452bcad92fa6ac0849250200\BGRABitmap\bglcontrols\bglcontrols.lpk
  CopySecondaryConfigFile D:\a\_temp\installers\lazarus\environmentoptions.xml -> C:\Users\runneradmin\AppData\Local\lazarus\environmentoptions.xml
  Error: (lazbuild) Broken dependency: BGLControls 1.2->BGRABitmapPack
  D:\a\_temp\installers\lazarus\lazbuild.exe D:\a\_temp\bac5d21d452bcad92fa6ac0849250200\BGRABitmap\bglcontrols\bglcontrols.lpk
  Error: (lazbuild) Broken dependency: BGLControls 1.2->BGRABitmapPack
  Error: Installation failed: The process 'D:\a\_temp\installers\lazarus\lazbuild.exe' failed with exit code 3
  Error: Installation process failed: The process 'D:\a\_temp\installers\lazarus\lazbuild.exe' failed with exit code 3
  Error: The process 'D:\a\_temp\installers\lazarus\lazbuild.exe' failed with exit code 3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants