From 39e6098f8a62db43ed7dfd43097e5d40391389fd Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 11 Jan 2025 16:34:28 +1300 Subject: [PATCH 1/6] github/ci: label the win64 container as win64:qt5, not 'latest' --- .github/workflows/miqt.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/miqt.yml b/.github/workflows/miqt.yml index 272f478b..3886f1c8 100644 --- a/.github/workflows/miqt.yml +++ b/.github/workflows/miqt.yml @@ -100,7 +100,7 @@ jobs: key: win64-gocache - name: Win64 docker build - run: docker build -t miqt/win64:latest -f docker/win64-cross-go1.23-qt5.15-static.Dockerfile . + run: docker build -t miqt/win64:qt5 -f docker/win64-cross-go1.23-qt5.15-static.Dockerfile . - name: Win64 bindings compile - run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/win64:latest /bin/bash -c 'cd qt && go build' + run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/win64:qt5 /bin/bash -c 'cd qt && go build' From 46b637a584adf30ccaa1a098d646d7b19938b19d Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 11 Jan 2025 16:35:01 +1300 Subject: [PATCH 2/6] github/ci: add windows 32-bit test --- .github/workflows/miqt.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/miqt.yml b/.github/workflows/miqt.yml index 3886f1c8..0bb2e54c 100644 --- a/.github/workflows/miqt.yml +++ b/.github/workflows/miqt.yml @@ -86,6 +86,25 @@ jobs: - name: Linux64 bindings compile run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/linux64:qt68 /bin/bash -c 'cd qt6 && go build' + miqt_win32_qt5: + runs-on: ubuntu-24.04 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Cache GOCACHE + uses: actions/cache@v4 + with: + path: ~/.cache/go-build + key: win32-gocache + + - name: Win32 docker build + run: docker build -t miqt/win32:qt5 -f docker/win32-cross-go1.23-qt5.15-static.Dockerfile . + + - name: Win32 bindings compile + run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/win32:qt5 /bin/bash -c 'cd qt && go build' + miqt_win64_qt5: runs-on: ubuntu-24.04 From 9093bb128418aae6510d7a058bc9286922b43026 Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 11 Jan 2025 17:18:19 +1300 Subject: [PATCH 3/6] docker: add qt6 mingw-dynamic container --- docker/win64-cross-go1.23-qt6.8-dynamic.Dockerfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 docker/win64-cross-go1.23-qt6.8-dynamic.Dockerfile diff --git a/docker/win64-cross-go1.23-qt6.8-dynamic.Dockerfile b/docker/win64-cross-go1.23-qt6.8-dynamic.Dockerfile new file mode 100644 index 00000000..4827fa39 --- /dev/null +++ b/docker/win64-cross-go1.23-qt6.8-dynamic.Dockerfile @@ -0,0 +1,13 @@ +FROM fedora:41 + +RUN dnf -y --setopt=install_weak_deps=False install \ + mingw64-qt6-qtbase.x86_64 \ + mingw64-gcc.x86_64 \ + mingw64-gcc-c++.x86_64 \ + golang.x86_64 + +ENV CC=x86_64-w64-mingw32-gcc +ENV CXX=x86_64-w64-mingw32-g++ +ENV PKG_CONFIG_PATH=/usr/x86_64-w64-mingw32/sys-root/mingw/lib/pkgconfig/ +ENV GOOS=windows +ENV CGO_ENABLED=1 From d7c019b2a731f0a95f59e1316900e9fe59ad6f4a Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 11 Jan 2025 17:19:50 +1300 Subject: [PATCH 4/6] github/ci: run mingw-w64 qt6 tests in CI --- .github/workflows/miqt.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/.github/workflows/miqt.yml b/.github/workflows/miqt.yml index 0bb2e54c..a1c06fd2 100644 --- a/.github/workflows/miqt.yml +++ b/.github/workflows/miqt.yml @@ -123,3 +123,22 @@ jobs: - name: Win64 bindings compile run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/win64:qt5 /bin/bash -c 'cd qt && go build' + + miqt_win64_qt68: + runs-on: ubuntu-24.04 + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Cache GOCACHE + uses: actions/cache@v4 + with: + path: ~/.cache/go-build + key: win64-gocache + + - name: Win64 docker build + run: docker build -t miqt/win64:qt68 -f docker/win64-cross-go1.23-qt6.8-dynamic.Dockerfile . + + - name: Win64 bindings compile + run: docker run -v ~/.cache/go-build:/root/.cache/go-build -v $PWD:/src -w /src miqt/win64:qt68 /bin/bash -c 'cd qt6 && go build' From f15c54b153354b7063db939f7505f0b5380fef89 Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 11 Jan 2025 17:40:38 +1300 Subject: [PATCH 5/6] genbindings: blocklist QHashSeed::size_t --- cmd/genbindings/config-allowlist.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/cmd/genbindings/config-allowlist.go b/cmd/genbindings/config-allowlist.go index 3b07a6db..1b47f969 100644 --- a/cmd/genbindings/config-allowlist.go +++ b/cmd/genbindings/config-allowlist.go @@ -301,6 +301,14 @@ func AllowMethod(className string, mm CppMethod) error { return ErrTooComplex } + if className == "QHashSeed" && mm.MethodName == "operator unsigned long" { + // Not present in Qt 5, is present in Qt 6.4 and 6.8, but in the C++ + // header file it is written as `operator size_t()` + // Clang is early-converting size_t to unsigned long, which is invalid for mingw-w64-x86_64 platforms + // A proper fix here would be to avoid evaluating typedefs + return ErrTooComplex + } + return nil // OK, allow } From 408e6f55d31a4903038a4a2c852151ebe707d60a Mon Sep 17 00:00:00 2001 From: mappu Date: Sat, 11 Jan 2025 17:41:10 +1300 Subject: [PATCH 6/6] qt6: rebuild (block QHashSeed::toUnsignedLong function) --- qt6/gen_qhashfunctions.cpp | 4 ---- qt6/gen_qhashfunctions.go | 4 ---- qt6/gen_qhashfunctions.h | 1 - 3 files changed, 9 deletions(-) diff --git a/qt6/gen_qhashfunctions.cpp b/qt6/gen_qhashfunctions.cpp index 91144cc4..63d42f50 100644 --- a/qt6/gen_qhashfunctions.cpp +++ b/qt6/gen_qhashfunctions.cpp @@ -18,10 +18,6 @@ QHashSeed* QHashSeed_new2(size_t d) { return new QHashSeed(static_cast(d)); } -size_t QHashSeed_ToUnsignedLong(const QHashSeed* self) { - return self->operator unsigned long(); -} - QHashSeed* QHashSeed_GlobalSeed() { return new QHashSeed(QHashSeed::globalSeed()); } diff --git a/qt6/gen_qhashfunctions.go b/qt6/gen_qhashfunctions.go index 13842054..c3c0a93d 100644 --- a/qt6/gen_qhashfunctions.go +++ b/qt6/gen_qhashfunctions.go @@ -62,10 +62,6 @@ func NewQHashSeed2(d uint64) *QHashSeed { return ret } -func (this *QHashSeed) ToUnsignedLong() uint64 { - return (uint64)(C.QHashSeed_ToUnsignedLong(this.h)) -} - func QHashSeed_GlobalSeed() *QHashSeed { _goptr := newQHashSeed(C.QHashSeed_GlobalSeed()) _goptr.GoGC() // Qt uses pass-by-value semantics for this type. Mimic with finalizer diff --git a/qt6/gen_qhashfunctions.h b/qt6/gen_qhashfunctions.h index 71f494c1..9fa4f974 100644 --- a/qt6/gen_qhashfunctions.h +++ b/qt6/gen_qhashfunctions.h @@ -22,7 +22,6 @@ typedef struct QHashSeed QHashSeed; QHashSeed* QHashSeed_new(); QHashSeed* QHashSeed_new2(size_t d); -size_t QHashSeed_ToUnsignedLong(const QHashSeed* self); QHashSeed* QHashSeed_GlobalSeed(); void QHashSeed_SetDeterministicGlobalSeed(); void QHashSeed_ResetRandomGlobalSeed();