[arch-commits] Commit in zig/repos (4 files)

Evangelos Foutras foutrelis at gemini.archlinux.org
Sat Jun 25 07:44:14 UTC 2022


    Date: Saturday, June 25, 2022 @ 07:44:14
  Author: foutrelis
Revision: 1239402

archrelease: copy trunk to community-staging-x86_64

Added:
  zig/repos/community-staging-x86_64/
  zig/repos/community-staging-x86_64/PKGBUILD
    (from rev 1239401, zig/trunk/PKGBUILD)
  zig/repos/community-staging-x86_64/io_uring-timeout-remove-test.patch
    (from rev 1239401, zig/trunk/io_uring-timeout-remove-test.patch)
  zig/repos/community-staging-x86_64/resolve_DNS.patch
    (from rev 1239401, zig/trunk/resolve_DNS.patch)

------------------------------------+
 PKGBUILD                           |   60 +++++++++++++++++++++++++++++++++++
 io_uring-timeout-remove-test.patch |   36 +++++++++++++++++++++
 resolve_DNS.patch                  |   23 +++++++++++++
 3 files changed, 119 insertions(+)

Copied: zig/repos/community-staging-x86_64/PKGBUILD (from rev 1239401, zig/trunk/PKGBUILD)
===================================================================
--- community-staging-x86_64/PKGBUILD	                        (rev 0)
+++ community-staging-x86_64/PKGBUILD	2022-06-25 07:44:14 UTC (rev 1239402)
@@ -0,0 +1,60 @@
+# Maintainer: Daurnimator <daurnimator at archlinux.org>
+# Contributor: Marc Tiehuis <marctiehuis at gmail.com>
+
+pkgname=zig
+pkgver=0.9.1
+pkgrel=2
+pkgdesc='a general-purpose programming language and toolchain for maintaining robust, optimal, and reusable software'
+arch=('x86_64')
+url='https://ziglang.org/'
+license=('MIT')
+options=('debug')
+depends=('clang13' 'llvm13-libs')
+makedepends=('cmake' 'llvm13' 'lld13')
+checkdepends=('lib32-glibc')
+source=("https://ziglang.org/download/$pkgver/zig-$pkgver.tar.xz"
+        "$pkgname-io_uring-cancel-test.patch::https://github.com/ziglang/zig/commit/52651ae7a0de.patch"
+        "io_uring-timeout-remove-test.patch"
+        "resolve_DNS.patch")
+sha256sums=('38cf4e84481f5facc766ba72783e7462e08d6d29a5d47e3b75c8ee3142485210'
+            '7cabeeb678a9acf8aecc765adc78b328baafe2f1e928518f40d97d0afaae8535'
+            '9ed66bbef9420c0628c7054e4f192ad6faaaacfffcf28c4b3f08462d62769748'
+            'c2b7e709dcc229f0e58e2529db900bcfb9a1cfb73da765c5c76ab1e6d0a333cc')
+
+prepare() {
+    cd "$pkgname-$pkgver"
+    # https://github.com/ziglang/zig/issues/6898
+    patch -p1 < ../resolve_DNS.patch
+    # https://github.com/ziglang/zig/issues/11382
+    patch -p1 --no-backup-if-mismatch < ../$pkgname-io_uring-cancel-test.patch
+    # https://github.com/ziglang/zig/issues/11900
+    patch -p1 --no-backup-if-mismatch < ../io_uring-timeout-remove-test.patch
+}
+
+build() {
+    cd "$pkgname-$pkgver"
+
+    # The zig CMakeLists uses build type Debug if not set
+    # override it back to None so makepkg env vars are respected
+    cmake -B build \
+        -DCMAKE_BUILD_TYPE=None \
+        -DCMAKE_INSTALL_PREFIX=/usr \
+        -DCMAKE_PREFIX_PATH=/usr/lib/llvm13 \
+        -DZIG_PREFER_CLANG_CPP_DYLIB=ON \
+        .
+    cmake --build build
+}
+
+check() {
+    cd "$pkgname-$pkgver/build"
+
+    ./zig build test
+}
+
+package() {
+    cd "$pkgname-$pkgver"
+
+    install -Dm644 LICENSE "$pkgdir/usr/share/licenses/$pkgname/LICENSE"
+
+    DESTDIR="$pkgdir" cmake --install build
+}

Copied: zig/repos/community-staging-x86_64/io_uring-timeout-remove-test.patch (from rev 1239401, zig/trunk/io_uring-timeout-remove-test.patch)
===================================================================
--- community-staging-x86_64/io_uring-timeout-remove-test.patch	                        (rev 0)
+++ community-staging-x86_64/io_uring-timeout-remove-test.patch	2022-06-25 07:44:14 UTC (rev 1239402)
@@ -0,0 +1,36 @@
+diff -upr zig-0.9.1.orig/lib/std/os/linux/io_uring.zig zig-0.9.1/lib/std/os/linux/io_uring.zig
+--- zig-0.9.1.orig/lib/std/os/linux/io_uring.zig	2022-02-14 22:03:19.000000000 +0200
++++ zig-0.9.1/lib/std/os/linux/io_uring.zig	2022-06-25 02:02:53.701051414 +0300
+@@ -1994,7 +1994,7 @@ test "timeout_remove" {
+ 
+     try testing.expectEqual(@as(u32, 2), try ring.submit());
+ 
+-    const cqe_timeout = try ring.copy_cqe();
++    var cqe_timeout = try ring.copy_cqe();
+     // IORING_OP_TIMEOUT_REMOVE is not supported by this kernel version:
+     // Timeout remove operations set the fd to -1, which results in EBADF before EINVAL.
+     // We use IORING_FEAT_RW_CUR_POS as a safety check here to make sure we are at least pre-5.6.
+@@ -2005,13 +2005,22 @@ test "timeout_remove" {
+     {
+         return error.SkipZigTest;
+     }
++
++    var cqe_timeout_remove = try ring.copy_cqe();
++
++    if (cqe_timeout.user_data == 0x99999999 and cqe_timeout_remove.user_data == 0x88888888) {
++        const a = cqe_timeout;
++        const b = cqe_timeout_remove;
++        cqe_timeout = b;
++        cqe_timeout_remove = a;
++    }
++
+     try testing.expectEqual(linux.io_uring_cqe{
+         .user_data = 0x88888888,
+         .res = - at as(i32, @enumToInt(linux.E.CANCELED)),
+         .flags = 0,
+     }, cqe_timeout);
+ 
+-    const cqe_timeout_remove = try ring.copy_cqe();
+     try testing.expectEqual(linux.io_uring_cqe{
+         .user_data = 0x99999999,
+         .res = 0,

Copied: zig/repos/community-staging-x86_64/resolve_DNS.patch (from rev 1239401, zig/trunk/resolve_DNS.patch)
===================================================================
--- community-staging-x86_64/resolve_DNS.patch	                        (rev 0)
+++ community-staging-x86_64/resolve_DNS.patch	2022-06-25 07:44:14 UTC (rev 1239402)
@@ -0,0 +1,23 @@
+diff --git a/lib/std/net/test.zig b/lib/std/net/test.zig
+index 9f40bb5a3..15dd8c920 100644
+--- a/lib/std/net/test.zig
++++ b/lib/std/net/test.zig
+@@ -106,18 +106,6 @@ test "resolve DNS" {
+         }
+     }
+ 
+-    // Resolve localhost, this should not fail.
+-    {
+-        const localhost_v4 = try net.Address.parseIp("127.0.0.1", 80);
+-        const localhost_v6 = try net.Address.parseIp("::2", 80);
+-
+-        const result = try net.getAddressList(testing.allocator, "localhost", 80);
+-        defer result.deinit();
+-        for (result.addrs) |addr| {
+-            if (addr.eql(localhost_v4) or addr.eql(localhost_v6)) break;
+-        } else @panic("unexpected address for localhost");
+-    }
+-
+     {
+         // The tests are required to work even when there is no Internet connection,
+         // so some of these errors we must accept and skip the test.



More information about the arch-commits mailing list