xmake-io / xmake

🔥 A cross-platform build utility based on Lua
https://xmake.io
Apache License 2.0
10.14k stars 782 forks source link

安装 cairo 1.18.0 依赖库失败 #5604

Closed lc-soft closed 2 months ago

lc-soft commented 2 months ago

Xmake 版本

2.9.4

操作系统版本和架构

Microsoft Windows Server 2022 10.0.20348

描述问题

在 GitHub Actions 的 windows 系统中安装 cairo 库会失败

期待的结果

cairo 依赖库安装成功

工程配置

https://github.com/lc-soft/test-xmake-install-cairo

附加信息和错误日志

详见:https://github.com/lc-soft/test-xmake-install-cairo/actions/runs/10815705008/job/30005218475

C:\hostedtoolcache\windows\xmake\2.9.4\x64\winenv\bin\curl -SL -A "Xmake/2.9.4+HEAD.e85b001f1 (Windows;) curl/8.2.1" https://github.com/xmake-mirror/build-artifacts/releases/download/cairo-1.18.0/windows-x64-vc14.41.34120-b36d64ce59014e34bea4eaee0da329b7.7z -o windows-x64-vc14.41.34120-b36d64ce59014e34bea4eaee0da329b7.7z
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

100 1175k  100 1175k    0     0  1674k      0 --:--:-- --:--:-- --:--:-- 1674k
C:\hostedtoolcache\windows\xmake\2.9.4\x64\winenv\bin\7z x -y windows-x64-vc14.41.34120-b36d64ce59014e34bea4eaee0da329b7.7z -osource.tmp

7-Zip 19.00 (x64) : Copyright (c) 1999-2018 Igor Pavlov : 2019-02-21

Scanning the drive for archives:
1 file, 1203904 bytes (1176 KiB)

Extracting archive: windows-x64-vc14.41.34120-b36d64ce59014e34bea4eaee0da329b7.7z
--
Path = windows-x64-vc14.41.34120-b36d64ce59014e34bea4eaee0da329b7.7z
Type = 7z
Physical Size = 1203904
Headers Size = 683
Method = LZMA2:6m
Solid = +
Blocks = 1

Everything is Ok

Folders: 8
Files: 29
Size:       5811200
Compressed: 1203904
  => download https://github.com/xmake-mirror/build-artifacts/releases/download/cairo-1.18.0/windows-x64-vc14.41.34120-b36d64ce59014e34bea4eaee0da329b7.7z .. ok
checking for xmake::cairo ... cairo 1.18.0
{ 
  static = true,
  syslinks = { 
    "gdi32",
    "msimg32",
    "user32",
    "ole32", 
  },
  linkdirs = { 
    "C:\Users\runneradmin\AppData\Local\.xmake\packages\c\cairo\1.18.0\b36d64ce59014e34bea4eaee0da329b7\lib", 
  },
  links = { 
    "cairo-script-interpreter",
    "cairo", 
  },
  license = "MPL-1.1",
  libfiles = { 
    "C:\Users\runneradmin\AppData\Local\.xmake\packages\c\cairo\1.18.0\b36d64ce59014e34bea4eaee0da329b7\lib\cairo-script-interpreter.lib",
    "C:\Users\runneradmin\AppData\Local\.xmake\packages\c\cairo\1.18.0\b36d64ce59014e34bea4eaee0da329b7\lib\cairo.lib", 
  },
  sysincludedirs = { 
    "C:\Users\runneradmin\AppData\Local\.xmake\packages\c\cairo\1.18.0\b36d64ce59014e34bea4eaee0da329b7\include",
    "C:\Users\runneradmin\AppData\Local\.xmake\packages\c\cairo\1.18.0\b36d64ce59014e34bea4eaee0da329b7\include\cairo", 
  },
  defines = "CAIRO_WIN32_STATIC_BUILD=1",
  version = "1.18.0", 
}

> checking for c includes(cairo.h)
> checking for c funcs(cairo_create)
> checking for c links(cairo-script-interpreter, cairo, png, intl, fontconfig, freetype, zlib, libexpatMT, gdi32, msimg32, user32, ole32, advapi32)
> checking for c snippet(has_cfuncs)
error:    Creating library C:\Users\RUNNER~1\AppData\Local\Temp\.xmake\240911\_89C2BD069D884C4084EA8C376A7AF1C0.lib and object C:\Users\RUNNER~1\AppData\Local\Temp\.xmake\240911\_89C2BD069D884C4084EA8C376A7AF1C0.exp
cairo.lib(cairo-matrix.c.obj) : error LNK2019: unresolved external symbol pixman_transform_point_3d referenced in function _cairo_matrix_to_pixman_matrix
cairo.lib(cairo-image-compositor.c.obj) : error LNK2019: unresolved external symbol pixman_blt referenced in function draw_image_boxes
cairo.lib(cairo-image-compositor.c.obj) : error LNK2019: unresolved external symbol pixman_fill referenced in function _fill32_spans
cairo.lib(cairo-image-compositor.c.obj) : error LNK2019: unresolved external symbol pixman_image_create_bits referenced in function composite_traps
cairo.lib(cairo-image-surface.c.obj) : error LNK2001: unresolved external symbol pixman_image_create_bits
cairo.lib(cairo-image-source.c.obj) : error LNK2001: unresolved external symbol pixman_image_create_bits
cairo.lib(cairo-image-compositor.c.obj) : error LNK2019: unresolved external symbol pixman_image_unref referenced in function composite_boxes
cairo.lib(cairo-image-surface.c.obj) : error LNK2001: unresolved external symbol pixman_image_unref
cairo.lib(cairo-image-source.c.obj) : error LNK2001: unresolved external symbol pixman_image_unref
  => install cairo 1.18.0 .. failed
C:\hostedtoolcache\windows\xmake\2.9.4\x64\winenv\bin\curl -SL -A "Xmake/2.9.4+HEAD.e85b001f1 (Windows;) curl/8.2.1" https://gitlab.freedesktop.org/cairo/cairo/-/archive/1.18.0/cairo-1.18.0.tar.gz -o cairo-1.18.0.tar.gz
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed

  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
100 3507k    0 3507k    0     0  3619k      0 --:--:-- --:--:-- --:--:-- 3627k
100 31.3M    0 31.3M    0     0  16.2M      0 --:--:--  0:00:01 --:--:-- 16.3M
100 46.7M    0 46.7M    0     0  12.8M      0 --:--:--  0:00:03 --:--:-- 12.8M
100 46.7M    0 46.7M    0     0  12.8M      0 --:--:--  0:00:03 --:--:-- 12.8M
error: unmatched checksum, current hash(39a78afd) != original hash(a085762e)
  => download https://gitlab.freedesktop.org/cairo/cairo/-/archive/1.18.0/cairo-1.18.0.tar.gz .. failed
git clone https://gitlab.freedesktop.org/cairo/cairo.git -c core.fsmonitor=false source.tmp\cairo
Cloning into 'source.tmp\cairo'...
error: attempt to index a number value (local 'opt')
  => install cairo 1.18.0 .. failed
configure
{
    kind = static
    arch = x64
    host = windows
    ndk_stdcxx = true
    mode = release
    ccache = true
    plat = windows
    buildir = build
    vs = 2022
}
warning: please use package:runtimes() or package:has_runtime() instead of package:config("vs_runtime")
Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


Title: Failed to install cairo 1.18.0 dependent libraries

star-hengxing commented 2 months ago

error: attempt to index a number value (local 'opt')

xmake 本体 bug,使用 dev 分支或下个版本即可。

另外两个错误我也复现不出来

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


error: attempt to index a number value (local 'opt')

For xmake body bugs, just use the dev branch or the next version.

I can't reproduce the other two errors either.

waruqi commented 2 months ago

先尝试更新使用 dev xmake update -s dev

如果还有错,贴下 -vD 的完整logs 和 栈

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


First try to update using dev xmake update -s dev

If there are still errors, please post the complete logs and stack of -vD

lc-soft commented 2 months ago

日志: Builds binaries on windows-latest.txt

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


日志: Builds binaries on windows-latest.txt

star-hengxing commented 2 months ago

日志: Builds binaries on windows-latest.txt

一样的报错,xmake dev 已经修复了

Issues-translate-bot commented 2 months ago

Bot detected the issue body's language is not English, translate it automatically.


Log: Builds binaries on windows-latest.txt

Same error, xmake dev has fixed it

lc-soft commented 2 months ago

问题已解决。

之前尝试添加 xmake update -s dev 命令没有效果,实际仍然用的 2.9.4 版本,现在改 github-action-setup-xmake 的配置可正确指定版本。

      - uses: xmake-io/github-action-setup-xmake@v1
        with:
          xmake-version: branch@dev

image