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

Update capnproto to branch and with version 1.0.2 #4780

Merged
merged 12 commits into from
Feb 2, 2025
Merged

Conversation

chriku
Copy link
Contributor

@chriku chriku commented Jul 29, 2024

Update Cap’n Proto with the current release and add the ability to use the git branch, should get Cap’n Proto in a usable state, if combined with xmake-io/xmake#5406

@chriku chriku marked this pull request as draft July 29, 2024 00:56
@chriku chriku marked this pull request as ready for review July 29, 2024 02:12
@chriku
Copy link
Contributor Author

chriku commented Jul 29, 2024

capnproto/capnproto#1833 it seems they need an additional library? i have just added the syslinks, but cannot test it as i cannot set up a mingw right now, so i added it to the existing new windows block

@chriku
Copy link
Contributor Author

chriku commented Jul 29, 2024

it seems that they broke support for arm-dos by using __popcnt, which they don't have and mingw is missing the weidest functions which are only ever mentioned in an open cap'n proto issue (capnproto/capnproto#1833). I have it running on linux, but i lack any motivation to fight windows to get the pipeline running. how should i proceed?

@waruqi
Copy link
Member

waruqi commented Jul 30, 2024

apply patch to support it or disable windows/arm

@mirageAlchemy
Copy link
Contributor

mirageAlchemy commented Jan 21, 2025

@chriku Hi, I have to depend on the v1 capnproto as well. I figure we could proceed by banning the windows arm builds and mingw build for now? I drafted a version below:

package("capnproto")

    set_homepage("https://github.com/capnproto/capnproto")
    set_description("Cap'n Proto serialization/RPC system - core tools and C++ library.")
    set_license("MIT")

    add_urls("https://github.com/capnproto/capnproto/archive/v$(version).zip")
    add_urls("https://github.com/capnproto/capnproto.git")

    add_versions("1.1.0", "cefc757d4ee07acb17070b0c5c90bfa106b79468670869052246712bf8781fd9")
    add_versions("1.0.2", "3c9afa5dffa4d81a3cbd0581a15a5b1633feaf43093a3b108aded0f636622752")
    add_versions("0.9.0", "18cf46aa4e05446a3d34bad8d56f9d0c73e72020a2b7548b6ec7cb7b1a828d5b")
    add_versions("0.8.0", "9a5e090b1f3ad39bb47fed5fd03672169493674ce273418b76c868393fced2e4")
    add_versions("0.7.0", "1054a879e174b8f797f1b506fedb14ecba5556c656e33ac51bd0a62bd90f925f")

    add_linkorders("capnpc", "capnp-json")
    add_linkorders("capnpc", "capnp-rpc")
    add_linkorders("capnp-json", "capnp")
    add_linkorders("capnp-json", "kj-http")
    add_linkorders("capnp-rpc", "capnp")
    add_linkorders("capnp-rpc", "kj-http")
    add_linkorders("capnp", "kj-test")
    add_linkorders("capnp", "kj-http")
    add_linkorders("capnp", "kj-async")
    add_linkorders("kj-async", "kj")
    add_linkorders("kj-test", "kj")
    add_linkorders("kj-gzip", "kj-async")
    add_linkorders("kj-tls", "kj-async")
    add_linkorders("kj-http", "kj-async")

    if is_plat("windows") then
        add_configs("shared", {description = "Build shared library.", default = false, type = "boolean", readonly = true})
    end
    if is_plat("windows", "mingw") then
        add_syslinks("ws2_32")
    end

    add_deps("cmake", "zlib")

    -- Add on_check to fail for version greater than 1.0.2 on Windows ARM and MingW
    on_check(function (package)
        if package:version() >= "1.0.2" then
            if is_plat("windows") and is_arch("arm*") then
                raise("package(capnproto): Unsupported version on Windows ARM. Version 0.9.0 is the latest supported version on Windows ARM.")
            end
            if is_plat("mingw") then
                raise("package(capnproto): Unsupported version on MingW. Version 0.9.0 is the latest supported version on MingW.")
            end
        end
    end)

    on_install("windows", "mingw@windows,msys", "linux", "macosx", "bsd", function (package)
        local configs = {"-DBUILD_TESTING=OFF"}
        table.insert(configs, "-DCMAKE_BUILD_TYPE=" .. (package:debug() and "Debug" or "Release"))
        table.insert(configs, "-DBUILD_SHARED_LIBS=" .. (package:config("shared") and "ON" or "OFF"))
        import("package.tools.cmake").install(package, configs)
        package:addenv("PATH", "bin")
    end)

    on_test(function (package)
        assert(package:has_cxxtypes("capnp::MallocMessageBuilder", {configs = {languages = "c++14"}, includes = "capnp/message.h"}))
    end)

I succeeded installing v1.1.0 locally on a linux x86 env.

@mirageAlchemy
Copy link
Contributor

hi @chriku , the thing I was worried about is, if we do not include a version check before banning the mingw platform, then those people who was already running 0.9.0 on windows-mingw will have trouble upgrading their xrepo. Do you see this as an issue too? @waruqi should we prefer simplicity over backward compatibility?

@waruqi
Copy link
Member

waruqi commented Jan 31, 2025

hi @chriku , the thing I was worried about is, if we do not include a version check before banning the mingw platform, then those people who was already running 0.9.0 on windows-mingw will have trouble upgrading their xrepo. Do you see this as an issue too? @waruqi should we prefer simplicity over backward compatibility?

We also need to be compatible with lower versions.

@chriku
Copy link
Contributor Author

chriku commented Jan 31, 2025

@mirageAlchemy You are entirely right, my brain did not think of the old versions and I did not trust the on_check part, so I didn't even think. But waruqi seem to have fixed that

  • "Linux (Clang) / build (ubuntu-latest, static) (pull_request)" seems to have died to to unrelated APT error
  • "FreeBSD / build (ubuntu-latest, static) (pull_request)" needs pthread. I'd add a (whelp, waruqi just did that)
  • If we want to keep compatibility, we should probably undo my windows|x86_64 construction and copy your (@mirageAlchemy) on_check, preferably if you can confirm that it does what we hope it does (and not error out in the pipeline for 1.1.0 arm dos or something like that). Should I do that? (I don't want to block if you are already on that). Done, switched to on_check with the clauses given by @mirageAlchemy

@chriku
Copy link
Contributor Author

chriku commented Jan 31, 2025

It seems two tests are borked, but not because of the capnproto changes. Assuming they get fixed, is this PR good enough to merge? Are there any other fixes for capnproto that sould to be done until the pipeline is happy again?

-- Add on_check to fail for version greater than 1.0.2 on Windows ARM and MingW
on_check(function (package)
if package:version() >= "1.0.2" then
if is_plat("windows") and is_arch("arm*") then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package:is_plat/package:is_arch

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arm.*

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package: is done in 62f51cc, arm.* has already been in since 38c47af

if is_plat("windows") and is_arch("arm*") then
raise("package(capnproto): Unsupported version on Windows ARM. Version 0.9.0 is the latest supported version on Windows ARM.")
end
if is_plat("mingw") then
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

and here

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package: is done in 62f51cc

@waruqi waruqi merged commit d0fb307 into xmake-io:dev Feb 2, 2025
71 checks passed
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

Successfully merging this pull request may close these issues.

3 participants