xmake-io / xmake-repo

📦 An official xmake package repository
https://xrepo.xmake.io
Apache License 2.0
685 stars 396 forks source link

libuv哈希值不匹配 #4933

Open 1143910315 opened 2 months ago

1143910315 commented 2 months ago

Xmake 版本

v2.9.4+HEAD.e85b001f1

操作系统版本和架构

Microsoft Windows Server 2022 10.0.20348 Datacenter

描述问题

我在构建项目的时候遇到了github action报hash错误,目前我本地构建是可以成功的(可能是因为xmake之前的构建缓存和repo非最新),github上是失败的

在这个xmake.lua脚本中,我还用了add_requireconfs强制openssl是3.3.1,因为不这样做的话,github action还会使用1.1.1-w版本去构建cpp-httplib,但是cpp-httplib是不支持openssl的

期待的结果

希望github action能正确构建

工程配置

add_rules("mode.debug", "mode.release")
add_rules("plugin.vsxmake.autoupdate")

add_repositories("liteldev-repo https://github.com/LiteLDev/xmake-repo.git")

-- Dependencies from xmake-repo.
add_requires("fmt")
add_requires("magic_enum")
add_requires("nlohmann_json")
add_requires("cpp-httplib", {configs = {ssl = true}})
add_requireconfs("cpp-httplib.openssl3", {override = true, version = "3.3.1"})
add_requires("uwebsockets", {configs = {zip = true}})
add_requireconfs("uwebsockets.usockets", {configs = {ssl = "openssl3"}})
add_requireconfs("uwebsockets.usockets.openssl3", {override = true, version = "3.3.1"})

-- Dependencies from liteldev-repo.
add_requires("pfr 2.1.1")
add_requires("expected-lite v0.7.0")
add_requires("ctre 3.8.1")

target("SkyDreamBotBeta")
    set_kind("binary")
    add_files(
        "src/**.cpp",
        "src/**.ixx",
        "src/**.rc"
    )
    set_configdir("$(buildir)/config")
    set_configvar("SDB_WORKSPACE_FOLDER", "$(projectdir)")
    add_configfiles("src/(Version.h.in)")
    add_headerfiles(
        "src/**.inl","src/**.h"
    )
    add_includedirs(
        "src/", "$(buildir)/config"
    )
    add_cxflags(
        "/utf-8",
        "/permissive-",
        "/W4",
        "/w44265",
        "/w44289",
        "/w44296",
        "/w45263",
        "/w44738",
        "/w45204",
        "/experimental:module"
    )
    add_cxflags(
        "/EHs",
        "-Wno-microsoft-cast",
        "-Wno-invalid-offsetof",
        "-Wno-c++2b-extensions",
        "-Wno-microsoft-include",
        "-Wno-overloaded-virtual",
        "-Wno-ignored-qualifiers",
        "-Wno-potentially-evaluated-expression",
        "-Wno-pragma-system-header-outside-header",
        {tools = {"clang_cl"}}
    )
    add_defines(
        "_CRT_SECURE_NO_WARNINGS",
        "_ENABLE_CONSTEXPR_MUTEX_CONSTRUCTOR",
        "NOMINMAX",
        "UNICODE",
        "WIN32_LEAN_AND_MEAN"
    )
    add_packages(
        "fmt",
        "expected-lite",
        "magic_enum",
        "nlohmann_json",
        "cpp-httplib",
        "uwebsockets",
        "ctre",
        "pfr"
    )
    set_languages("c++23")
    set_symbols("debug")

    if is_mode("debug") then
        add_defines("SDB_DEBUG")
    end

    on_load(function (target)
        local tag = os.iorun("git describe --tags --abbrev=0 --always")
        local major, minor, patch, suffix = tag:match("v(%d+)%.(%d+)%.(%d+)(.*)")
        if not major then
            print("Failed to parse version tag, using 0.0.0")
            major, minor, patch = 0, 0, 0
        end
        if suffix then
            prerelease = suffix:match("-(.*)")
            if prerelease then
                prerelease = prerelease:gsub("\n", "")
            end
            if prerelease then
                target:set("configvar", "SDB_VERSION_PRERELEASE", prerelease)
            end
        end
        target:set("configvar", "SDB_VERSION_MAJOR", major)
        target:set("configvar", "SDB_VERSION_MINOR", minor)
        target:set("configvar", "SDB_VERSION_PATCH", patch)
    end)
target_end()
on:
  pull_request:
  push:
  workflow_dispatch:

jobs:
  build:
    strategy:
      matrix:
        mode:
          - debug
          - release
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v4

      - uses: xmake-io/github-action-setup-xmake@v1

      - uses: actions/cache@v4
        with:
          path: |
            ~/AppData/Local/.xmake
          key: xmake-${{ hashFiles('xmake.lua') }}
          restore-keys: |
            xmake-

      - run: |
          xmake repo -u

      - run: |
          xmake f -a x64 -m ${{ matrix.mode }} -p windows -v -y

      - run: |
          xmake -v -w -y

      - uses: actions/upload-artifact@v4
        with:
          name: ${{ github.event.repository.name }}-${{ matrix.mode }}-windows-x64-${{ github.sha }}
          path: |
            build/windows/x64/release/

附加信息和错误日志

checking for xmake::openssl3 ... openssl3 3.3.1
{ 
  version = "3.3.1",
  shared = true,
  static = true,
  sysincludedirs = { 
    "C:\Users\runneradmin\AppData\Local\.xmake\packages\o\openssl3\3.3.1\989cdc3d6a3b4f30a5d1e26b25717a5b\include", 
  },
  license = "Apache-2.0",
  links = { 
    "libssl",
    "libcrypto", 
  },
  libfiles = { 
    "C:\Users\runneradmin\AppData\Local\.xmake\packages\o\openssl3\3.3.1\989cdc3d6a3b4f30a5d1e26b25717a5b\lib\libssl.lib",
    "C:\Users\runneradmin\AppData\Local\.xmake\packages\o\openssl3\3.3.1\989cdc3d6a3b4f30a5d1e26b25717a5b\lib\libcrypto.lib",
    "C:\Users\runneradmin\AppData\Local\.xmake\packages\o\openssl3\3.3.1\989cdc3d6a3b4f30a5d1e26b25717a5b\lib\ossl-modules\legacy.dll", 
  },
  linkdirs = { 
    "C:\Users\runneradmin\AppData\Local\.xmake\packages\o\openssl3\3.3.1\989cdc3d6a3b4f30a5d1e26b25717a5b\lib", 
  },
  syslinks = { 
    "ws2_32",
    "user32",
    "crypt32",
    "advapi32", 
  }, 
}

patching C:\Users\runneradmin\AppData\Local\.xmake\packages\o\openssl3\3.3.1\989cdc3d6a3b4f30a5d1e26b25717a5b\lib\pkgconfig\openssl3.pc ..
checking for flags (-MT) ... ok
checking for flags (cl_external_includedir) ... ok
> checking for c includes(openssl/ssl.h)
> checking for c funcs(SSL_new)
> checking for c links(libssl, libcrypto, ws2_32, user32, crypt32, advapi32)
> checking for c snippet(has_cfuncs)
  => install openssl3 3.3.1 .. ok
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/yhirose/cpp-httplib/archive/v0.16.2.tar.gz -o v0.16.2.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
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

100 1130k    0 1130k    0     0  1884k      0 --:--:-- --:--:-- --:--:-- 1884k
C:\hostedtoolcache\windows\xmake\2.9.4\x64\winenv\bin\7z x -y v0.16.2.tar.gz -oC:\Users\RUNNER~1\AppData\Local\Temp\.xmake\240814\_358564C8AF684C308AE43683D04BA190.tar

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

Scanning the drive for archives:
1 file, 1157538 bytes (1131 KiB)

Extracting archive: v0.16.2.tar.gz
--
Path = v0.16.2.tar.gz
Type = gzip
Headers Size = 10

Everything is Ok

Size:       7895040
Compressed: 1157538
C:\hostedtoolcache\windows\xmake\2.9.4\x64\winenv\bin\7z x -y C:\Users\RUNNER~1\AppData\Local\Temp\.xmake\240814\_358564C8AF684C308AE[4368](https://github.com/Lovelylavender4/SkyDreamBotBeta/actions/runs/10395442144/job/28787461994#step:7:4369)3D04BA190.tar\v0.16.2.tar -osource.tmp

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

Scanning the drive for archives:
1 file, 7895040 bytes (7710 KiB)

Extracting archive: C:\Users\RUNNER~1\AppData\Local\Temp\.xmake\240814\_358564C8AF684C308AE43683D04BA190.tar\v0.16.2.tar
--
Path = C:\Users\RUNNER~1\AppData\Local\Temp\.xmake\240814\_358564C8AF684C308AE43683D04BA190.tar\v0.16.2.tar
Type = tar
Physical Size = 7895040
Headers Size = 51712
Code Page = UTF-8

Everything is Ok

Folders: 16
Files: 82
Size:       7822287
Compressed: 7895040
  => download https://github.com/yhirose/cpp-httplib/archive/v0.16.2.tar.gz .. ok
C:\Program Files\CMake\bin\cmake -DHTTPLIB_COMPILE=OFF -DBUILD_SHARED_LIBS=OFF -DHTTPLIB_REQUIRE_OPENSSL=ON -DHTTPLIB_REQUIRE_ZLIB=OFF -DHTTPLIB_REQUIRE_BROTLI=OFF -DHTTPLIB_NO_EXCEPTIONS=OFF -DCMAKE_INSTALL_PREFIX=C:\Users\runneradmin\AppData\Local\.xmake\packages\c\cpp-httplib\0.16.2\d56609da04044b6f922d01a2e88a922b -DCMAKE_INSTALL_LIBDIR:PATH=lib -G "Visual Studio 17 2022" -A x64 -DCMAKE_GENERATOR_TOOLSET=v143 -DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=pdb -DCMAKE_POSITION_INDEPENDENT_CODE=ON "-DCMAKE_EXE_LINKER_FLAGS_RELEASE=/machine:x64 /INCREMENTAL:NO" -DCMAKE_STATIC_LINKER_FLAGS_RELEASE=/machine:x64 "-DCMAKE_C_FLAGS_RELEASE=/DWIN32 /D_WINDOWS /W3  /O2 /Ob2 /DNDEBUG" "-DCMAKE_SHARED_LINKER_FLAGS_RELEASE=/machine:x64 /INCREMENTAL:NO" "-DCMAKE_CXX_FLAGS_RELEASE=/DWIN32 /D_WINDOWS /W3 /GR /EHsc  /O2 /Ob2 /DNDEBUG" C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source
-- The CXX compiler identification is MSVC 19.40.33813.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
-- Found OpenSSL: C:/Users/runneradmin/AppData/Local/.xmake/packages/o/openssl3/3.3.1/989cdc3d6a3b4f30a5d1e26b25717a5b/lib/libcrypto.lib (found suitable version "3.3.1", minimum required is "3.0.0") found components: Crypto SSL
-- Configuring done (6.0s)
-- Generating done (0.0s)
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY
    CMAKE_C_FLAGS_RELEASE

-- Build files have been written to: C:/Users/runneradmin/AppData/Local/.xmake/cache/packages/2408/c/cpp-httplib/0.16.2/source/build_d56609da
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\msbuild.exe C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\httplib.sln -t:Rebuild /nr:false -nologo -m:3 -p:Configuration=Release -p:Platform=x64 /p:PlatformToolset=v143
Build started 8/14/2024 9:50:04 PM.

     1>Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\httplib.sln" on node 1 (Rebuild target(s)).
     1>ValidateSolutionConfiguration:
         Building solution configuration "Release|x64".
       ValidateProjects:
         The project "INSTALL" is not selected for building in solution configuration "Release|x64".
     1>Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\httplib.sln" (1) is building "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ZERO_CHECK.vcxproj" (3) on node 2 (Rebuild target(s)).
     3>CoreClean:
         Creating directory "x64\Release\ZERO_CHECK\".
       PrepareForBuild:
         Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See https://aka.ms/cpp/structured-output for more details.
         Creating directory "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\".
       InitializeBuildStatus:
         Creating "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
         Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
       CustomBuild:
         1>Checking Build System
       FinalizeBuildStatus:
         Deleting file "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
         Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
     3>Done Building Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ZERO_CHECK.vcxproj" (Rebuild target(s)).
     1>Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\httplib.sln" (1) is building "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ALL_BUILD.vcxproj.metaproj" (2) on node 1 (Rebuild target(s)).
     2>Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ALL_BUILD.vcxproj.metaproj" (2) is building "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ALL_BUILD.vcxproj" (4) on node 1 (Rebuild target(s)).
     4>CoreClean:
         Creating directory "x64\Release\ALL_BUILD\".
       PrepareForBuild:
         Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See https://aka.ms/cpp/structured-output for more details.
         Creating directory "x64\Release\ALL_BUILD\ALL_BUILD.tlog\".
       InitializeBuildStatus:
         Creating "x64\Release\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
         Touching "x64\Release\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild".
       CustomBuild:
         Building Custom Rule C:/Users/runneradmin/AppData/Local/.xmake/cache/packages/2408/c/cpp-httplib/0.16.2/source/CMakeLists.txt
       FinalizeBuildStatus:
         Deleting file "x64\Release\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild".
         Touching "x64\Release\ALL_BUILD\ALL_BUILD.tlog\ALL_BUILD.lastbuildstate".
     4>Done Building Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ALL_BUILD.vcxproj" (Rebuild target(s)).
     2>Done Building Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ALL_BUILD.vcxproj.metaproj" (Rebuild target(s)).
     1>Done Building Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\httplib.sln" (Rebuild target(s)).

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.78
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\msbuild.exe INSTALL.vcxproj -nologo -m:3 -p:Configuration=Release -p:Platform=x64 /p:PlatformToolset=v143
Build started 8/14/2024 9:50:05 PM.

     1>Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\INSTALL.vcxproj" on node 1 (default targets).
     1>Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\INSTALL.vcxproj" (1) is building "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
     2>PrepareForBuild:
         Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See https://aka.ms/cpp/structured-output for more details.
       InitializeBuildStatus:
         Creating "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
         Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
       CustomBuild:
         All outputs are up-to-date.
         1>Checking Build System
       FinalizeBuildStatus:
         Deleting file "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
         Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
     2>Done Building Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ZERO_CHECK.vcxproj" (default targets).
     1>Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\INSTALL.vcxproj" (1) is building "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ALL_BUILD.vcxproj" (3) on node 2 (default targets).
     3>PrepareForBuild:
         Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See https://aka.ms/cpp/structured-output for more details.
       InitializeBuildStatus:
         Creating "x64\Release\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
         Touching "x64\Release\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild".
       CustomBuild:
         All outputs are up-to-date.
         Building Custom Rule C:/Users/runneradmin/AppData/Local/.xmake/cache/packages/2408/c/cpp-httplib/0.16.2/source/CMakeLists.txt
       FinalizeBuildStatus:
         Deleting file "x64\Release\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild".
         Touching "x64\Release\ALL_BUILD\ALL_BUILD.tlog\ALL_BUILD.lastbuildstate".
     3>Done Building Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ALL_BUILD.vcxproj" (default targets).
     1>PrepareForBuild:
         Creating directory "x64\Release\INSTALL\".
         Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See https://aka.ms/cpp/structured-output for more details.
         Creating directory "x64\Release\INSTALL\INSTALL.tlog\".
       InitializeBuildStatus:
         Creating "x64\Release\INSTALL\INSTALL.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
         Touching "x64\Release\INSTALL\INSTALL.tlog\unsuccessfulbuild".
       CustomBuild:
         1>
       PostBuildEvent:
         setlocal
         "C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake
         if %errorlevel% neq 0 goto :cmEnd
         :cmEnd
         endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
         :cmErrorLevel
         exit /b %1
         :cmDone
         if %errorlevel% neq 0 goto :VCEnd
         :VCEnd
         -- Install configuration: "Release"
         -- Installing: C:/Users/runneradmin/AppData/Local/.xmake/packages/c/cpp-httplib/0.16.2/d56609da04044b6f922d01a2e88a922b/include/httplib.h
         -- Installing: C:/Users/runneradmin/AppData/Local/.xmake/packages/c/cpp-httplib/0.16.2/d56609da04044b6f922d01a2e88a922b/lib/cmake/httplib/httplibConfig.cmake
         -- Installing: C:/Users/runneradmin/AppData/Local/.xmake/packages/c/cpp-httplib/0.16.2/d56609da04044b6f922d01a2e88a922b/lib/cmake/httplib/httplibConfigVersion.cmake
         -- Installing: C:/Users/runneradmin/AppData/Local/.xmake/packages/c/cpp-httplib/0.16.2/d56609da04044b6f922d01a2e88a922b/lib/cmake/httplib/FindBrotli.cmake
         -- Installing: C:/Users/runneradmin/AppData/Local/.xmake/packages/c/cpp-httplib/0.16.2/d56609da04044b6f922d01a2e88a922b/lib/cmake/httplib/httplibTargets.cmake
         -- Installing: C:/Users/runneradmin/AppData/Local/.xmake/packages/c/cpp-httplib/0.16.2/d56609da04044b6f922d01a2e88a922b/share/doc/httplib/README.md
         -- Installing: C:/Users/runneradmin/AppData/Local/.xmake/packages/c/cpp-httplib/0.16.2/d56609da04044b6f922d01a2e88a922b/share/licenses/httplib/LICENSE
       FinalizeBuildStatus:
         Deleting file "x64\Release\INSTALL\INSTALL.tlog\unsuccessfulbuild".
         Touching "x64\Release\INSTALL\INSTALL.tlog\INSTALL.lastbuildstate".
     1>Done Building Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\INSTALL.vcxproj" (default targets).

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.59
checking for xmake::cpp-httplib ... cpp-httplib 0.16.2
{ 
  version = "0.16.2",
  license = "MIT",
  defines = "CPPHTTPLIB_OPENSSL_SUPPORT",
  sysincludedirs = { 
    "C:\Users\runneradmin\AppData\Local\.xmake\packages\c\cpp-httplib\0.16.2\d56609da04044b6f922d01a2e88a922b\include", 
  }, 
}

patching C:\Users\runneradmin\AppData\Local\.xmake\packages\c\cpp-httplib\0.16.2\d56609da04044b6f922d01a2e88a922b\lib\pkgconfig\cpp-httplib.pc ..
> checking for c++ includes(httplib.h)
> checking for c++ links(libssl, libcrypto, ws2_32, user32, crypt32, advapi32)
> checking for c++ snippet(test)
  => install cpp-httplib 0.16.2 .. ok
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/libuv-v1.48.0/windows-x64-vc14.40.33807-83f3f0de210f4e5d8f46bd668e3ee167.7z -o windows-x64-vc14.40.33807-83f3f0de210f4e5d8f46bd668e3ee167.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
100     9  100     9    0     0     33      0 --:--:-- --:--:-- --:--:--    33
100     9  100     9    0     0     33      0 --:--:-- --:--:-- --:--:--    33
error: unmatched checksum, current hash(0019dfc4) != original hash(d777b4f2)
  => download https://github.com/xmake-mirror/build-artifacts/releases/download/libuv-v1.48.0/windows-x64-vc14.40.33807-83f3f0de210f4e5d8f46bd668e3ee167.7z .. failed

we can also download these packages manually:
  - https://github.com/xmake-mirror/build-artifacts/releases/download/libuv-v1.48.0/windows-x64-vc14.40.33807-83f3f0de210f4e5d8f46bd668e3ee167.7z
to the local search directories: 
  - windows-x64-vc14.40.33807-83f3f0de210f4e5d8f46bd668e3ee167.7z, libuv-v1.48.0.7z
and we can run `xmake g --pkg_searchdirs=/xxx` to set the search directories.
error: 
warning: perhaps the local binary repository is not up to date, please run `xrepo update-repo` to update it and try again!
Error: Process completed with exit code 1.
Issues-translate-bot commented 2 months ago

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


Title: libuv hash value mismatch

Xmake version

v2.9.4+HEAD.e85b001f1

Operating system version and architecture

Microsoft Windows Server 2022 10.0.20348 Datacenter

Describe the problem

When I was building the project, I encountered a hash error reported by github action. Currently, my local build is successful (maybe because the build cache and repo before xmake are not up to date), but it fails on github.

In this xmake.lua script, I also used add_requireconfs to force openssl to 3.3.1, because if not, github action will also use version 1.1.1-w to build cpp-httplib, but cpp-httplib does not support it. openssl

Expected results

I hope github action can be built correctly

Project configuration

add_rules("mode.debug", "mode.release")
add_rules("plugin.vsxmake.autoupdate")

add_repositories("liteldev-repo https://github.com/LiteLDev/xmake-repo.git")

-- Dependencies from xmake-repo.
add_requires("fmt")
add_requires("magic_enum")
add_requires("nlohmann_json")
add_requires("cpp-httplib", {configs = {ssl = true}})
add_requireconfs("cpp-httplib.openssl3", {override = true, version = "3.3.1"})
add_requires("uwebsockets", {configs = {zip = true}})
add_requireconfs("uwebsockets.usockets", {configs = {ssl = "openssl3"}})
add_requireconfs("uwebsockets.usockets.openssl3", {override = true, version = "3.3.1"})

-- Dependencies from liteldev-repo.
add_requires("pfr 2.1.1")
add_requires("expected-lite v0.7.0")
add_requires("ctre 3.8.1")

target("SkyDreamBotBeta")
    set_kind("binary")
    add_files(
"src/**.cpp",
"src/**.ixx",
"src/**.rc"
)
set_configdir("$(buildir)/config")
    set_configvar("SDB_WORKSPACE_FOLDER", "$(projectdir)")
    add_configfiles("src/(Version.h.in)")
    add_headerfiles(
        "src/**.inl","src/**.h"
    )
    add_includedirs(
        "src/", "$(buildir)/config"
    )
    add_cxflags(
        "/utf-8",
        "/permissive-",
        "/W4",
        "/w44265",
        "/w44289",
        "/w44296",
        "/w45263",
        "/w44738",
        "/w45204",
        "/experimental:module"
    )
    add_cxflags(
        "/EHs",
        "-Wno-microsoft-cast",
        "-Wno-invalid-offsetof",
        "-Wno-c++2b-extensions",
        "-Wno-microsoft-include",
        "-Wno-overloaded-virtual",
        "-Wno-ignored-qualifiers",
        "-Wno-potentially-evaluated-expression",
        "-Wno-pragma-system-header-outside-header",
        {tools = {"clang_cl"}}
    )
    add_defines(
        "_CRT_SECURE_NO_WARNINGS",
        "_ENABLE_CONSTEXPR_MUTEX_CONSTRUCTOR",
        "NOMINMAX",
        "UNICODE",
        "WIN32_LEAN_AND_MEAN"
    )
    add_packages(
        "fmt",
        "expected-lite",
        "magic_enum",
        "nlohmann_json",
        "cpp-httplib",
        "uwebsockets",
        "ctre",
        "pfr"
    )
    set_languages("c++23")
    set_symbols("debug")

    if is_mode("debug") then
        add_defines("SDB_DEBUG")
    end

    on_load(function (target)
        local tag = os.iorun("git describe --tags --abbrev=0 --always")
        local major, minor, patch, suffix = tag:match("v(%d+)%.(%d+)%.(%d+)(.*)")
        if not major then
            print("Failed to parse version tag, using 0.0.0")
            major, minor, patch = 0, 0, 0
        end
        if suffix then
            prerelease = suffix:match("-(.*)")
            if prerelease then
                prerelease = prerelease:gsub("\n", "")
            end
            if prerelease then
                target:set("configvar", "SDB_VERSION_PRERELEASE", prerelease)
            end
        end
        target:set("configvar", "SDB_VERSION_MAJOR", major)
        target:set("configvar", "SDB_VERSION_MINOR", minor)
        target:set("configvar", "SDB_VERSION_PATCH", patch)
    end)
target_end()
on:
  pull_request:
  push:
  workflow_dispatch:

jobs:
  build:
    strategy:
      matrix:
        mode:
          -debug
          - release
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v4

      - uses: xmake-io/github-action-setup-xmake@v1

      - uses: actions/cache@v4
        with:
          path: |
            ~/AppData/Local/.xmake
          key: xmake-${{ hashFiles('xmake.lua') }}
          restore-keys: |
            xmake-

      - run: |
          xmake repo -u

      - run: |
          xmake f -a x64 -m ${{ matrix.mode }} -p windows -v -y

      - run: |
          xmake -v -w -y

      - uses: actions/upload-artifact@v4
        with:
          name: ${{ github.event.repository.name }}-${{ matrix.mode }}-windows-x64-${{ github.sha }}
          path: |
            build/windows/x64/release/

Additional information and error logs

checking for xmake::openssl3 ... openssl3 3.3.1
{
  version = "3.3.1",
  shared = true,
  static = true,
  sysincludedirs = {
    "C:\Users\runneradmin\AppData\Local\.xmake\packages\o\openssl3\3.3.1\989cdc3d6a3b4f30a5d1e26b25717a5b\include",
  },
  license = "Apache-2.0",
  links = {
    "libssl",
    "libcrypto",
  },
  libfiles = {
    "C:\Users\runneradmin\AppData\Local\.xmake\packages\o\openssl3\3.3.1\989cdc3d6a3b4f30a5d1e26b25717a5b\lib\libssl.lib",
    "C:\Users\runneradmin\AppData\Local\.xmake\packages\o\openssl3\3.3.1\989cdc3d6a3b4f30a5d1e26b25717a5b\lib\libcrypto.lib",
    "C:\Users\runneradmin\AppData\Local\.xmake\packages\o\openssl3\3.3.1\989cdc3d6a3b4f30a5d1e26b25717a5b\lib\ossl-modules\legacy.dll",
  },
  linkdirs = {
    "C:\Users\runneradmin\AppData\Local\.xmake\packages\o\openssl3\3.3.1\989cdc3d6a3b4f30a5d1e26b25717a5b\lib",
  },
  syslinks = {
    "ws2_32",
    "user32",
    "crypt32",
    "advapi32",
  },
}

patching C:\Users\runneradmin\AppData\Local\.xmake\packages\o\openssl3\3.3.1\989cdc3d6a3b4f30a5d1e26b25717a5b\lib\pkgconfig\openssl3.pc ..
checking for flags (-MT) ... ok
checking for flags (cl_external_includedir) ... ok
> checking for c includes(openssl/ssl.h)
> checking for c funcs(SSL_new)
> checking for c links(libssl, libcrypto, ws2_32, user32, crypt32, advapi32)
> checking for c snippet(has_cfuncs)
  => install openssl3 3.3.1 .. ok
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/yhirose/cpp-httplib/archive/v0.16.2.tar.gz -o v0.16.2.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
  0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0

100 1130k 0 1130k 0 0 1884k 0 --:--:-- --:--:-- --:--:-- 1884k
C:\hostedtoolcache\windows\xmake\2.9.4\x64\winenv\bin\7z x -y v0.16.2.tar.gz -oC:\Users\RUNNER~1\AppData\Local\Temp\.xmake\240814 \_358564C8AF684C308AE43683D04BA190.tar

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

Scanning the drive for archives:
1 file, 1157538 bytes (1131 KiB)

Extracting archive: v0.16.2.tar.gz
--
Path = v0.16.2.tar.gz
Type=gzip
Headers Size = 10

Everything is Ok

Size: 7895040
Compressed: 1157538
C:\hostedtoolcache\windows\xmake\2.9.4\x64\winenv\bin\7z x -y C:\Users\RUNNER~1\AppData\Local\Temp\.xmake\240814\_358564C8AF684C308AE[4368](https: //github.com/Lovelylavender4/SkyDreamBotBeta/actions/runs/10395442144/job/28787461994#step:7:4369)3D04BA190.tar\v0.16.2.tar -osource.tmp

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

Scanning the drive for archives:
1 file, 7895040 bytes (7710 KiB)

Extracting archive: C:\Users\RUNNER~1\AppData\Local\Temp\.xmake\240814\_358564C8AF684C308AE43683D04BA190.tar\v0.16.2.tar
--
Path = C:\Users\RUNNER~1\AppData\Local\Temp\.xmake\240814\_358564C8AF684C308AE43683D04BA190.tar\v0.16.2.tar
Type=tar
Physical Size = 7895040
Headers Size = 51712
Code Page = UTF-8

Everything is Ok

Folders: 16
Files: 82
Size: 7822287
Compressed: 7895040
  => download https://github.com/yhirose/cpp-httplib/archive/v0.16.2.tar.gz .. ok
C:\Program Files\CMake\bin\cmake -DHTTPLIB_COMPILE=OFF -DBUILD_SHARED_LIBS=OFF -DHTTPLIB_REQUIRE_OPENSSL=ON -DHTTPLIB_REQUIRE_ZLIB=OFF -DHTTPLIB_REQUIRE_BROTLI=OFF -DHTTPLIB_NO_EXCEPTIONS=OFF -DCMAKE_INSTALL_PREFIX=C:\ Users\runneradmin\AppData\Local\. xmake\packages\c\cpp-httplib\0.16.2\d56609da04044b6f922d01a2e88a922b -DCMAKE_INSTALL_LIBDIR:PATH=lib -G "Visual Studio 17 2022" -A x64 -DCMAKE_GENERATOR_TOOLSET=v143 -DCMAKE_COMPILE_PDB_OUTPUT _DIRECTORY=pdb -DCMAKE_POSITION_INDEPENDENT_CODE=ON "-DCMAKE_EXE_LINKER_FLAGS_RELEASE=/machine :x64 /INCREMENTAL:NO" -DCMAKE_STATIC_LINKER_FLAGS_RELEASE=/machine:x64 "-DCMAKE_C_FLAGS_RELEASE=/DWIN32 /D_WINDOWS /W3 /O2 /Ob2 /DNDEBUG" "-DCMAKE_SHARED_LINKER_FLAGS_RELEASE=/machine:x64 :NO" "-DCMAKE_CXX_FLAGS_RELEASE=/DWIN32 /D_WINDOWS /W3 /GR /EHsc /O2 /Ob2 /DNDEBUG" C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source
-- The CXX compiler identification is MSVC 19.40.33813.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
-- Found OpenSSL: C:/Users/runneradmin/AppData/Local/.xmake/packages/o/openssl3/3.3.1/989cdc3d6a3b4f30a5d1e26b25717a5b/lib/libcrypto.lib (found suitable version "3.3.1", minimum required is " 3.0.0") found components: Crypto SSL
--Configuring done (6.0s)
-- Generating done (0.0s)
CMake Warning:
  Manually-specified variables were not used by the project:

    CMAKE_COMPILE_PDB_OUTPUT_DIRECTORY
    CMAKE_C_FLAGS_RELEASE

-- Build files have been written to: C:/Users/runneradmin/AppData/Local/.xmake/cache/packages/2408/c/cpp-httplib/0.16.2/source/build_d56609da
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\msbuild.exe C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib \0.16.2\source\build_d56609da\httplib.sln -t:Rebuild /nr:false -nologo -m:3 -p:Configuration=Release -p:Platform=x64 /p:PlatformToolset=v143
Build started 8/14/2024 9:50:04 PM.

     1>Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\httplib.sln" on node 1 (Rebuild target(s )).
     1>ValidateSolutionConfiguration:
         Building solution configuration "Release|x64".
       ValidateProjects:
         The project "INSTALL" is not selected for building in solution configuration "Release|x64".
     1>Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\httplib.sln" (1) is building "C: \Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ZERO_CHECK.vcxproj" (3) on node 2 (Rebuild target(s)).
     3>CoreClean:
         Creating directory "x64\Release\ZERO_CHECK\".
       PrepareForBuild:
         Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See https://aka.ms/cpp/structured-output for more details.
         Creating directory "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\".
       InitializeBuildStatus:
         Creating "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
         Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
       CustomBuild:
         1>Checking Build System
       FinalizeBuildStatus:
         Deleting file "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
         Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
     3>Done Building Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ZERO_CHECK.vcxproj" (Rebuild target(s) ).
     1>Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\httplib.sln" (1) is building "C: \Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ALL_BUILD.vcxproj.metaproj" (2) on node 1 (Rebuild target(s) ).
     2>Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ALL_BUILD.vcxproj.metaproj" (2) is building " C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ALL_BUILD.vcxproj" (4) on node 1 (Rebuild target(s) ).
     4>CoreClean:
         Creating directory "x64\Release\ALL_BUILD\".
       PrepareForBuild:
         Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See https://aka.ms/cpp/structured-output for more details.
         Creating directory "x64\Release\ALL_BUILD\ALL_BUILD.tlog\".
       InitializeBuildStatus:
         Creating "x64\Release\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
         Touching "x64\Release\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild".
       CustomBuild:
         Building Custom Rule C:/Users/runneradmin/AppData/Local/.xmake/cache/packages/2408/c/cpp-httplib/0.16.2/source/CMakeLists.txt
       FinalizeBuildStatus:
         Deleting file "x64\Release\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild".
         Touching "x64\Release\ALL_BUILD\ALL_BUILD.tlog\ALL_BUILD.lastbuildstate".
     4>Done Building Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ALL_BUILD.vcxproj" (Rebuild target(s) ).
     2>Done Building Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ALL_BUILD.vcxproj.metaproj" (Rebuild target( s)).
     1>Done Building Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\httplib.sln" (Rebuild target(s) ).

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.78
C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Current\Bin\amd64\msbuild.exe INSTALL.vcxproj -nologo -m:3 -p:Configuration=Release -p:Platform=x64 /p:PlatformToolset =v143
Build started 8/14/2024 9:50:05 PM.

     1>Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\INSTALL.vcxproj" on node 1 (default targets).
     1>Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\INSTALL.vcxproj" (1) is building "C: \Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ZERO_CHECK.vcxproj" (2) on node 1 (default targets).
     2>PrepareForBuild:
         Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See https://aka.ms/cpp/structured-output for more details.
       InitializeBuildStatus:
         Creating "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
         Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
       CustomBuild:
         All outputs are up-to-date.
         1>Checking Build System
       FinalizeBuildStatus:
         Deleting file "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\unsuccessfulbuild".
         Touching "x64\Release\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate".
     2>Done Building Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ZERO_CHECK.vcxproj" (default targets).
     1>Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\INSTALL.vcxproj" (1) is building "C: \Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ALL_BUILD.vcxproj" (3) on node 2 (default targets).
     3>PrepareForBuild:
         Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See https://aka.ms/cpp/structured-output for more details.
       InitializeBuildStatus:
         Creating "x64\Release\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
         Touching "x64\Release\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild".
       CustomBuild:
         All outputs are up-to-date.
         Building Custom Rule C:/Users/runneradmin/AppData/Local/.xmake/cache/packages/2408/c/cpp-httplib/0.16.2/source/CMakeLists.txt
       FinalizeBuildStatus:
         Deleting file "x64\Release\ALL_BUILD\ALL_BUILD.tlog\unsuccessfulbuild".
         Touching "x64\Release\ALL_BUILD\ALL_BUILD.tlog\ALL_BUILD.lastbuildstate".
     3>Done Building Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\ALL_BUILD.vcxproj" (default targets).
     1>PrepareForBuild:
         Creating directory "x64\Release\INSTALL\".
         Structured output is enabled. The formatting of compiler diagnostics will reflect the error hierarchy. See https://aka.ms/cpp/structured-output for more details.
         Creating directory "x64\Release\INSTALL\INSTALL.tlog\".
       InitializeBuildStatus:
         Creating "x64\Release\INSTALL\INSTALL.tlog\unsuccessfulbuild" because "AlwaysCreate" was specified.
         Touching "x64\Release\INSTALL\INSTALL.tlog\unsuccessfulbuild".
       CustomBuild:
         1>
       PostBuildEvent:
         setlocal
         "C:\Program Files\CMake\bin\cmake.exe" -DBUILD_TYPE=Release -P cmake_install.cmake
         if %errorlevel% neq 0 goto :cmEnd
         :cmEnd
         endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone
         :cmErrorLevel
         exit /b %1
         :cmDone
         if %errorlevel% neq 0 goto :VCEnd
         :VCEnd
         -- Install configuration: "Release"
         -- Installing: C:/Users/runneradmin/AppData/Local/.xmake/packages/c/cpp-httplib/0.16.2/d56609da04044b6f922d01a2e88a922b/include/httplib.h
         -- Installing: C:/Users/runneradmin/AppData/Local/.xmake/packages/c/cpp-httplib/0.16.2/d56609da04044b6f922d01a2e88a922b/lib/cmake/httplib/httplibConfig.cmake
         -- Installing: C:/Users/runneradmin/AppData/Local/.xmake/packages/c/cpp-httplib/0.16.2/d56609da04044b6f922d01a2e88a922b/lib/cmake/httplib/httplibConfigVersion.cmake
         -- Installing: C:/Users/runneradmin/AppData/Local/.xmake/packages/c/cpp-httplib/0.16.2/d56609da04044b6f922d01a2e88a922b/lib/cmake/httplib/FindBrotli.cmake
         -- Installing: C:/Users/runneradmin/AppData/Local/.xmake/packages/c/cpp-httplib/0.16.2/d56609da04044b6f922d01a2e88a922b/lib/cmake/httplib/httplibTargets.cmake
         -- Installing: C:/Users/runneradmin/AppData/Local/.xmake/packages/c/cpp-httplib/0.16.2/d56609da04044b6f922d01a2e88a922b/share/doc/httplib/README.md
         -- Installing: C:/Users/runneradmin/AppData/Local/.xmake/packages/c/cpp-httplib/0.16.2/d56609da04044b6f922d01a2e88a922b/share/licenses/httplib/LICENSE
       FinalizeBuildStatus:
         Deleting file "x64\Release\INSTALL\INSTALL.tlog\unsuccessfulbuild".
         Touching "x64\Release\INSTALL\INSTALL.tlog\INSTALL.lastbuildstate".
     1>Done Building Project "C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source\build_d56609da\INSTALL.vcxproj" (default targets).

Build succeeded.
    0 Warning(s)
    0 Error(s)

Time Elapsed 00:00:00.59
checking for xmake::cpp-httplib ... cpp-httplib 0.16.2
{
  version = "0.16.2",
  license = "MIT",
  defines = "CPPHTTPLIB_OPENSSL_SUPPORT",
  sysincludedirs = {
    "C:\Users\runneradmin\AppData\Local\.xmake\packages\c\cpp-httplib\0.16.2\d56609da04044b6f922d01a2e88a922b\include",
  },
}

patching C:\Users\runneradmin\AppData\Local\.xmake\packages\c\cpp-httplib\0.16.2\d56609da04044b6f922d01a2e88a922b\lib\pkgconfig\cpp-httplib.pc ..
> checking for c++ includes(httplib.h)
> checking for c++ links(libssl, libcrypto, ws2_32, user32, crypt32, advapi32)
> checking for c++ snippet(test)
  => install cpp-httplib 0.16.2 .. ok
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/libuv-v1.48.0/windows-x64-vc14.40.33807-83f3f0de210f4e5d8f46bd668e3ee167.7z -o windows-x64-vc14.40.33807-83f3f0de210f4 e5d8f46bd668e3ee167.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
100 9 100 9 0 0 33 0 --:--:-- --:--:-- --:--:-- 33
100 9 100 9 0 0 33 0 --:--:-- --:--:-- --:--:-- 33
error: unmatched checksum, current hash(0019dfc4) != original hash(d777b4f2)
  => download https://github.com/xmake-mirror/build-artifacts/releases/download/libuv-v1.48.0/windows-x64-vc14.40.33807-83f3f0de210f4e5d8f46bd668e3ee167.7z .. failed

we can also download these packages manually:
  - https://github.com/xmake-mirror/build-artifacts/releases/download/libuv-v1.48.0/windows-x64-vc14.40.33807-83f3f0de210f4e5d8f46bd668e3ee167.7z
to the local search directories:
  - windows-x64-vc14.40.33807-83f3f0de210f4e5d8f46bd668e3ee167.7z, libuv-v1.48.0.7z
and we can run `xmake g --pkg_searchdirs=/xxx` to set the search directories.
error:
warning: perhaps the local binary repository is not up to date, please run `xrepo update-repo` to update it and try again!
Error: Process completed with exit code 1.
1143910315 commented 2 months ago

我顺便附上openssl编译报错的吧

add_rules("mode.debug", "mode.release")
add_rules("plugin.vsxmake.autoupdate")

add_repositories("liteldev-repo https://github.com/LiteLDev/xmake-repo.git")

-- Dependencies from xmake-repo.
add_requires("fmt")
add_requires("magic_enum")
add_requires("nlohmann_json")
add_requires("cpp-httplib", {configs = {ssl = true}})
add_requires("uwebsockets", {configs = {zip = true}})
add_requireconfs("uwebsockets.usockets", {configs = {ssl = "openssl3"}})

-- Dependencies from liteldev-repo.
add_requires("pfr 2.1.1")
add_requires("expected-lite v0.7.0")
add_requires("ctre 3.8.1")

target("SkyDreamBotBeta")
    set_kind("binary")
    add_files(
"src/**.cpp",
"src/**.ixx",
"src/**.rc"
)
set_configdir("$(buildir)/config")
    set_configvar("SDB_WORKSPACE_FOLDER", "$(projectdir)")
    add_configfiles("src/(Version.h.in)")
    add_headerfiles(
        "src/**.inl","src/**.h"
    )
    add_includedirs(
        "src/", "$(buildir)/config"
    )
    add_cxflags(
        "/utf-8",
        "/permissive-",
        "/W4",
        "/w44265",
        "/w44289",
        "/w44296",
        "/w45263",
        "/w44738",
        "/w45204",
        "/experimental:module"
    )
    add_cxflags(
        "/EHs",
        "-Wno-microsoft-cast",
        "-Wno-invalid-offsetof",
        "-Wno-c++2b-extensions",
        "-Wno-microsoft-include",
        "-Wno-overloaded-virtual",
        "-Wno-ignored-qualifiers",
        "-Wno-potentially-evaluated-expression",
        "-Wno-pragma-system-header-outside-header",
        {tools = {"clang_cl"}}
    )
    add_defines(
        "_CRT_SECURE_NO_WARNINGS",
        "_ENABLE_CONSTEXPR_MUTEX_CONSTRUCTOR",
        "NOMINMAX",
        "UNICODE",
        "WIN32_LEAN_AND_MEAN"
    )
    add_packages(
        "fmt",
        "expected-lite",
        "magic_enum",
        "nlohmann_json",
        "cpp-httplib",
        "uwebsockets",
        "ctre",
        "pfr"
    )
    set_languages("c++23")
    set_symbols("debug")

    if is_mode("debug") then
        add_defines("SDB_DEBUG")
    end

    on_load(function (target)
        local tag = os.iorun("git describe --tags --abbrev=0 --always")
        local major, minor, patch, suffix = tag:match("v(%d+)%.(%d+)%.(%d+)(.*)")
        if not major then
            print("Failed to parse version tag, using 0.0.0")
            major, minor, patch = 0, 0, 0
        end
        if suffix then
            prerelease = suffix:match("-(.*)")
            if prerelease then
                prerelease = prerelease:gsub("\n", "")
            end
            if prerelease then
                target:set("configvar", "SDB_VERSION_PRERELEASE", prerelease)
            end
        end
        target:set("configvar", "SDB_VERSION_MAJOR", major)
        target:set("configvar", "SDB_VERSION_MINOR", minor)
        target:set("configvar", "SDB_VERSION_PATCH", patch)
    end)
target_end()
=> download https://github.com/nlohmann/json/archive/v3.11.3.tar.gz .. ok
checking for xmake::nlohmann_json ... nlohmann_json v3.11.3
{ 
  sysincludedirs = { 
    "C:\Users\runneradmin\AppData\Local\.xmake\packages\n\nlohmann_json\v3.11.3\826582eb66794908a16a49dbdd33bec4\include", 
  },
  license = "MIT",
  version = "v3.11.3", 
}

patching C:\Users\runneradmin\AppData\Local\.xmake\packages\n\nlohmann_json\v3.11.3\826582eb66794908a16a49dbdd33bec4\lib\pkgconfig\nlohmann_json.pc ..
> checking for c++ includes(nlohmann/json.hpp)
> checking for c++ snippet(test)
  => install nlohmann_json v3.11.3 .. ok
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/yhirose/cpp-httplib/archive/v0.16.2.tar.gz -o v0.16.2.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
  0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0

100 1130k    0 1130k    0     0  1999k      0 --:--:-- --:--:-- --:--:-- 1999k
C:\hostedtoolcache\windows\xmake\2.9.4\x64\winenv\bin\7z x -y v0.16.2.tar.gz -oC:\Users\RUNNER~1\AppData\Local\Temp\.xmake\240815\_F2E55DE66D374E40843CB0614F5E3EC0.tar

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

Scanning the drive for archives:
1 file, 1157538 bytes (1131 KiB)

Extracting archive: v0.16.2.tar.gz
--
Path = v0.16.2.tar.gz
Type = gzip
Headers Size = 10

Everything is Ok

Size:       7895040
Compressed: 1157538
C:\hostedtoolcache\windows\xmake\2.9.4\x64\winenv\bin\7z x -y C:\Users\RUNNER~1\AppData\Local\Temp\.xmake\240815\_F2E55DE66D374E40843CB0614F5E3EC0.tar\v0.16.2.tar -osource.tmp

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

Scanning the drive for archives:
1 file, 7895040 bytes (7710 KiB)

Extracting archive: C:\Users\RUNNER~1\AppData\Local\Temp\.xmake\240815\_F2E55DE66D374E40843CB0614F5E3EC0.tar\v0.16.2.tar
--
Path = C:\Users\RUNNER~1\AppData\Local\Temp\.xmake\240815\_F2E55DE66D374E40843CB0614F5E3EC0.tar\v0.16.2.tar
Type = tar
Physical Size = 7895040
Headers Size = 51712
Code Page = UTF-8

Everything is Ok

Folders: 16
Files: 82
Size:       7822287
Compressed: 7895040
  => download https://github.com/yhirose/cpp-httplib/archive/v0.16.2.tar.gz .. ok
C:\Program Files\CMake\bin\cmake -DHTTPLIB_COMPILE=OFF -DBUILD_SHARED_LIBS=OFF -DHTTPLIB_REQUIRE_OPENSSL=ON -DHTTPLIB_REQUIRE_ZLIB=OFF -DHTTPLIB_REQUIRE_BROTLI=OFF -DHTTPLIB_NO_EXCEPTIONS=OFF -DCMAKE_INSTALL_PREFIX=C:\Users\runneradmin\AppData\Local\.xmake\packages\c\cpp-httplib\0.16.2\d56609da0[404](https://github.com/Lovelylavender4/SkyDreamBotBeta/actions/runs/10400121987/job/28800113373#step:6:405)4b6f922d01a2e88a922b -DCMAKE_INSTALL_LIBDIR:PATH=lib -G "Visual Studio 17 2022" -A x64 -DCMAKE_GENERATOR_TOOLSET=v143 -DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=pdb -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_STATIC_LINKER_FLAGS_RELEASE=/machine:x64 "-DCMAKE_SHARED_LINKER_FLAGS_RELEASE=/machine:x64 /INCREMENTAL:NO" "-DCMAKE_EXE_LINKER_FLAGS_RELEASE=/machine:x64 /INCREMENTAL:NO" "-DCMAKE_CXX_FLAGS_RELEASE=/DWIN32 /D_WINDOWS /W3 /GR /EHsc  /O2 /Ob2 /DNDEBUG" "-DCMAKE_C_FLAGS_RELEASE=/DWIN32 /D_WINDOWS /W3  /O2 /Ob2 /DNDEBUG" C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2[408](https://github.com/Lovelylavender4/SkyDreamBotBeta/actions/runs/10400121987/job/28800113373#step:6:409)\c\cpp-httplib\0.16.2\source
-- The CXX compiler identification is MSVC 19.40.33813.0
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Check for working CXX compiler: C:/Program Files/Microsoft Visual Studio/2022/Enterprise/VC/Tools/MSVC/14.40.33807/bin/Hostx64/x64/cl.exe - skipped
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - not found
-- Found Threads: TRUE
CMake Error at C:/Program Files/CMake/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:233 (message):
  Could NOT find OpenSSL, try to set the path to OpenSSL root folder in the
-- Configuring incomplete, errors occurred!
  system variable OPENSSL_ROOT_DIR: Found unsuitable version "1.1.1w", but
  required is at least "3.0.0" (found optimized;C:/Program
  Files/OpenSSL/lib/VC/libcrypto64MD.lib;debug;C:/Program
  Files/OpenSSL/lib/VC/libcrypto64MDd.lib, found components: Crypto SSL)
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.30/Modules/FindPackageHandleStandardArgs.cmake:601 (_FPHSA_FAILURE_MESSAGE)
  C:/Program Files/CMake/share/cmake-3.30/Modules/FindOpenSSL.cmake:689 (find_package_handle_standard_args)
  CMakeLists.txt:121 (find_package)

error: execv(C:\Program Files\CMake\bin\cmake -DHTTPLIB_COMPILE=OFF -DBUILD_SHARED_LIBS=OFF -DHTTPLIB_REQUIRE_OPENSSL=ON -DHTTPLIB_REQUIRE_ZLIB=OFF -DHTTPLIB_REQUIRE_BROTLI=OFF -DHTTPLIB_NO_EXCEPTIONS=OFF -DCMAKE_INSTALL_PREFIX=C:\Users\runneradmin\AppData\Local\.xmake\packages\c\cpp-httplib\0.16.2\d56609da04044b6f922d01a2e88a922b -DCMAKE_INSTALL_LIBDIR:PATH=lib -G "Visual Studio 17 2022" -A x64 -DCMAKE_GENERATOR_TOOLSET=v143 -DCMAKE_COMPILE_PDB_OUTPUT_DIRECTORY=pdb -DCMAKE_POSITION_INDEPENDENT_CODE=ON -DCMAKE_STATIC_LINKER_FLAGS_RELEASE=/machine:x64 "-DCMAKE_SHARED_LINKER_FLAGS_RELEASE=/machine:x64 /INCREMENTAL:NO" "-DCMAKE_EXE_LINKER_FLAGS_RELEASE=/machine:x64 /INCREMENTAL:NO" "-DCMAKE_CXX_FLAGS_RELEASE=/DWIN32 /D_WINDOWS /W3 /GR /EHsc  /O2 /Ob2 /DNDEBUG" "-DCMAKE_C_FLAGS_RELEASE=/DWIN32 /D_WINDOWS /W3  /O2 /Ob2 /DNDEBUG" C:\Users\runneradmin\AppData\Local\.xmake\cache\packages\2408\c\cpp-httplib\0.16.2\source) failed(1)
  => install cpp-httplib 0.16.2 .. failed
error: install failed!
Error: Process completed with exit code 1.
star-hengxing commented 2 months ago

我在构建项目的时候遇到了github action报hash错误,目前我本地构建是可以成功的(可能是因为xmake之前的构建缓存和repo非最新),github上是失败的

预编译包校验暂时不知道啥问题,可以先用 policy 禁用

在这个xmake.lua脚本中,我还用了add_requireconfs强制openssl是3.3.1,因为不这样做的话,github action还会使用1.1.1-w版本去构建cpp-httplib,但是cpp-httplib是不支持openssl的

这个问题很久了,暂时没想到好办法来解决 https://github.com/xmake-io/xmake/issues/4965

Issues-translate-bot commented 2 months ago

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


I encountered a hash error reported by github action when building the project. Currently, my local build is successful (maybe because the build cache and repo before xmake are not up to date), but it fails on github.

I don’t know what the problem is with precompiled package verification. You can use policy to disable it first.

In this xmake.lua script, I also used add_requireconfs to force openssl to 3.3.1, because if not, github action will also use the 1.1.1-w version to build cpp-httplib, but cpp-httplib is not Support openssl

This problem has been around for a long time and I haven’t thought of a good way to solve it yet https://github.com/xmake-io/xmake/issues/4965

1143910315 commented 2 months ago

我在构建项目的时候遇到了github action报hash错误,目前我本地构建是可以成功的(可能是因为xmake之前的构建缓存和repo非最新),github上是失败的

预编译包校验暂时不知道啥问题,可以先用 policy 禁用

https://github.com/xmake-mirror/build-artifacts/blob/main/packages/l/libuv/v1.48.0/manifest.txt 第63行的链接 https://github.com/xmake-mirror/build-artifacts/releases/download/libuv-v1.48.0/windows-x64-vc14.40.33807-83f3f0de210f4e5d8f46bd668e3ee167.7z 这个地址是无效的 https://github.com/xmake-mirror/build-artifacts/releases/tag/libuv-v1.48.0

1143910315 commented 2 months ago

github action里curl下载的是github的404页面,所以第一个哈希值对不上

1143910315 commented 2 months ago

第二个openssl的问题,我可以用add_requireconfs("cpp-httplib.openssl3", {override = true, version = "3.3.1"})指定版本,并在github action上编译成功,是不是说明xmake在哪里可以限制版本必须大于等于3呢,从而避免找到1.1.1w版本的?

Issues-translate-bot commented 2 months ago

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


The second openssl question, I can use add_requireconfs("cpp-httplib.openssl3", {override = true, version = "3.3.1"}) to specify the version and compile it successfully on github action. Does this mean that xmake is running? Where can we restrict the version to be greater than or equal to 3, so as to avoid finding version 1.1.1w?

waruqi commented 2 months ago

github action里curl下载的是github的404页面,所以第一个哈希值对不上

build_artifacts ci 上,就单 windows-x64-vc14.40.33807-83f3f0de210f4e5d8f46bd668e3ee167.7z 这一个 binary 上传到 releases 偶发性 502 失败了。

https://github.com/xmake-mirror/build-artifacts/actions/runs/10250816985/job/28357399702

HTTP 502: Server Error (https://api.github.com/repos/xmake-mirror/build-artifacts/releases/assets/174125550)

可以看到其他 binary 上传都成功了,就这么一个,这种也没啥好的办法。

https://github.com/xmake-mirror/build-artifacts/actions/runs/10250950282/job/28357847461

之后遇到这种,可以直接提 pr https://github.com/xmake-mirror/build-artifacts/blob/build/build.txt 手动触发 libuv 的预编译 ci ,重跑下就行了。。

我刚提交重跑,等跑完,更新下仓库再试下。。https://github.com/xmake-mirror/build-artifacts/actions/runs/10420666747

star-hengxing commented 2 months ago

第二个openssl的问题,我可以用add_requireconfs("cpp-httplib.openssl3", {override = true, version = "3.3.1"})指定版本,并在github action上编译成功,是不是说明xmake在哪里可以限制版本必须大于等于3呢,从而避免找到1.1.1w版本的?

修了,这里 ci 测试没问题 https://github.com/xmake-io/xmake-repo/pull/4955

Issues-translate-bot commented 2 months ago

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


The second openssl question, I can use add_requireconfs("cpp-httplib.openssl3", {override = true, version = "3.3.1"}) to specify the version and compile successfully on github action. Does it mean xmake Where can I restrict the version to be greater than or equal to 3, so as to avoid finding version 1.1.1w?

Fixed it, the ci test here is no problem https://github.com/xmake-io/xmake-repo/pull/4955

star-hengxing commented 2 months ago

想了一下有点麻烦。凡是依赖了 openssl 的包都要手动设置路径,但硬编码在 xmake 源码又有点不好。

Issues-translate-bot commented 2 months ago

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


It's a bit troublesome after thinking about it. All packages that depend on openssl must set the path manually, but hard-coding it in the xmake source code is a bit bad.