16594 lines
745 KiB
Plaintext
16594 lines
745 KiB
Plaintext
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=uber.com header.i=@uber.com
|
||
Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id DDF2111EEC2
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Mon, 6 Sep 2021 05:14:56 +0000 (UTC)
|
||
Received: by mail-ed1-f48.google.com with SMTP id u19so7815945edb.3
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Sun, 05 Sep 2021 22:14:56 -0700 (PDT)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=uber.com; s=google;
|
||
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
|
||
:cc:content-transfer-encoding;
|
||
bh=7Ep7iTYyg1DX8Hx9AdVtBxHJWPcMfNRMH8EVv7gJalA=;
|
||
b=0T3cef8TsPS2gcoAtVKBRrHY8D9aD8FJvFDsizN3PMB0F8l32dLdRv8+TvHspaJs5l
|
||
lJdSEzmJ6Hkn1T3DPxjr7qvm9s4+ThTSRkEwFtWerRuftLWxMlUml73Cs0fIhN7FohhH
|
||
LNbRleFGhs9sM2EueHyR7e7sc1qdxDd+644IQ=
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20161025;
|
||
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
|
||
:message-id:subject:to:cc:content-transfer-encoding;
|
||
bh=7Ep7iTYyg1DX8Hx9AdVtBxHJWPcMfNRMH8EVv7gJalA=;
|
||
b=Nig0qyUf+TPvScOEAThWQagGYc0pZQnLXdiWR41czq9ODyMBe8281D+altQ/+U7QbU
|
||
6x+GKNecxPw/rLFsxDQ+FILzF4tRaV/oQ4nVBsq0ssVb1P4fY5IWlXSn2Rq3tZwSTKtP
|
||
Ax2Qz8BX72ywIcQo1ZM2JLhQF6UjvkbGBO0QyXiJT416xQLSjGQUB8arl+Q0fKNFcIJ9
|
||
UqwF8qkIyeMfjiL0faClIsNnXJhfa5qEyS6HwFDOdK7f344ExdzDmZNOxWnmhtZCIvpl
|
||
AU1dQ6HHK1qKY+VEbkvoq6w05PYihxHk7szMaahtw3USzpe6cF9YepAOxqZNyzM2NWWp
|
||
GUFg==
|
||
X-Gm-Message-State: AOAM530RHZDN0bVwF4byjoCILBF7XpLVHfGKWcrFVgSdkYjbhCtTeR6T
|
||
GY+hwcM4PIIVUci3xE6TPMfllXXNuws916eSE25Cew==
|
||
X-Google-Smtp-Source: ABdhPJx06von7JT53TGVZFlki01ijRhmL1GfVC0Mnhpi5vWifJyzoQeSjcDPzMuM5EjLg2LfBIJutd4b5I55Ak3kpsk=
|
||
X-Received: by 2002:a05:6402:6cf:: with SMTP id n15mr11581412edy.85.1630905295539;
|
||
Sun, 05 Sep 2021 22:14:55 -0700 (PDT)
|
||
MIME-Version: 1.0
|
||
References: <CAMEgGpyFHe3f=VZgFEDMivQ_rGCmHngBPH5MAC2Va5NvJmRo5g@mail.gmail.com>
|
||
<CAK+t98XUb0EmzKu-zOPpZxQM_jcWS=K3AJUuz9tB93COdtJqFw@mail.gmail.com>
|
||
<CAEZVCP5BMvXc2W5L0_fYGws8A_GgXwZ4mgtduS3qBzNP97nqSw@mail.gmail.com>
|
||
<CAK+t98UYm5FhQFit4vix_RTUzXBfeH+CGVM8-1vQFHtYfLcgXw@mail.gmail.com> <CANeNeVSkKdpeN8BnXciTXBQQhoLFLGKCAKNXCRYyh8ymppdkfg@mail.gmail.com>
|
||
In-Reply-To: <CANeNeVSkKdpeN8BnXciTXBQQhoLFLGKCAKNXCRYyh8ymppdkfg@mail.gmail.com>
|
||
From: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <motiejus@uber.com>
|
||
Date: Mon, 6 Sep 2021 08:14:46 +0300
|
||
Message-ID: <CAK+t98X2fo+_f+W1o8hzYX_CXmHVPMNfBN2CoM+soRGgMELOQQ@mail.gmail.com>
|
||
Subject: Re: Cross-compilation with zig
|
||
To: Adam Bouhenguel <adam@bouhenguel.com>, ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Cc: Steeve Morin <steeve.morin@gmail.com>, Zhongpeng Lin <zplin@uber.com>
|
||
Content-Type: text/plain; charset="UTF-8"
|
||
Content-Transfer-Encoding: quoted-printable
|
||
|
||
+ ~motiejus/bazel-zig-cc@lists.sr.ht (please subscribe[0]). Also
|
||
switching from top-down to bottom-up posting.
|
||
|
||
On Sun, Sep 5, 2021 at 10:14 PM Adam Bouhenguel <adam@bouhenguel.com> wrote=
|
||
:
|
||
>
|
||
> Thanks for adding me to the thread, Motiejus.
|
||
>
|
||
> Steeve, I'm very curious to hear how your investigation goes. Please keep=
|
||
me posted!
|
||
>
|
||
> I've been bitten a few times now by regressions in zig cc. Both 0.7.1 and=
|
||
0.9-dev have problems with C++ exceptions and break runtime behavior of th=
|
||
ird party libraries I'm using.
|
||
|
||
Zig 0.7.1 to zig 0.9-dev moved from clang-11 to clang-12, so, from the
|
||
surface, I would attribute behavior changes to this. Did you narrow
|
||
this down to something specific?
|
||
|
||
> Seems like the ability to build a set of specific projects in bazel (with=
|
||
a hermetic zig cc based toolchain) might be helpful for keeping everyone o=
|
||
n the same page.
|
||
|
||
Have you noticed regressions with `zig cc` when upgrading zig? Since
|
||
it is covered by "bug stability program[1]", I expect zig upstream to
|
||
be quite responsive with regressions there. If C++ behavior changes,
|
||
it's probably a fault of a new clang, which should be reported to
|
||
Apple (likely with help of zig developers, since they have done this
|
||
many times).
|
||
|
||
> To this end, what do you folks think about having a small suite of accept=
|
||
ance tests for the toolchain?
|
||
|
||
We already have //test:hello[2]. Feel free to add yours.
|
||
|
||
> As a bonus we might be able to use qemu to ensure that the cross-compiled=
|
||
artifacts actually work.
|
||
|
||
I am looking for multi-arch build support in sr.ht, which is "not yet
|
||
available"[3], which would be ideal.
|
||
|
||
Currently I am cross-compiling to a few architectures and checking
|
||
whether the resulting "file" command returns an expected string. I
|
||
agree qemu-system-<arch> is a good next step. What are your
|
||
architectures of interest?
|
||
|
||
Motiejus
|
||
|
||
[0]: https://lists.sr.ht/~motiejus/bazel-zig-cc
|
||
[1]: https://ziglang.org/download/0.8.0/release-notes.html#zig-cc
|
||
[2]: https://git.sr.ht/~motiejus/bazel-zig-cc/tree/main/item/test/BUILD
|
||
[3]: https://man.sr.ht/builds.sr.ht/compatibility.md
|
||
[4]: https://git.sr.ht/~motiejus/bazel-zig-cc/tree/main/item/.build.yml
|
||
|
||
> Cheers,
|
||
> Adam
|
||
>
|
||
> On Thu, Sep 2, 2021, 06:31 Motiejus Jak=C5=A1tys <motiejus@uber.com> wrot=
|
||
e:
|
||
>>
|
||
>> Let me know how it goes. I set up a mailing list on srht for patches, if=
|
||
any.
|
||
>>
|
||
>> On Thu, Sep 2, 2021, 15:42 Steeve Morin <steeve.morin@gmail.com> wrote:
|
||
>>>
|
||
>>> Hey Motiejus,
|
||
>>>
|
||
>>> Thank for working on that!
|
||
>>> I'll see if I can hack on it one weekend. What I'd like though is have =
|
||
the `zig cc` toolchain have the same level of features as the "host" toolch=
|
||
ain.
|
||
>>> And it feels to me that doing the toolchain.bzl file by hand isn't the =
|
||
right way to do it. I'm still looking into how bazel generates it and see i=
|
||
f we can let it do it.
|
||
>>>
|
||
>>> Steeve
|
||
>>>
|
||
>>>
|
||
>>> On Wed, 1 Sept 2021 at 21:03, Motiejus Jak=C5=A1tys <motiejus@uber.com>=
|
||
wrote:
|
||
>>>>
|
||
>>>> Zhongpeng, thank you for bringing the group together. +Adam, who creat=
|
||
ed the initial toolchain (mine is a fork of Adam's initial hard work), and =
|
||
he has obvious interest in the toolchain too.
|
||
>>>>
|
||
>>>> Steeve, my zig-cc toolchain is hosted here. I am obviously interested =
|
||
in solving all the outlined issues, and rules_go#2894 is one of them. I am =
|
||
currently very limited in capacity myself, but happy to merge improvements,=
|
||
either the mentioned issues or anything else you find reasonably necessary=
|
||
for usage of the toolchain.
|
||
>>>>
|
||
>>>> Motiejus
|
||
>>>>
|
||
>>>> On Wed, Sep 1, 2021 at 9:17 PM Zhongpeng Lin <zplin@uber.com> wrote:
|
||
>>>>>
|
||
>>>>> Hello Motiejus,
|
||
>>>>>
|
||
>>>>> In today's Bazel-Go maintainers meeting, Steeve (cc'ed) mentioned tha=
|
||
t he wanted to work on zig-based toolchain for rules_go. Steeve is also an =
|
||
expert in cgo support in rules_go. Checking the last email you sent, it see=
|
||
ms you've made good progress on that. Do you still need help on rules_go#28=
|
||
94? Steeve is probably the most knowledgeable person for you to talk to if =
|
||
you need.
|
||
>>>>>
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=uber.com header.i=@uber.com
|
||
Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id 7F60211F01D
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Tue, 14 Sep 2021 12:18:17 +0000 (UTC)
|
||
Received: by mail-pf1-f176.google.com with SMTP id 18so11985902pfh.9
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Tue, 14 Sep 2021 05:18:17 -0700 (PDT)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=uber.com; s=google;
|
||
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
|
||
:cc;
|
||
bh=OrT2HLfEH5T84qiDOOT1fkL1jScAGScbvztl9Bh21pc=;
|
||
b=90ZPl0uDFnNAu2aY6Ya/MrR2y70iL0LQKpEOGY09XP+7MwX7/86CY6t52iN6YXoH2z
|
||
NyujV8NNjIvkDfTt9lTbuTlXfH6zw/zWuXooDeKhJ5F8EV51HksugrDVwRL7pnv8H7ir
|
||
a69BVlE46C9ZTXFo+uPGKG0LzUu/FB9bCESWQ=
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
|
||
:message-id:subject:to:cc;
|
||
bh=OrT2HLfEH5T84qiDOOT1fkL1jScAGScbvztl9Bh21pc=;
|
||
b=Ce65X6V72tRXX3lsb+mUwj1Tl/p6n/UYy3NIcFZ4HyhO7r02nN9WV8dFapeKhWHcHq
|
||
aQUqblPaAUew8VnVJ76tt5ycFfyt0r+2uyq50xnoV6K6/1T3bvxJ6/KzUG2eEV/O7hVB
|
||
xkMaYXWM4X1d62n18Z0IYGwfH8oNvgS+gNjuaoPipRxDKW5oJ7/hNpWYNK3Bdg1klq0j
|
||
JcDZWDVt6Icz2V7bI/Hg5rm4jWjJT2UVhO2dU/ORhTei5G4x4bEB5K2vnBNnewmIZkla
|
||
aruAAoUK6ES8wGwDVEs4dkjrtcF4iG+Y+6VdNs7S4c/IK5YPqP3ZWnjiS9SYof/fx3hp
|
||
MjNg==
|
||
X-Gm-Message-State: AOAM530UpTvU3UcNBbcQR2g9AazB7DLWy/Efj1NzsIcbZOWRJyxpGydG
|
||
Oc79jHwoMosaawx9gQ4QRMbjlwM9ThZOelu/hmh05g==
|
||
X-Google-Smtp-Source: ABdhPJwrF4zc8+XPliKolcZkIgfEaf2EZWHhN4u3jxGdRRd12ErlTeUw0hq/4vbWlDizwNXDf/l1lw58uq4TfJsojxQ=
|
||
X-Received: by 2002:a62:8c08:0:b0:434:652b:1319 with SMTP id
|
||
m8-20020a628c08000000b00434652b1319mr4534198pfd.24.1631621895297; Tue, 14 Sep
|
||
2021 05:18:15 -0700 (PDT)
|
||
MIME-Version: 1.0
|
||
References: <CAMEgGpyFHe3f=VZgFEDMivQ_rGCmHngBPH5MAC2Va5NvJmRo5g@mail.gmail.com>
|
||
<CAK+t98XUb0EmzKu-zOPpZxQM_jcWS=K3AJUuz9tB93COdtJqFw@mail.gmail.com>
|
||
<CAEZVCP5BMvXc2W5L0_fYGws8A_GgXwZ4mgtduS3qBzNP97nqSw@mail.gmail.com>
|
||
<CAK+t98UYm5FhQFit4vix_RTUzXBfeH+CGVM8-1vQFHtYfLcgXw@mail.gmail.com>
|
||
<CANeNeVSkKdpeN8BnXciTXBQQhoLFLGKCAKNXCRYyh8ymppdkfg@mail.gmail.com>
|
||
<CAK+t98X2fo+_f+W1o8hzYX_CXmHVPMNfBN2CoM+soRGgMELOQQ@mail.gmail.com>
|
||
<CANeNeVTjtYd8vVzgprM7-LMBS67kugn_rvsocrP80W+rwvsUjQ@mail.gmail.com> <CAEZVCP4=r79nLRghL03Hi7CfKFjF2u3sL97hba9PHQzh7ZhFyg@mail.gmail.com>
|
||
In-Reply-To: <CAEZVCP4=r79nLRghL03Hi7CfKFjF2u3sL97hba9PHQzh7ZhFyg@mail.gmail.com>
|
||
From: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <motiejus@uber.com>
|
||
Date: Tue, 14 Sep 2021 15:18:04 +0300
|
||
Message-ID: <CAK+t98Ww6cWU+MRtaPQ=_WVe_mwYmf0h9HHj_O0D-yuXyvoS3A@mail.gmail.com>
|
||
Subject: Re: Cross-compilation with zig
|
||
To: Steeve Morin <steeve.morin@gmail.com>
|
||
Cc: Adam Bouhenguel <adam@bouhenguel.com>, ~motiejus/bazel-zig-cc@lists.sr.ht,
|
||
Zhongpeng Lin <zplin@uber.com>
|
||
Content-Type: text/plain; charset="UTF-8"
|
||
|
||
On Tue, Sep 14, 2021 at 2:21 AM Steeve Morin <steeve.morin@gmail.com> wrote:
|
||
>
|
||
> Alright you guys, I found a way to use bazel's auto toolchain configuration with zig!
|
||
> It's rather archaic for now, but it works, I got protoc compiled and running for both macos and linux.
|
||
>
|
||
> Still needs some love, I'll post updates in the next few days.
|
||
|
||
Looking forward to anything that will simplify it's setup/boilerplate.
|
||
|
||
> The main idea is to give to @bazel_tools//tools/cpp:unix_cc_configure.bzl configure_unix_toolchain() what it want, and that's it!
|
||
|
||
Interesting!
|
||
|
||
I have slightly updated the toolchain today:
|
||
- added support for darwin-arm64 and linux-arm64 host (though don't
|
||
have an arm64 machine to test this with).
|
||
- tried to upgrade zig itself, but cross-compilation to darwin-amd64
|
||
fails with it; there seems to be a regression somewhere. I will look
|
||
into it sometime soon.
|
||
|
||
... so please rebase before sending patches.
|
||
|
||
Regards,
|
||
Motiejus
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id 7AA8311EF38
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Fri, 29 Oct 2021 04:45:34 +0000 (UTC)
|
||
Received: by mail-lf1-f45.google.com with SMTP id p16so18563959lfa.2
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Thu, 28 Oct 2021 21:45:34 -0700 (PDT)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=sender:date:from:to:cc:subject:message-id:references:mime-version
|
||
:content-disposition:content-transfer-encoding:in-reply-to;
|
||
bh=e1CN1JJJM9joKaUlYnsska9HvRy43YfFeSGJYgiQjQs=;
|
||
b=N7pGbkjAvxhSXwB+tTVrJHBV8BHUuBWcqQlTvb/BtI/Jc5fNEvIj/GA7D/AxiqmIR1
|
||
27T8aTQ1DlzX+OQOW406lwGXbvZZL3V0ehPNMd7iusogsbnKu2EHBr+ThWpVtedV7vPU
|
||
/9iK0Z4ZmfsEN7uJIfRUN7dG+A2YhndnNXTgPJ25NCCICu4PpIOqbgYjywgE1GiC0Hay
|
||
YZymEWSaVLn7vKlbEkbxhKZ+UztEBLATrHZRKj5RfKyaqp2tlWgH+0o3I/gLxrtZVcX+
|
||
TKhoRqrxjGjYZrkdYwrVpHQ3k2w9/PTe7fRODmp9cYS9PRwEQC30OFWWz3eXgps+DMc8
|
||
LPbw==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:sender:date:from:to:cc:subject:message-id
|
||
:references:mime-version:content-disposition
|
||
:content-transfer-encoding:in-reply-to;
|
||
bh=e1CN1JJJM9joKaUlYnsska9HvRy43YfFeSGJYgiQjQs=;
|
||
b=r89AESahTPDW+InsPvQBy5oShDlHrIWGg57AY8KjJBEXQgzGmw3EvmJjiLcsgSl+Wb
|
||
8zqr7NZ1dMcpon8GeT6jHeCKGHshHUqTFd6g52JIBGF/zUCVb56UUBDR3ioI7bGrPQxB
|
||
vPys0M00zxd8XxmgXoNXGlzsrPQb5Ey6G4c8LoGfByNU1MGq4QOeJalsLpZlqBRufnC8
|
||
KGaMUySwLmdUEJkvr6cwUVU0aH/NFH/a3SNJjqbErS7+BsG8L8c2mHfgXHRK5gKDSSW5
|
||
OeZFJhvSyckmkmydjakuc2ujue4AmXI0zHOqHG6x4BmRn9zLXGsubF3PTdnznc0FpSve
|
||
3QLw==
|
||
X-Gm-Message-State: AOAM530q79ok7W8D4VaBKIDpBl3HwOetwH0gt33opT4qmBP6+foicf1Z
|
||
2uv9qkI/iyrmnil6tOaY/QE=
|
||
X-Google-Smtp-Source: ABdhPJyuFdbOG4l8g9NVpT78xmShrZBBHNU8pGNzJkGl1MbHL1FDvr/UfAiOZ67yA0UmaKYiXhMxsQ==
|
||
X-Received: by 2002:a05:6512:33c2:: with SMTP id d2mr7692886lfg.182.1635482732884;
|
||
Thu, 28 Oct 2021 21:45:32 -0700 (PDT)
|
||
Received: from localhost ([88.223.105.24])
|
||
by smtp.gmail.com with ESMTPSA id e22sm493971lfr.237.2021.10.28.21.45.31
|
||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||
Thu, 28 Oct 2021 21:45:32 -0700 (PDT)
|
||
Sender: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <desired.mta@gmail.com>
|
||
Date: Fri, 29 Oct 2021 07:45:31 +0300
|
||
From: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
To: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@uber.com>
|
||
Cc: Steeve Morin <steeve.morin@gmail.com>,
|
||
Adam Bouhenguel <adam@bouhenguel.com>,
|
||
~motiejus/bazel-zig-cc@lists.sr.ht, Zhongpeng Lin <zplin@uber.com>
|
||
Subject: Re: Cross-compilation with zig
|
||
Message-ID: <20211029044531.vvtv7btw2ur7u6zc@mtpad.i.jakstys.lt>
|
||
References: <CAMEgGpyFHe3f=VZgFEDMivQ_rGCmHngBPH5MAC2Va5NvJmRo5g@mail.gmail.com>
|
||
<CAK+t98XUb0EmzKu-zOPpZxQM_jcWS=K3AJUuz9tB93COdtJqFw@mail.gmail.com>
|
||
<CAEZVCP5BMvXc2W5L0_fYGws8A_GgXwZ4mgtduS3qBzNP97nqSw@mail.gmail.com>
|
||
<CAK+t98UYm5FhQFit4vix_RTUzXBfeH+CGVM8-1vQFHtYfLcgXw@mail.gmail.com>
|
||
<CANeNeVSkKdpeN8BnXciTXBQQhoLFLGKCAKNXCRYyh8ymppdkfg@mail.gmail.com>
|
||
<CAK+t98X2fo+_f+W1o8hzYX_CXmHVPMNfBN2CoM+soRGgMELOQQ@mail.gmail.com>
|
||
<CANeNeVTjtYd8vVzgprM7-LMBS67kugn_rvsocrP80W+rwvsUjQ@mail.gmail.com>
|
||
<CAEZVCP4=r79nLRghL03Hi7CfKFjF2u3sL97hba9PHQzh7ZhFyg@mail.gmail.com>
|
||
<CAK+t98Ww6cWU+MRtaPQ=_WVe_mwYmf0h9HHj_O0D-yuXyvoS3A@mail.gmail.com>
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=utf-8
|
||
Content-Disposition: inline
|
||
Content-Transfer-Encoding: 8bit
|
||
In-Reply-To: <CAK+t98Ww6cWU+MRtaPQ=_WVe_mwYmf0h9HHj_O0D-yuXyvoS3A@mail.gmail.com>
|
||
|
||
On Tue, Sep 14, 2021 at 03:18:04PM +0300, Motiejus Jakštys wrote:
|
||
> On Tue, Sep 14, 2021 at 2:21 AM Steeve Morin <steeve.morin@gmail.com> wrote:
|
||
> >
|
||
> > Alright you guys, I found a way to use bazel's auto toolchain configuration with zig!
|
||
> > It's rather archaic for now, but it works, I got protoc compiled and running for both macos and linux.
|
||
> >
|
||
> > Still needs some love, I'll post updates in the next few days.
|
||
>
|
||
> Looking forward to anything that will simplify it's setup/boilerplate.
|
||
|
||
Hi all,
|
||
|
||
the way plans are panning out now, at some point in 2022H1 bazel-zig-cc
|
||
will be scrutinized by much more competent colleagues than myself,
|
||
before being moved to github.com/uber (or equivalent). After that major
|
||
changes will be much harder to make.
|
||
|
||
Steeve, if you are still considering on major changes in bazel-zig-cc,
|
||
this year is better than next year.
|
||
|
||
Motiejus
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=none
|
||
Received: from git.sr.ht (unknown [173.195.146.142])
|
||
by mail-b.sr.ht (Postfix) with ESMTPSA id 57B3B11EF37
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Fri, 5 Nov 2021 13:23:34 +0000 (UTC)
|
||
From: ~mjonaitis <mjonaitis@git.sr.ht>
|
||
Date: Thu, 04 Nov 2021 18:54:42 +0200
|
||
Subject: [PATCH bazel-zig-cc] add go_binary override
|
||
Message-ID: <163611861421.17091.108675275474200386-0@git.sr.ht>
|
||
X-Mailer: git.sr.ht
|
||
Reply-to: ~mjonaitis <mjonaitis@uber.com>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Content-Type: text/plain; charset="utf-8"
|
||
Content-Transfer-Encoding: quoted-printable
|
||
MIME-Version: 1.0
|
||
|
||
From: Mantas Jonaitis <mjonaitis@uber.com>
|
||
|
||
---
|
||
BUILD | 2 ++
|
||
README.md | 7 +++++++
|
||
rules/BUILD | 0
|
||
rules/go_binary_override.bzl | 27 +++++++++++++++++++++++++++
|
||
test/BUILD | 15 ++++-----------
|
||
5 files changed, 40 insertions(+), 11 deletions(-)
|
||
create mode 100644 rules/BUILD
|
||
create mode 100644 rules/go_binary_override.bzl
|
||
|
||
diff --git a/BUILD b/BUILD
|
||
index 07e6a04..a34acae 100644
|
||
--- a/BUILD
|
||
+++ b/BUILD
|
||
@@ -1,6 +1,8 @@
|
||
load("@bazel_gazelle//:def.bzl", "gazelle")
|
||
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
|
||
=20
|
||
+# gazelle:map_kind go_binary go_binary //rules:go_binary_override.bzl
|
||
+
|
||
# gazelle:build_file_name BUILD
|
||
# gazelle:prefix github.com/motiejus/bazel-zig-cc
|
||
gazelle(name =3D "gazelle")
|
||
diff --git a/README.md b/README.md
|
||
index 8ae3935..7c83752 100644
|
||
--- a/README.md
|
||
+++ b/README.md
|
||
@@ -116,6 +116,13 @@ go_binary(
|
||
)
|
||
```
|
||
=20
|
||
+A workaround with [gazelle](https://github.com/bazelbuild/bazel-gazelle) `ma=
|
||
p_kind` directive is possible. This will override rules_go `go_binary` rule w=
|
||
ith `go_binary` which contains default `gc_linkopts` parameters. Add this lin=
|
||
e to your BUILD files (usually adding to root BUILD file will suffice) and ru=
|
||
n `gazelle` to automatically generate `load` statements.
|
||
+
|
||
+```
|
||
+# gazelle:map_kind go_binary go_binary @bazel-zig-cc//rules:go_binary_overri=
|
||
de.bzl
|
||
+```
|
||
+
|
||
+
|
||
## incorrect glibc version autodetection
|
||
=20
|
||
**Severity: Low**
|
||
diff --git a/rules/BUILD b/rules/BUILD
|
||
new file mode 100644
|
||
index 0000000..e69de29
|
||
diff --git a/rules/go_binary_override.bzl b/rules/go_binary_override.bzl
|
||
new file mode 100644
|
||
index 0000000..6ac14cf
|
||
--- /dev/null
|
||
+++ b/rules/go_binary_override.bzl
|
||
@@ -0,0 +1,27 @@
|
||
+load("@io_bazel_rules_go//go:def.bzl", go_binary_rule =3D "go_binary")
|
||
+
|
||
+"""
|
||
+go_binary overrides go_binary from rules_go and provides default
|
||
+gc_linkopts values that are needed to compile for macos target.
|
||
+To use it, add this map_kind gazelle directive to your BUILD.bazel files
|
||
+where target binary needs to be compiled with zig toolchain.
|
||
+
|
||
+Example: if this toolchain is registered as bazel-zig-cc in your WORKSPACE, =
|
||
add this to
|
||
+your root BUILD file
|
||
+# gazelle:map_kind go_binary go_binary @bazel-zig-cc//rules:go_binary_overri=
|
||
de.bzl
|
||
+"""
|
||
+def go_binary(**args):
|
||
+ new_args =3D {}
|
||
+ new_args["gc_linkopts"] =3D select({
|
||
+ "@platforms//os:macos": [
|
||
+ "-s",
|
||
+ "-w",
|
||
+ "-buildmode=3Dpie",
|
||
+ ],
|
||
+ "//conditions:default": [],
|
||
+ })
|
||
+ for k, v in args.items():
|
||
+ new_args[k] =3D v
|
||
+ print("Key: {}".format(k))
|
||
+ go_binary_rule(**new_args)
|
||
+
|
||
diff --git a/test/BUILD b/test/BUILD
|
||
index 133fe5a..415b9c2 100644
|
||
--- a/test/BUILD
|
||
+++ b/test/BUILD
|
||
@@ -1,4 +1,5 @@
|
||
-load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||
+load("//rules:go_binary_override.bzl", "go_binary")
|
||
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||
=20
|
||
go_library(
|
||
name =3D "hello_lib",
|
||
@@ -7,22 +8,14 @@ go_library(
|
||
importpath =3D "github.com/motiejus/bazel-zig-cc/test",
|
||
visibility =3D ["//visibility:private"],
|
||
deps =3D [
|
||
- "@com_github_datadog_zstd//:go_default_library",
|
||
- "@com_github_mattn_go_sqlite3//:go_default_library",
|
||
+ "@com_github_datadog_zstd//:zstd",
|
||
+ "@com_github_mattn_go_sqlite3//:go-sqlite3",
|
||
],
|
||
)
|
||
=20
|
||
go_binary(
|
||
name =3D "hello",
|
||
embed =3D [":hello_lib"],
|
||
- gc_linkopts =3D select({
|
||
- "@platforms//os:macos": [
|
||
- "-s",
|
||
- "-w",
|
||
- "-buildmode=3Dpie",
|
||
- ],
|
||
- "//conditions:default": [],
|
||
- }),
|
||
static =3D "on",
|
||
visibility =3D ["//visibility:public"],
|
||
)
|
||
--=20
|
||
2.32.0
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=none
|
||
Received: from git.sr.ht (unknown [173.195.146.142])
|
||
by mail-b.sr.ht (Postfix) with ESMTPSA id 3B44211EF37
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Fri, 5 Nov 2021 13:39:06 +0000 (UTC)
|
||
From: ~mjonaitis <mjonaitis@git.sr.ht>
|
||
Date: Thu, 04 Nov 2021 18:54:42 +0200
|
||
Subject: [PATCH bazel-zig-cc v2] add go_binary override
|
||
Message-ID: <163611954593.18596.9121656084211429991-0@git.sr.ht>
|
||
X-Mailer: git.sr.ht
|
||
Reply-to: ~mjonaitis <mjonaitis@uber.com>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Content-Type: text/plain; charset="utf-8"
|
||
Content-Transfer-Encoding: quoted-printable
|
||
MIME-Version: 1.0
|
||
|
||
From: Mantas Jonaitis <mjonaitis@uber.com>
|
||
|
||
---
|
||
BUILD | 2 ++
|
||
README.md | 7 +++++++
|
||
rules/BUILD | 0
|
||
rules/go_binary_override.bzl | 26 ++++++++++++++++++++++++++
|
||
test/BUILD | 15 ++++-----------
|
||
5 files changed, 39 insertions(+), 11 deletions(-)
|
||
create mode 100644 rules/BUILD
|
||
create mode 100644 rules/go_binary_override.bzl
|
||
|
||
diff --git a/BUILD b/BUILD
|
||
index 07e6a04..a34acae 100644
|
||
--- a/BUILD
|
||
+++ b/BUILD
|
||
@@ -1,6 +1,8 @@
|
||
load("@bazel_gazelle//:def.bzl", "gazelle")
|
||
load("@com_github_bazelbuild_buildtools//buildifier:def.bzl", "buildifier")
|
||
=20
|
||
+# gazelle:map_kind go_binary go_binary //rules:go_binary_override.bzl
|
||
+
|
||
# gazelle:build_file_name BUILD
|
||
# gazelle:prefix github.com/motiejus/bazel-zig-cc
|
||
gazelle(name =3D "gazelle")
|
||
diff --git a/README.md b/README.md
|
||
index 8ae3935..7c83752 100644
|
||
--- a/README.md
|
||
+++ b/README.md
|
||
@@ -116,6 +116,13 @@ go_binary(
|
||
)
|
||
```
|
||
=20
|
||
+A workaround with [gazelle](https://github.com/bazelbuild/bazel-gazelle) `ma=
|
||
p_kind` directive is possible. This will override rules_go `go_binary` rule w=
|
||
ith `go_binary` which contains default `gc_linkopts` parameters. Add this lin=
|
||
e to your BUILD files (usually adding to root BUILD file will suffice) and ru=
|
||
n `gazelle` to automatically generate `load` statements.
|
||
+
|
||
+```
|
||
+# gazelle:map_kind go_binary go_binary @bazel-zig-cc//rules:go_binary_overri=
|
||
de.bzl
|
||
+```
|
||
+
|
||
+
|
||
## incorrect glibc version autodetection
|
||
=20
|
||
**Severity: Low**
|
||
diff --git a/rules/BUILD b/rules/BUILD
|
||
new file mode 100644
|
||
index 0000000..e69de29
|
||
diff --git a/rules/go_binary_override.bzl b/rules/go_binary_override.bzl
|
||
new file mode 100644
|
||
index 0000000..cb37807
|
||
--- /dev/null
|
||
+++ b/rules/go_binary_override.bzl
|
||
@@ -0,0 +1,26 @@
|
||
+load("@io_bazel_rules_go//go:def.bzl", go_binary_rule =3D "go_binary")
|
||
+
|
||
+"""
|
||
+go_binary overrides go_binary from rules_go and provides default
|
||
+gc_linkopts values that are needed to compile for macos target.
|
||
+To use it, add this map_kind gazelle directive to your BUILD.bazel files
|
||
+where target binary needs to be compiled with zig toolchain.
|
||
+
|
||
+Example: if this toolchain is registered as bazel-zig-cc in your WORKSPACE, =
|
||
add this to
|
||
+your root BUILD file
|
||
+# gazelle:map_kind go_binary go_binary @bazel-zig-cc//rules:go_binary_overri=
|
||
de.bzl
|
||
+"""
|
||
+def go_binary(**args):
|
||
+ new_args =3D {}
|
||
+ new_args["gc_linkopts"] =3D select({
|
||
+ "@platforms//os:macos": [
|
||
+ "-s",
|
||
+ "-w",
|
||
+ "-buildmode=3Dpie",
|
||
+ ],
|
||
+ "//conditions:default": [],
|
||
+ })
|
||
+ for k, v in args.items():
|
||
+ new_args[k] =3D v
|
||
+ go_binary_rule(**new_args)
|
||
+
|
||
diff --git a/test/BUILD b/test/BUILD
|
||
index 133fe5a..415b9c2 100644
|
||
--- a/test/BUILD
|
||
+++ b/test/BUILD
|
||
@@ -1,4 +1,5 @@
|
||
-load("@io_bazel_rules_go//go:def.bzl", "go_binary", "go_library")
|
||
+load("//rules:go_binary_override.bzl", "go_binary")
|
||
+load("@io_bazel_rules_go//go:def.bzl", "go_library")
|
||
=20
|
||
go_library(
|
||
name =3D "hello_lib",
|
||
@@ -7,22 +8,14 @@ go_library(
|
||
importpath =3D "github.com/motiejus/bazel-zig-cc/test",
|
||
visibility =3D ["//visibility:private"],
|
||
deps =3D [
|
||
- "@com_github_datadog_zstd//:go_default_library",
|
||
- "@com_github_mattn_go_sqlite3//:go_default_library",
|
||
+ "@com_github_datadog_zstd//:zstd",
|
||
+ "@com_github_mattn_go_sqlite3//:go-sqlite3",
|
||
],
|
||
)
|
||
=20
|
||
go_binary(
|
||
name =3D "hello",
|
||
embed =3D [":hello_lib"],
|
||
- gc_linkopts =3D select({
|
||
- "@platforms//os:macos": [
|
||
- "-s",
|
||
- "-w",
|
||
- "-buildmode=3Dpie",
|
||
- ],
|
||
- "//conditions:default": [],
|
||
- }),
|
||
static =3D "on",
|
||
visibility =3D ["//visibility:public"],
|
||
)
|
||
--=20
|
||
2.32.0
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id 758F711EF37
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Fri, 5 Nov 2021 17:51:50 +0000 (UTC)
|
||
Received: by mail-wr1-f50.google.com with SMTP id b12so14932424wrh.4
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Fri, 05 Nov 2021 10:51:50 -0700 (PDT)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=sender:date:from:to:cc:subject:message-id:references:mime-version
|
||
:content-disposition:in-reply-to;
|
||
bh=7twJFp2dPdxRaWs/e7LS95o7UbEONAXKNGJm0Ob1Wjg=;
|
||
b=a1+afz8XHDlEPSMPQ1FTgCSKIt1O6BU6Rd4OMsdb+YfNN0HarXLbPXkX4nwcoQVJZl
|
||
x0TBYE3Lv3abwUPqgPzEvO2sLMXjYZr+ys2guFw/LE3OUQwzEaewfhGeM7mJKoc9wlcf
|
||
i5BNu3VV3MsDnylAcsasQ2W/9eEkhZbsQIILo+XOQjiBkEW7CmzR2aSg5bsTLYbGBjz5
|
||
4ERwpIY9uod2Z7w4cucD22+vJjRatF7upBT0EqPSw7Pkb5UUvac/z0u0tLh+uoIN+Xw9
|
||
d/X/U1GpLXoKyGTwMqq3JCNPXwaESWJdtRmzXXtW3fAC10J7Pa2a8suCwFYSiBOctRhd
|
||
wVXA==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:sender:date:from:to:cc:subject:message-id
|
||
:references:mime-version:content-disposition:in-reply-to;
|
||
bh=7twJFp2dPdxRaWs/e7LS95o7UbEONAXKNGJm0Ob1Wjg=;
|
||
b=LzlcGF6wJrQFFQM72QIjedm8gc+GZmW44ruRoyW2VSCL/XTPU47Ort7mBfXb51+d0/
|
||
HLI5U6348cQ393BjvT1Sl3xByrOLnM7E6rQLQ45WbTAjIbmXTKzOp3ngAAmeiSDuo9XN
|
||
IBZFmmu6Ztil9eyyBr1zN9u4yPyLS0OS44m1coDmUG7j4hqsWaUL/e6qZayoYMQyXBzI
|
||
g32V/kYSxO+2gcpzc2yI+xVewyST29fczusxH8F33q6ky3FK1nAgpTpSsOmpXQND9K3/
|
||
8+5lYmEXYeEIjmR73OlWwQ8qC4NJK6Q3vlaJf5ts7I8unS/E/mN6aNQyespWDRsEUZ4b
|
||
D9Aw==
|
||
X-Gm-Message-State: AOAM532XofickUl56P1GLD+NqdFHGBckg60NosiMHdXkJsbJ8j24RYrE
|
||
rXjKqltKIHdehkIOocslQnc=
|
||
X-Google-Smtp-Source: ABdhPJylZROyH/qdWll3OEJtLDTYrSm3ZUIC8mX0SUk/ck3AxLsAnvVQEyMX4exhznKgRF84qJrdFg==
|
||
X-Received: by 2002:a05:6000:143:: with SMTP id r3mr5508367wrx.236.1636134709441;
|
||
Fri, 05 Nov 2021 10:51:49 -0700 (PDT)
|
||
Received: from localhost ([195.235.63.50])
|
||
by smtp.gmail.com with ESMTPSA id n7sm8534493wro.68.2021.11.05.10.51.48
|
||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||
Fri, 05 Nov 2021 10:51:48 -0700 (PDT)
|
||
Sender: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <desired.mta@gmail.com>
|
||
Date: Fri, 5 Nov 2021 19:51:54 +0200
|
||
From: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
To: ~mjonaitis <mjonaitis@uber.com>
|
||
Cc: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Subject: Re: [PATCH bazel-zig-cc v2] add go_binary override
|
||
Message-ID: <20211105175154.bzfuu666zuaxyt27@mtpad.i.jakstys.lt>
|
||
References: <163611954593.18596.9121656084211429991-0@git.sr.ht>
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=utf-8
|
||
Content-Disposition: inline
|
||
In-Reply-To: <163611954593.18596.9121656084211429991-0@git.sr.ht>
|
||
|
||
On Thu, Nov 04, 2021 at 06:54:42PM +0200, ~mjonaitis wrote:
|
||
> From: Mantas Jonaitis <mjonaitis@uber.com>
|
||
>
|
||
> ---
|
||
> BUILD | 2 ++
|
||
> README.md | 7 +++++++
|
||
> rules/BUILD | 0
|
||
> rules/go_binary_override.bzl | 26 ++++++++++++++++++++++++++
|
||
> test/BUILD | 15 ++++-----------
|
||
> 5 files changed, 39 insertions(+), 11 deletions(-)
|
||
> create mode 100644 rules/BUILD
|
||
> create mode 100644 rules/go_binary_override.bzl
|
||
|
||
Applied[1], thank you. Although I left only the acknowledgement in the
|
||
README; see [2] for why.
|
||
|
||
Motiejus
|
||
|
||
[1]: https://git.sr.ht/~motiejus/bazel-zig-cc/commit/523943bd35d33f96f946be653311787426149135
|
||
[2]: https://git.sr.ht/~motiejus/bazel-zig-cc/commit/22b5d3e8e38e762a35adbfd4e13bfe5c2fb07972
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-lf1-f45.google.com (mail-lf1-f45.google.com [209.85.167.45])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id 9413211EF81
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Mon, 6 Dec 2021 20:01:32 +0000 (UTC)
|
||
Received: by mail-lf1-f45.google.com with SMTP id n12so28168895lfe.1
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Mon, 06 Dec 2021 12:01:32 -0800 (PST)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=sender:date:from:to:cc:subject:message-id:references:mime-version
|
||
:content-disposition:content-transfer-encoding:in-reply-to;
|
||
bh=XbmO1rVL6sHMTrVhfrqqOl/bwac3U2zY7lWAQ/rHyYI=;
|
||
b=Ui4E27zUkVkuxOSfzUqdvgjLvJt2zihUNYH6RF9nSLXybcoG1pmy2uszNB9mMp4OKE
|
||
cQuFWrQbItNulmWxf1DF3oAEgyKe7TzjEGgayv/9zDmBJzlYpVetrACw5cx1UZjxHK66
|
||
weYxKw7rBN4y9y9mADbf2HLqibIbE61Q2WRJ9N+q09jTqY3t5bOCQaN7NrTnXfvdrMHv
|
||
l2+1m2JnjwmHVWnpYNaKODmnO7yBl2G/JtBF7iaVx2gzP8oYtGHZREWaeYfHuAQJtaqB
|
||
53rMyZIceJJBpsNv0Od2W/gbBXEtiER5ESSg3zFwZySBYdF5KGfnsa3fclAAxZOKyEkc
|
||
n8jg==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:sender:date:from:to:cc:subject:message-id
|
||
:references:mime-version:content-disposition
|
||
:content-transfer-encoding:in-reply-to;
|
||
bh=XbmO1rVL6sHMTrVhfrqqOl/bwac3U2zY7lWAQ/rHyYI=;
|
||
b=xItNJQnvwvQPGYo/eRO3rcIcghIeEYeqaHhNjWXULh3N/u95sFwCOaPITMuXYQGi3Q
|
||
Ob4+R3CDSl54/jzyIM9UTdXO7l9Cjoc46/uE3PcTBxchclkg5wvlW+gf7qqcOPh1CT6N
|
||
2yOR9Zm0lm5SsekIu7TZ/i/bt0ki+xegDDLDIkfpaS6FMbAwxpsC8UTU0+Cjro+6z6/b
|
||
VeL4OKWI/brQARrFG3ou2k3SEH/5fGDDosuDXuvJLNxHfL19epeM1wRwKu5DNMCN0Xwf
|
||
a87rrTOyys46rLwxGIiMzJ774y6pUlTWWyw4Wats/CmugLFoaaAXWLBqIQdvkSuhJm+V
|
||
GtXw==
|
||
X-Gm-Message-State: AOAM530mwZuS8Zn37xIFZxYCoDokFqKGJTy4gP29snlm1IBQBAVALfoZ
|
||
gpL3eENl0BUbF1SG2YeWITc=
|
||
X-Google-Smtp-Source: ABdhPJzSblFiitOVK4mUPDvYX2C+QgZFR6SJ06DAAEp2kDJ1On6O52o6QBmThDQZbAdysSZh0aIlgQ==
|
||
X-Received: by 2002:a05:6512:2305:: with SMTP id o5mr37990569lfu.362.1638820890548;
|
||
Mon, 06 Dec 2021 12:01:30 -0800 (PST)
|
||
Received: from localhost ([88.223.105.24])
|
||
by smtp.gmail.com with ESMTPSA id q24sm1443528lfp.103.2021.12.06.12.01.29
|
||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||
Mon, 06 Dec 2021 12:01:29 -0800 (PST)
|
||
Sender: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <desired.mta@gmail.com>
|
||
Date: Mon, 6 Dec 2021 22:01:28 +0200
|
||
From: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
To: Thomas Way <tway@cloudflare.com>
|
||
Cc: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Subject: Re: bazel-zig-cc contributions
|
||
Message-ID: <20211206200128.vyx7b4r5h2moe5dk@mtpad.i.jakstys.lt>
|
||
References: <CAO8CkMSaFSeYVsgczJPStPz9M3LDZCUdABRo8Pk1+=U6v-NT0Q@mail.gmail.com>
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=utf-8
|
||
Content-Disposition: inline
|
||
Content-Transfer-Encoding: 8bit
|
||
In-Reply-To: <CAO8CkMSaFSeYVsgczJPStPz9M3LDZCUdABRo8Pk1+=U6v-NT0Q@mail.gmail.com>
|
||
|
||
On Mon, Dec 06, 2021 at 05:57:46PM +0000, Thomas Way wrote:
|
||
> Hey Motiejus!
|
||
> Thank you so much for your work on the Zig CC rules. They're been
|
||
> extremely helpful and a true gamechanger for the way we work with our
|
||
> repository.
|
||
> Per Zig's cache race conditions, we've made some changes to the rules and
|
||
> were wondering what the best way to contribute them would be?
|
||
|
||
Hi Thomas!
|
||
|
||
See [1]; I also recommend you to subscribe. I haven't heard of anyone
|
||
using bazel-zig-cc, so I guess I'll need to be more careful/upfront
|
||
about breaking changes.
|
||
|
||
> A quick summary:
|
||
> - Use an alias for the Go-style toolchain. This should be more efficient.
|
||
> - Some general cleanup of unused features (i.e unnecessary filegroups).
|
||
> - Most importantly: Use a cache location inside Bazel. We found that
|
||
> sometimes Zig's cache would become corrupt on the host and would become
|
||
> irrecoverable even after running `bazel clean --expunge`. Using a cache
|
||
> location inside Bazel fixes this issue and is good practise in general I
|
||
> believe.
|
||
|
||
These sound great, send them over!
|
||
|
||
> I look forward to hearing from you.
|
||
|
||
Have you found a need/way to specify a different default url for the zig
|
||
bundle? I've been playing with it[2], but unsatisfied with the API so
|
||
far.
|
||
|
||
Motiejus
|
||
|
||
[1]: https://sr.ht/~motiejus/bazel-zig-cc/#contribution-guidelines
|
||
[2]:
|
||
https://git.sr.ht/~motiejus/bazel-zig-cc/commit/8f5f249227aa6a9d3de441058eb9d3aae330620b
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id 9975311EF93
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Fri, 10 Dec 2021 07:57:40 +0000 (UTC)
|
||
Received: by mail-lf1-f42.google.com with SMTP id m27so16481755lfj.12
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Thu, 09 Dec 2021 23:57:40 -0800 (PST)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=sender:date:from:to:subject:message-id:mime-version
|
||
:content-disposition;
|
||
bh=HQ/hL64B6GWzGaNBVZUn4QLaOj38mBj6tYEQkF5T6Hc=;
|
||
b=HRbxSWHJkd1mlvqgFdlGyFOVOlXJr8/e2Tz9lm1YMGwoH50u/oTHT0Qv3csF9/DxXs
|
||
0vAyK8YeTncB6iGP/uyCF2mzrTRLsWaJXwYMmRGq0Q32iQkHjURwdbaruxZF/EAHx4V9
|
||
1O20KHVUapedNnIzdC940UhaYnwTolyUi7tHj6dQLPyA26ukzQK6TYjrlNRZa5qyogX5
|
||
W3OTN1Kk0mfU8IOWyCJocFb0sozLbzT//HP/L+UfXkid4IvtpuEfTLIkBr/Ez0fZEXtY
|
||
0HW3+PZKwNBV8A1eMNfmX+aW0XPfPpek8mCZ41iGi/5TEBdO2O75520iDnYXYqfc4VZ2
|
||
VuCA==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:sender:date:from:to:subject:message-id
|
||
:mime-version:content-disposition;
|
||
bh=HQ/hL64B6GWzGaNBVZUn4QLaOj38mBj6tYEQkF5T6Hc=;
|
||
b=rgCpluQpBDnpflGkjPs3XJ4t/c293EfjPhwWqR6bwA+eGn12gq6HsZ8ZC+aPW2TBVX
|
||
rdcNzG6RWq4v4asAp8Ng3pDESOGLPADxlsLqS/RxW6pqTzZXNE67kCvoEDEzZ6mE8bIg
|
||
AK56XSqB6bfUkl9PJbd4R7l6O4EZjM/7AQGoSY3xW1OQ2XXvQ8PjMNWrSuF6rZVq02y6
|
||
MuxhGBzQer/LQmI8M6XL9lNAYKJzeimwG2zVzmGWX+d1cJig37qc3QF1HBK57PG6rxnw
|
||
gteWVE/yPY5J3ul1aBTW0VV3seXnb8KixoihOsvc7aH0/PqxjyV6Fga8WbFQvwpDat7c
|
||
JRhQ==
|
||
X-Gm-Message-State: AOAM533n1LpdCI+K//K6+CY/Cqn/Tw+F334UDBFn1SSG0G+TDXt+3kt+
|
||
8NFjbzbVpYsCB/CYuQVrhM+W99Yg5Ck=
|
||
X-Google-Smtp-Source: ABdhPJz07XVpRcQkYipcpP+OcZMq1nSXbEg5HLv7ziv6SBn8gWkNFCfBr4BGn3fJkpaD+Ur7p/dZpg==
|
||
X-Received: by 2002:ac2:5f85:: with SMTP id r5mr10983167lfe.566.1639123055422;
|
||
Thu, 09 Dec 2021 23:57:35 -0800 (PST)
|
||
Received: from localhost (m90-131-39-222.cust.tele2.lt. [90.131.39.222])
|
||
by smtp.gmail.com with ESMTPSA id a1sm262188lfb.190.2021.12.09.23.57.34
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>
|
||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||
Thu, 09 Dec 2021 23:57:34 -0800 (PST)
|
||
Sender: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <desired.mta@gmail.com>
|
||
Date: Fri, 10 Dec 2021 09:57:33 +0200
|
||
From: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Subject: recent changes in bazel-zig-cc
|
||
Message-ID: <20211210075733.ihb2b57lyges4l6d@mtpad.i.jakstys.lt>
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=utf-8
|
||
Content-Disposition: inline
|
||
|
||
Hi bazel-zig-cc users,
|
||
|
||
Due to a recent bug-fixing spree in zig, bazel-zig-cc improved quite a
|
||
bit:
|
||
|
||
- `zig c++` no longer errs with the dreaded FileNotFound[1]. This was
|
||
very prominent on many-core machines, and now unblocked larger-scale
|
||
tests.
|
||
- can compile Darwin again: x86_64[2] and aarch64[3]. Although if you
|
||
are interested in compiling for Darwin, Jakub's comments in [3] are
|
||
must-read.
|
||
|
||
My only short-term wish-list from Zig today is [4]: if Foundation
|
||
framework is requested, but zig doesn't find it, the compiler should
|
||
fail. Currently only a warning is emitted, and the binary is wedged with
|
||
a possibly "difficult to track runtime exception"[5]:
|
||
|
||
```
|
||
warning(link): framework not found for '-framework CoreFoundation'
|
||
warning(link): Framework search paths:
|
||
```
|
||
|
||
I added an Upcoming Wishlist category to the README[6], which is:
|
||
|
||
- Move Zig cache path to bazel root, so bazel clean --expunge clears the
|
||
zig cache.
|
||
- Provide a way to specify alternative URLs for the zig toolchain
|
||
(currently zig is downloaded from jakstys.lt, which is nuts).
|
||
- Rename @zig_sdk//:<toolchain>_toolchain to
|
||
@zig_sdk//toolchain:<toolchain> or similar; so the user-facing targets
|
||
are in their own namespace.
|
||
- Provide a way to specify sysroot for Darwin (OSX). See [#Compiling OS X
|
||
executables] for an ongoing discussion.
|
||
|
||
As bazel-zig-cc is only ~10% of my $dayjob, I am not planning to work on
|
||
the above any time soon. But it gives a nice starting point for a
|
||
question "how do I help/contribute"?
|
||
|
||
Zig 0.9.0 is 10 days away, I will cut bazel-zig-cc 0.4.0 once that
|
||
happens.
|
||
|
||
[1]: https://github.com/ziglang/zig/issues/9431
|
||
[2]: https://github.com/ziglang/zig/issues/10297
|
||
[3]: https://github.com/ziglang/zig/issues/10299
|
||
[4]: https://github.com/ziglang/zig/issues/10299#issuecomment-990404953
|
||
[5]: https://github.com/ziglang/zig/issues/10299#issuecomment-989153750
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id 6E05E11EF94
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Mon, 13 Dec 2021 02:38:20 +0000 (UTC)
|
||
Received: by mail-lj1-f177.google.com with SMTP id bn20so21731895ljb.8
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Sun, 12 Dec 2021 18:38:20 -0800 (PST)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=sender:date:from:to:subject:message-id:mime-version
|
||
:content-disposition;
|
||
bh=yoiGVjBHZN2xJAtcYYTqPfPA8yxvgKQ0VkBgA3ZSX20=;
|
||
b=f1258iMcV/Wbk9swTsCSoWGYASEwg9aI6PY4Ee8hYi1a6CQMkWzwFdEiaaYyCOpABn
|
||
4AtFWDrTM3fZ+ctksbg+tDl782Z9o929B/4SAcfXInX9oKHsobmzO0ChoS7QaFX3JK32
|
||
/sKmWTcN6rLg8BUSmN4D8EkIG3mJV48jx1VdbHKSZtlPxHLHIWMIWJCzsTr9ihVMCYkE
|
||
2lik9ffXQLWbQScNgwirCm14fb44rEBRQ3ooXYBG/wRsPyH+IP15/fZN47AF7kPrITU1
|
||
Pbg2s7PL8WxYNogXtD7f77UsfyN7/YrJOqUIlfe0yxQb1wtMXibAB7su9uSpKZ3/PoIU
|
||
q20w==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:sender:date:from:to:subject:message-id
|
||
:mime-version:content-disposition;
|
||
bh=yoiGVjBHZN2xJAtcYYTqPfPA8yxvgKQ0VkBgA3ZSX20=;
|
||
b=L9A3RyHTzHV+FMUGbXt87CW6BV9dZ7kcW4N2Y6v6EGeuaGYohH7qt5jGFHF3qL2+rk
|
||
lv3ZY/3cCaCgBq1G1QevpO40orf+7Ci4hLvL0YLC8MqI4QWzTemvMJsq3jb8aZ9lBMIs
|
||
HMXrqAuEhqatukjO/o5gykvb6oFhJF56HCwe3dIZgud75BaYNSKZKRvg/1X30S9EjBg3
|
||
+Y+qElbC26lKKpzvTnlG8VI4Gg+W1aMNeaa6gB/ybsddLGIss+jtoKWgI+Pey/P6b1bV
|
||
Hc0mwChymAeWPdIBlYD5cphbFMr9uPl4ceoQCw7l6+du+lI1M2/x5jFUV0taGLBTaHR2
|
||
FadA==
|
||
X-Gm-Message-State: AOAM532NYpPD+ClV9sorQ9xbOrDBd+RgPqTbGjWmHYTxFYWTzBlmr8Ae
|
||
f3Y9g5K1oa/cMkDMkzESuHr/EpL1yy4=
|
||
X-Google-Smtp-Source: ABdhPJwy5PDLB0wyelzZ7tpYgzeQzFLInozFHtZ4lQRvqE0cFrzbeHeXlgo/tK2Bzr/WRZea468KCA==
|
||
X-Received: by 2002:a05:651c:323:: with SMTP id b3mr26998720ljp.316.1639363097753;
|
||
Sun, 12 Dec 2021 18:38:17 -0800 (PST)
|
||
Received: from localhost ([88.223.105.24])
|
||
by smtp.gmail.com with ESMTPSA id z2sm1235075lfd.301.2021.12.12.18.38.16
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>
|
||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||
Sun, 12 Dec 2021 18:38:17 -0800 (PST)
|
||
Sender: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <desired.mta@gmail.com>
|
||
Date: Mon, 13 Dec 2021 04:38:16 +0200
|
||
From: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Subject: bazel-zig-cc v0.4.0-rc1
|
||
Message-ID: <20211213023816.obgjrpaxt445lzpn@mtpad.i.jakstys.lt>
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=utf-8
|
||
Content-Disposition: inline
|
||
|
||
Hi folks,
|
||
|
||
I released v0.4.0-rc1; notable changes from v0.3.4:
|
||
|
||
- upgrade to zig 0.9.0-dev.1950+a76910b69. Now compilation on Darwin
|
||
will fail if `-framework` was specified, but wasn't able to be
|
||
linked[1]. This happens on darwin/arm64, which I had to disable CI
|
||
for. A patch that passes `zig cc --sysroot=/path/to/sdk` is sought
|
||
for, if you care about darwin/arm64 (or darwin in general).
|
||
- remove default `-O3`[2]. This now re-enables UBSAN by default, which
|
||
is an important default in upstream[3].
|
||
|
||
v0.4.0 will be released when zig 0.9.0 is released, which is scheduled
|
||
for Dec 20.
|
||
|
||
About undefined behavior (removal of `-O3`)
|
||
-------------------------------------------
|
||
|
||
The second change broke my use of brotli, which relies on undefined
|
||
behaior[4]. This is my ugly way to mitigate it:
|
||
|
||
Project's WORKSPACE
|
||
```
|
||
BROTLI_COMMIT = "4ec67035c0d97c270c1c73038cc66fc5fcdfc120"
|
||
|
||
http_archive(
|
||
name = "brotli",
|
||
sha256 = "9f57c32e5903768a03900366d8a055d49c01ecbbded046dce47eae24115b58b8",
|
||
strip_prefix = "brotli-%s" % BROTLI_COMMIT,
|
||
urls = ["https://github.com/google/brotli/archive/%s.zip" % BROTLI_COMMIT],
|
||
patch_args = ["-p1"],
|
||
patches = [
|
||
"//patches:brotli-disable-undefined-behavior.patch",
|
||
],
|
||
)
|
||
```
|
||
|
||
And the patch:
|
||
```
|
||
diff --git a/BUILD b/BUILD
|
||
index 07a6793..2b4d1c1 100644
|
||
--- a/BUILD
|
||
+++ b/BUILD
|
||
@@ -43,7 +43,7 @@ config_setting(
|
||
|
||
create_msvc_config()
|
||
|
||
-STRICT_C_OPTIONS = select({
|
||
+STRICT_C_OPTIONS = ["-DBROTLI_BUILD_PORTABLE"] + select({
|
||
":msvc": [],
|
||
"//conditions:default": [
|
||
"--pedantic-errors",
|
||
```
|
||
|
||
If anyone has a better idea how to append a COPT to a downstream Bazel
|
||
project, I would be happy to learn from you.
|
||
|
||
Motiejus
|
||
|
||
[1]: https://github.com/ziglang/zig/pull/10312/
|
||
[2]: https://git.sr.ht/~motiejus/bazel-zig-cc/commit/985e26b474fb7594bb385ce9382def7c95373ca9
|
||
[3]: https://github.com/ziglang/zig/issues/4830#issuecomment-605491606
|
||
[4]: https://github.com/google/brotli/blob/ce222e317e36aa362e83fc50c7a6226d238e03fd/CMakeLists.txt#L104-L108
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-lj1-f172.google.com (mail-lj1-f172.google.com [209.85.208.172])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id 8F7BE11EFCB
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Wed, 15 Dec 2021 13:13:09 +0000 (UTC)
|
||
Received: by mail-lj1-f172.google.com with SMTP id z8so33239469ljz.9
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Wed, 15 Dec 2021 05:13:09 -0800 (PST)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=sender:date:from:to:subject:message-id:mime-version
|
||
:content-disposition;
|
||
bh=Nd/WltjseH/65+GIHu93VIGVBFJcCg0jRhztUcKW+SU=;
|
||
b=YifS23k0ae73nB9jZrmpDfVWyVtYzoJdrWXc+5MNan5dueiYI+Pmjnkg9jxIEOwcnL
|
||
+VQHmcJ/Y9M6AdNgdKZwndRPHH0Czcw5mAcY0TeM47/bsU3T430BePLSIS5/O6p6JX/2
|
||
Hwxm8E9j6Z7zWCGPQZaZp+rFNsF2Zu9O26JiTRJQUhLsUysQG6FZknoPtpfX3BeZ+yoM
|
||
v2LcX8luagONzI+/x3P45oLzYKCDigtt18ZB3KRPNEshaf5dmN8RStVg1IDrw1FjUtRT
|
||
oL9zGkok8U8knDDek8p7lhB3MRboeGt594Ne5yQY/fbAJ2/X+Z1+xj7B4K6RRPlnHRXO
|
||
OAUQ==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:sender:date:from:to:subject:message-id
|
||
:mime-version:content-disposition;
|
||
bh=Nd/WltjseH/65+GIHu93VIGVBFJcCg0jRhztUcKW+SU=;
|
||
b=pf8ogSdB1vOvUEquKYzJlAQtWpqT33q/Bg6qFpxtPUo1WjfP9wQr2AaOrjf5vw6aop
|
||
xEwyTnjTlepxIE+vzRGJia9BFnl1521dGEJQEs3U1+oUsuBbVRakm8nHmW/nxOXuMJAY
|
||
5ZO5wINNUWWAXNCoqAt9IL+AwhgnPu2ywTUtB7U+lSp04UuiykNScGtuZJ2RUx5P+0aj
|
||
Fe0POq1r5B4A7Jd7CqsD1ScZryljzSpljtqAUoDyofvfGG9IThOIGh2/7CWvFFgJW8Ad
|
||
ZSHXjUYfzwt/y3MJLaJplBF5rsFzROStOsSGLx30sltzXSmCrrJYG1LtXuAIm5rgj1SJ
|
||
6rrw==
|
||
X-Gm-Message-State: AOAM533R97q6G/KfXwqKpV2oIKXGZVFqUK4F6MiTLkJRDOtDFFszGnUt
|
||
aYBdph3HB+26HO13BPLB93gvtQqpLtc=
|
||
X-Google-Smtp-Source: ABdhPJx3uV4VjLPjCmWnmHQG63N7zAf+Y2l6UqhNBFLQzu4Z0QoQypdM5i/S04/3RQt/gC2gd7mUZw==
|
||
X-Received: by 2002:a2e:7305:: with SMTP id o5mr10152834ljc.180.1639573987957;
|
||
Wed, 15 Dec 2021 05:13:07 -0800 (PST)
|
||
Received: from localhost ([88.223.105.24])
|
||
by smtp.gmail.com with ESMTPSA id o24sm316972lfr.117.2021.12.15.05.13.07
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>
|
||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||
Wed, 15 Dec 2021 05:13:07 -0800 (PST)
|
||
Sender: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <desired.mta@gmail.com>
|
||
Date: Wed, 15 Dec 2021 15:13:06 +0200
|
||
From: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Subject: bazel-zig-cc v0.4.0-rc2
|
||
Message-ID: <20211215131306.toz7czanzdhhukbe@mtpad.i.jakstys.lt>
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=utf-8
|
||
Content-Disposition: inline
|
||
|
||
Hi folks,
|
||
|
||
I released v0.4.0-rc2, this time only upgrading zig to
|
||
0.9.0-dev.1968+ff93486d0 (from 1950). Two notable changes with regards
|
||
to `zig cc`:
|
||
|
||
- [darwin] zig cc will now fail hard if `-framework` is specified, but
|
||
not found. It used to produce a strange-looking, likely-unworkable
|
||
binary.
|
||
- glibc stubs are fixed[2]. I have been waiting for this for a long
|
||
time. More on this in HN[3].
|
||
|
||
These resolve the last known high-severity issues. Thanks zig team! As I
|
||
am not expecting any final-day fixes in zig itself, there likely won't
|
||
be an rc3. A few weeks after 0.9.0 is released, I am planning to remove
|
||
the dev versions from my mirror[4].
|
||
|
||
Tip of the day
|
||
--------------
|
||
|
||
This is helpful in `.bazelrc`:
|
||
|
||
build --compilation_mode=opt
|
||
|
||
This makes non-tests to be compiled with -O2. Tests will be compiled
|
||
without optimizations, making compilation faster, and retaining
|
||
UBSAN[5].
|
||
|
||
Open questions
|
||
--------------
|
||
|
||
The question from last week[6] still holds: how to adjust CFLAGS for an
|
||
external Bazel project?
|
||
|
||
Motiejus
|
||
|
||
[1]: https://github.com/ziglang/zig/pull/10312
|
||
[2]: https://github.com/ziglang/zig/pull/10330
|
||
[3]: https://news.ycombinator.com/item?id=29538264
|
||
[4]: https://dl.jakstys.lt/zig/
|
||
[5]: https://github.com/ziglang/zig/issues/4830#issuecomment-605491606
|
||
[6]: https://lists.sr.ht/~motiejus/bazel-zig-cc/%3C20211213023816.obgjrpaxt445lzpn%40mtpad.i.jakstys.lt%3E
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id E229D11EF12
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Mon, 27 Dec 2021 08:41:55 +0000 (UTC)
|
||
Received: by mail-lj1-f177.google.com with SMTP id i11so12257671ljm.13
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Mon, 27 Dec 2021 00:41:55 -0800 (PST)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=sender:date:from:to:subject:message-id:mime-version
|
||
:content-disposition;
|
||
bh=wbwsWNmX9ACiddCLR8HrD69hw93GH+pGJxzcr23R6rM=;
|
||
b=dJQmTKPHoBlHHAkyWNFHks9q1bXMAkrYrZl5scATSk3Njq3uDtNg6ZePXJE2E52O8j
|
||
5t3SLmKPiCE4cljIPqMwljlWHrKZZJ3kc4a6cnGGGdXhOV53CHBYg/ox7Ck8f06/v6Ja
|
||
Rnw3hk5ExzZdfNIpieCztf5pAczKs+EJ83cxoJOR0KvGdof0gWsOop2M59eFpIEDuBzn
|
||
wlgxkVdd3zwmO2lOS7QUwosUkIbOyZkqY7JooI6WvL6GNcxeZdzGZrGy79F2oy1Y9cNc
|
||
pxAU1lr/REJg05oAR2T4pnRE5CKu2IEcxQhrj93Ev6xMxsvoNBl+1lPBGRoQjN0mH53i
|
||
bD1w==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:sender:date:from:to:subject:message-id
|
||
:mime-version:content-disposition;
|
||
bh=wbwsWNmX9ACiddCLR8HrD69hw93GH+pGJxzcr23R6rM=;
|
||
b=0a0GA3vwn7I9H5bZ+7j9JKANjBci6Cy6bVy2w2CwnWwTaa7DFuQtq3WPn1ew623EN3
|
||
0MOuhwhGNKATpe2xicuCNX0bGAYcdELucvNqCRgtJmCCemuvpNhft+iqNFqbikUU104R
|
||
MXZJ4umCMwL7q9qFSHFZ2ss7yzsOpPipUsEx8vUfzbWDK+t/C0k8TbqPYu9J5GxTM0Ij
|
||
pykyVmYm1dZgTnZ2/MnnTupfSVB0lyT1IVCaKlcShPKNoZBMVVoGlSPC9OcwrxvFmCyO
|
||
/1VVlw3/SSvaDsubVmRRLygqLzc2g+u4u4qvhgFm6jIwycYgUMQmftvWCpg+byXQi1w2
|
||
+YIw==
|
||
X-Gm-Message-State: AOAM53232Y6heOR1VRU9KAEewm/STKfMJjfFhmrKpvp33SRSRIjhReRT
|
||
MzLK1b9lTWFqiutkuzy6t/tEP8Xd2Nw=
|
||
X-Google-Smtp-Source: ABdhPJx6ysrzoYMTFmAldsjWAd2AmWOnspuGaPYDfO1NywR7rTlaoEe1V3yyloNzmWWczgMgR9EN1A==
|
||
X-Received: by 2002:a05:651c:12c3:: with SMTP id 3mr13364719lje.311.1640594514193;
|
||
Mon, 27 Dec 2021 00:41:54 -0800 (PST)
|
||
Received: from localhost ([88.223.105.24])
|
||
by smtp.gmail.com with ESMTPSA id z17sm1581748lfu.128.2021.12.27.00.41.53
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>
|
||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||
Mon, 27 Dec 2021 00:41:53 -0800 (PST)
|
||
Sender: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <desired.mta@gmail.com>
|
||
Date: Mon, 27 Dec 2021 10:41:52 +0200
|
||
From: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Subject: upcoming bazel-zig-cc 0.4.0
|
||
Message-ID: <20211227084152.mjkx33nbxhnls5qz@mtpad.i.jakstys.lt>
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=utf-8
|
||
Content-Disposition: inline
|
||
|
||
Hi folks,
|
||
|
||
I cannot yet release bazel-zig-cc 0.4.0, because there is a regression
|
||
in `zig c++`; you may follow along here[1].
|
||
|
||
I am happy bazel-zig-cc CI caught this[2]; this regression was quite
|
||
easy to trigger.
|
||
|
||
I accidentally pushed 0.4.0 a few days ago, but promptly deleted the
|
||
tag. If you managed to catch 0.4.0 (it was there for <1 hour), please
|
||
remove the tag. My mistake, I will try harder not to do this again.
|
||
|
||
Note that this affects only glibc targets; I am successfully using zig
|
||
0.9.0 with a musl target (0.4.0-rc2 with a custom zig version).
|
||
|
||
Regards,
|
||
Motiejus
|
||
|
||
[1]: https://github.com/ziglang/zig/issues/10386
|
||
[2]: https://builds.sr.ht/~motiejus/job/654617
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id 3EB8D11EFDB
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Tue, 4 Jan 2022 17:16:46 +0000 (UTC)
|
||
Received: by mail-wr1-f54.google.com with SMTP id q16so77569936wrg.7
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Tue, 04 Jan 2022 09:16:46 -0800 (PST)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=mime-version:from:date:message-id:subject:to;
|
||
bh=KTpeB6mEXbEVO9a1XtNR3GFzrxOFWa+ZXF8Ntx3rgQE=;
|
||
b=Xqqvwjx/OFAQCXqZrQRRfr4f/6Hy6ogWOP8o9/6CBrtsLEFipeCcyCM4UlWOpa/9Fy
|
||
VKSnc4F2ZzQVZVUES7wSf7KFum76ug5kMU5PwBuFX9A8bEf9lcHrpCxXN3x9H+9TPvC6
|
||
7sKeEX/UHtzvz+DW+rRwhFs8avs4emaJytc1g/5xrdZHYzRQBJjc0JOQk4YmenkQWYh5
|
||
CoCPoKtD+0AHORd7s4bAjdxHcSuNco/9YOtrNcpbpJoZWpBuF89vpOhiNnXkjHZ+Ib5r
|
||
fpS0I0H/WuM6OPAtWk/9buSDH8eMqeQvdFfM8NQOQpfnuznjacKtcOmDxitr3qGpYlP0
|
||
o1rQ==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:mime-version:from:date:message-id:subject:to;
|
||
bh=KTpeB6mEXbEVO9a1XtNR3GFzrxOFWa+ZXF8Ntx3rgQE=;
|
||
b=EoaQhWc7ZeEt+nZ4OO9aWJ8EBVIwUx77DkAP8gfTjY4TOTQdw3NvqB8IXfMOaKncLL
|
||
jHzl5jeG2xBsKuMluZ5T39g+CHXiauQpeE6xAwO1tMdspk8LLhNtqNXiE03o/MKLi2DX
|
||
n0Z2CNfyj5kIXSn4+xGuGjoxxj3skjGSu8Qo81FdEzmQYeSCXsRGuiPehleMRtjyo4Y6
|
||
wppYadALhSCdQYpYtBK260baG1d8NlhO0I8qT3EGA9svs6Pq+2Jmn64poWYcLrwXdehI
|
||
hgKWt1gq9HEetyBTozHsntK3+rM5I/9rWaqoisQ2RXCHjLk7ABmXRT+GnG/TPOklhyH2
|
||
bvOA==
|
||
X-Gm-Message-State: AOAM533nQTAoOK3lrkUd5a9qUOIOlNZqE9sijsCribhFatAX7FRj5Yk4
|
||
AAxFSmbbSf9wffS6dz99DqKatIhgqm/6eHoqtxtPf1bPXSk=
|
||
X-Google-Smtp-Source: ABdhPJz5SDvu+LXfelCJO5FWEZ1/pCy7suiHJOP2dd4cF85wjaqUTXVLRsNB38Gvt9oPDvc//YU8gletRsD/roItGgQ=
|
||
X-Received: by 2002:adf:fc0d:: with SMTP id i13mr42706077wrr.296.1641316604314;
|
||
Tue, 04 Jan 2022 09:16:44 -0800 (PST)
|
||
MIME-Version: 1.0
|
||
From: Joe Schafer <joesmoe10@gmail.com>
|
||
Date: Tue, 4 Jan 2022 09:16:33 -0800
|
||
Message-ID: <CAOGO9CoqMcAp=_9KVB3g9o5Jp45OtcAP7TT_Cn_Gom-YfQ9pew@mail.gmail.com>
|
||
Subject: uname -m on M1 MacBook returns arm64
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Content-Type: text/plain; charset="UTF-8"
|
||
|
||
Hello,
|
||
|
||
I'm a big fan of this project. It's *lot* easier than trying to figure
|
||
out other Bazel CC toolchains.
|
||
|
||
One of my teammates ran into a curious error on an M1 Macbook using
|
||
the latest bazel-zig-cc.
|
||
|
||
cc/toolchain/defs.bzl", line 219, column 70, in _zig_repository_impl
|
||
zig_include_root =
|
||
repository_ctx.attr.host_platform_include_root[host_platform]
|
||
Error: key "macos-arm64" not found in dictionary
|
||
|
||
I traced this to toolchain/defs.bzl [1] which uses `uname -m` to get
|
||
the architecture. It looks like bazel-zig-cc only supports aarch64 but
|
||
M1 Macs return arm64.
|
||
|
||
What's really spooky is that bazel-zig-cc worked on my M1 mac but it
|
||
didn't work for two other devs on my team also on M1 macs; they got
|
||
the above error.
|
||
|
||
I was able to work around the problem with the following steps:
|
||
https://gist.github.com/jschaf/c9be10d806020087680310e49f6e2072.
|
||
|
||
- Uploaded all zig SDKs to my own hosting. I had to use my own hosting
|
||
to create macos-arm64 which is really just a copy of maco-aarch64 but
|
||
I had to change the folder name to match the archive name.
|
||
|
||
- Added "macos-arm64" to host_platform_include_root, similar to "macos-aarch64".
|
||
|
||
I'm by no means a Bazel toolchain expert, but I would have thought
|
||
there's a better way to get the host platform architecture than by
|
||
shelling out to uname. Appears that there's not [2] but that answer is
|
||
from 2017. Maybe platforms provide a way out [3]?
|
||
|
||
[1]: https://git.sr.ht/~motiejus/bazel-zig-cc/tree/main/item/toolchain/defs.bzl#L210
|
||
[2]: https://stackoverflow.com/a/45029999/30900
|
||
[3]: https://github.com/bazelbuild/rules_go/blob/master/go/private/go_toolchain.bzl#L95
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-ed1-f41.google.com (mail-ed1-f41.google.com [209.85.208.41])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id E27F211EEAC
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Tue, 4 Jan 2022 19:01:44 +0000 (UTC)
|
||
Received: by mail-ed1-f41.google.com with SMTP id j21so152096346edt.9
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Tue, 04 Jan 2022 11:01:44 -0800 (PST)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=sender:date:from:to:cc:subject:message-id:references:mime-version
|
||
:content-disposition:in-reply-to;
|
||
bh=sqozoOSn/Xg8xLEoqSt6hEPuCR5lAjjcsfSFhFhcG28=;
|
||
b=a5i7J7P+5dbR5hl9nrzn0rGAkpdY0vv+Cc/GvjD76am5EYdD6fAfwSTe7zkNzUa057
|
||
9BHEl6yT3TJB64QY7y46wtmX2arRDct0A1vVBi3rkNeU9qNm7HAc9SyjMMWH3qnKYjPj
|
||
/2hKFGMdZl8nPSQQLbe5jNHWWjy4pHjTufC3T0bnslJYRb/ZF/St8ceebXJdsd2QK39r
|
||
lOsuZBdKccvOU4hCU16mI+TNlXSCru8VJoagGVFrct1KumgBPaMw9TPacKtGAhJGtO2S
|
||
K1v6VICmXAKJQdpUpAjJGDA8SWMTbK66r8ePnQCfmTIw5ulTzWnZsstAhlbJZ4iIXaKy
|
||
0UKA==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:sender:date:from:to:cc:subject:message-id
|
||
:references:mime-version:content-disposition:in-reply-to;
|
||
bh=sqozoOSn/Xg8xLEoqSt6hEPuCR5lAjjcsfSFhFhcG28=;
|
||
b=Sh6rOJJbCS73hQaXWJ24BSAdUhnVxIcU9hHGN5WQIPR4n4jP+sEJjaN4kVurdXFwhP
|
||
XlpdrGSkqKLwjhYUI66FDhQBMIh2kylKLftNE8C0u027dJ/iGtRnGbdUQXOAf6Q8E8+b
|
||
+lMJoI55Jvl0g+ytjpGDyXUYgnZj7jxuWtZTchTRiB1f+GbBpPxIQtexfo9FbnWfM0gk
|
||
6tUJlR9VFLallMaiIDyJmgdDKhgN6xpd2Z8dUvK3GApXvgUjimuOHgiU/0omX5giImRB
|
||
3+XhMfBShAVDj3hFL+gWid4JB0YMZyr7TqRB0JJyCTZ8k9xxMnzKslN0fAqoaQW/rfxX
|
||
lKMg==
|
||
X-Gm-Message-State: AOAM531XYd7AS2cJLP7y2V3qLSjker6j1R0GeTmQmEqRsP+VLbmd6h09
|
||
1xv4u9Wi6FL3PkC+fRkk1PE=
|
||
X-Google-Smtp-Source: ABdhPJxmWYo6/XUgdzhYjIyhKSbIam61biE8MnttlBA315Az3EYiIUwHczhxeqqmFvn3kXL69nQs5A==
|
||
X-Received: by 2002:a05:6402:1702:: with SMTP id y2mr49857910edu.372.1641322903749;
|
||
Tue, 04 Jan 2022 11:01:43 -0800 (PST)
|
||
Received: from localhost (c54-242.i04-14.onvol.net. [84.255.54.242])
|
||
by smtp.gmail.com with ESMTPSA id nd36sm11599581ejc.196.2022.01.04.11.01.42
|
||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||
Tue, 04 Jan 2022 11:01:43 -0800 (PST)
|
||
Sender: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <desired.mta@gmail.com>
|
||
Date: Tue, 4 Jan 2022 20:01:42 +0100
|
||
From: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
To: Joe Schafer <joesmoe10@gmail.com>
|
||
Cc: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Subject: Re: uname -m on M1 MacBook returns arm64
|
||
Message-ID: <20220104190142.gwu27ru3iprhkyr2@mtpad.i.jakstys.lt>
|
||
References: <CAOGO9CoqMcAp=_9KVB3g9o5Jp45OtcAP7TT_Cn_Gom-YfQ9pew@mail.gmail.com>
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=utf-8
|
||
Content-Disposition: inline
|
||
In-Reply-To: <CAOGO9CoqMcAp=_9KVB3g9o5Jp45OtcAP7TT_Cn_Gom-YfQ9pew@mail.gmail.com>
|
||
|
||
On Tue, Jan 04, 2022 at 09:16:33AM -0800, Joe Schafer wrote:
|
||
> Hello,
|
||
>
|
||
> I'm a big fan of this project. It's *lot* easier than trying to figure
|
||
> out other Bazel CC toolchains.
|
||
>
|
||
> One of my teammates ran into a curious error on an M1 Macbook using
|
||
> the latest bazel-zig-cc.
|
||
>
|
||
> cc/toolchain/defs.bzl", line 219, column 70, in _zig_repository_impl
|
||
> zig_include_root =
|
||
> repository_ctx.attr.host_platform_include_root[host_platform]
|
||
> Error: key "macos-arm64" not found in dictionary
|
||
>
|
||
> I traced this to toolchain/defs.bzl [1] which uses `uname -m` to get
|
||
> the architecture. It looks like bazel-zig-cc only supports aarch64 but
|
||
> M1 Macs return arm64.
|
||
>
|
||
> What's really spooky is that bazel-zig-cc worked on my M1 mac but it
|
||
> didn't work for two other devs on my team also on M1 macs; they got
|
||
> the above error.
|
||
|
||
Hi, Joe,
|
||
|
||
that's interesting indeed. I don't have an M1 mac, nor know anyone
|
||
with M1 mac, to test this "more closely".
|
||
|
||
> I was able to work around the problem with the following steps:
|
||
> https://gist.github.com/jschaf/c9be10d806020087680310e49f6e2072.
|
||
>
|
||
> - Uploaded all zig SDKs to my own hosting. I had to use my own hosting
|
||
> to create macos-arm64 which is really just a copy of maco-aarch64 but
|
||
> I had to change the folder name to match the archive name.
|
||
>
|
||
> - Added "macos-arm64" to host_platform_include_root, similar to "macos-aarch64".
|
||
>
|
||
> I'm by no means a Bazel toolchain expert, but I would have thought
|
||
> there's a better way to get the host platform architecture than by
|
||
> shelling out to uname. Appears that there's not [2] but that answer is
|
||
> from 2017. Maybe platforms provide a way out [3]?
|
||
|
||
Re [3]: looks like `declare_toolchains` is an external function, and it
|
||
accepts `host` as a parameter, which should be set by the caller? If so,
|
||
I am not following how that would help.
|
||
|
||
If you can dig in for more information why `uname -m` returns arm64 vs
|
||
aarch64 (OSX minor version? something else?). If there is no other way
|
||
out, I would be OK to for an internal workaround to map darwin/arm64 to
|
||
darwin/aarch64 during download, provided it's the only problem
|
||
|
||
Is downloading the toolchain the only problem? Once you add that
|
||
workaround, does it keep working as one would expect?
|
||
|
||
Motiejus
|
||
|
||
> [1]: https://git.sr.ht/~motiejus/bazel-zig-cc/tree/main/item/toolchain/defs.bzl#L210
|
||
> [2]: https://stackoverflow.com/a/45029999/30900
|
||
> [3]: https://github.com/bazelbuild/rules_go/blob/master/go/private/go_toolchain.bzl#L95
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-wr1-f47.google.com (mail-wr1-f47.google.com [209.85.221.47])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id 51C2B11F170
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Thu, 6 Jan 2022 22:43:41 +0000 (UTC)
|
||
Received: by mail-wr1-f47.google.com with SMTP id a5so3645821wrh.5
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Thu, 06 Jan 2022 14:43:41 -0800 (PST)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=mime-version:references:in-reply-to:from:date:message-id:subject:to
|
||
:cc:content-transfer-encoding;
|
||
bh=WVJwDaPOhVhlyrEU+IRdCCE5Bs5cs9UYUZN+DWlC13U=;
|
||
b=Z/YdhgFssOWay1GX6DwjpELzE/O5CmnFXAOJZ+pn2YLEu07Qs9sIEatIYuFpIWdSGz
|
||
3ys7HemMNLgN40g+u90oqSWvUIBDpaxaeuzkXAyzJz/u5dnF2H+EFJdKa4b2RoldgMR2
|
||
vX/4tDQIRRuhEfjp4xdZ4sIEhjdpvpXGkI5UFaxymHpynCWdKJCF5yY5e7YcJU54tUkQ
|
||
B+n9XOftt91ax28/+6M2tsQSvr/lZQHWDc6MWOuTfpmcuHdme0or7AjCV1d4Szmi1lCK
|
||
2OxbGJm9YGHDbbEwYJnk0x+tpppdnKJ3fRryThv+wh2eIsqV3pjANZRW7lN6dl2GnY5+
|
||
xcSw==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:mime-version:references:in-reply-to:from:date
|
||
:message-id:subject:to:cc:content-transfer-encoding;
|
||
bh=WVJwDaPOhVhlyrEU+IRdCCE5Bs5cs9UYUZN+DWlC13U=;
|
||
b=nHdFi9MD25Cmnt+QIo5ORWYAUAwJkPxPhA7B5pAWgHocWB4t7WqwMhBBwOW2Ak2NJn
|
||
mcGhdWj/ZTE2/v0CEOo25uOng9gFD/dAxcRSnxNmgSYGGlJOUCTebMA+e8ke9UzpY6Mu
|
||
Jebqf1DK8Z7Z5kbQInEtTVN2d3GPFrWbv09WRDBKwZgITEpm5cJwGMRiicQ7cT3X3w5n
|
||
1yjZCN0MMkld5x67RL8MhTt67uFMOsg2Fjuyeb+GSfMuSifmEFebd3sssa4bWP9KNDWQ
|
||
PcuyVLGDarSS3tAKPnpLBbCDX8mcwvZE5jxigcq+aDyv7AeneNSs2qlUYP7G2ZVVIVHf
|
||
v6dQ==
|
||
X-Gm-Message-State: AOAM531xruJG1qetqb3s6+BOTwLPHXsX/dT/uuM4/WasEwcAw9Os6Sxu
|
||
j4REnms9oZpJjZToGhu1eb29LLGb/DMsOjF10q8=
|
||
X-Google-Smtp-Source: ABdhPJxRSSzGKj43T3pehcBp+IYkqmzlgASVkMQHNoO58R9ZKtMCcLdOodTRXRfoEgA0ot8Jo67L0SZFfh1RBrbXXCU=
|
||
X-Received: by 2002:a5d:64c6:: with SMTP id f6mr50835474wri.711.1641509019852;
|
||
Thu, 06 Jan 2022 14:43:39 -0800 (PST)
|
||
MIME-Version: 1.0
|
||
References: <CAOGO9CoqMcAp=_9KVB3g9o5Jp45OtcAP7TT_Cn_Gom-YfQ9pew@mail.gmail.com>
|
||
<20220104190142.gwu27ru3iprhkyr2@mtpad.i.jakstys.lt>
|
||
In-Reply-To: <20220104190142.gwu27ru3iprhkyr2@mtpad.i.jakstys.lt>
|
||
From: Joe Schafer <joesmoe10@gmail.com>
|
||
Date: Thu, 6 Jan 2022 14:43:28 -0800
|
||
Message-ID: <CAOGO9Cr=foMi5dX8m_ygVxeX_YVMRU1D=Ex7mTxL9ew_VBpYQA@mail.gmail.com>
|
||
Subject: Re: uname -m on M1 MacBook returns arm64
|
||
To: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
Cc: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Content-Type: text/plain; charset="UTF-8"
|
||
Content-Transfer-Encoding: quoted-printable
|
||
|
||
> If you can dig in for more information why `uname -m` returns arm64 vs
|
||
aarch64 (OSX minor version? something else?)
|
||
|
||
I think I figured it out. It depends on whether the Bazel binary is an amd6=
|
||
4
|
||
or arm64 binary. I installed the amd64 version Bazel first on my team befor=
|
||
e
|
||
arm64 was available. macOS runs the amd64 binary and propagates the
|
||
architecture down the call chain, including the subshell to uname. I can
|
||
confirm by running uname under x86_64 emulation with:
|
||
|
||
arch -x86_64 uname -m
|
||
x86_64
|
||
|
||
So I think this package will not work for an M1 mac running an arm64 versio=
|
||
n
|
||
of Bazel. I think an internal translation from arm64 to aarch64 is likely t=
|
||
he
|
||
easiest approach.
|
||
|
||
> Is downloading the toolchain the only problem? Once you add that
|
||
workaround, does it keep working as one would expect?
|
||
|
||
Yep, as long as both the host_platform_sha256 and
|
||
host_platform_include_root dictionaries account for arm64.
|
||
|
||
On Tue, Jan 4, 2022 at 11:01 AM Motiejus Jak=C5=A1tys <motiejus@jakstys.lt>=
|
||
wrote:
|
||
>
|
||
> On Tue, Jan 04, 2022 at 09:16:33AM -0800, Joe Schafer wrote:
|
||
> > Hello,
|
||
> >
|
||
> > I'm a big fan of this project. It's *lot* easier than trying to figure
|
||
> > out other Bazel CC toolchains.
|
||
> >
|
||
> > One of my teammates ran into a curious error on an M1 Macbook using
|
||
> > the latest bazel-zig-cc.
|
||
> >
|
||
> > cc/toolchain/defs.bzl", line 219, column 70, in _zig_repository_imp=
|
||
l
|
||
> > zig_include_root =3D
|
||
> > repository_ctx.attr.host_platform_include_root[host_platform]
|
||
> > Error: key "macos-arm64" not found in dictionary
|
||
> >
|
||
> > I traced this to toolchain/defs.bzl [1] which uses `uname -m` to get
|
||
> > the architecture. It looks like bazel-zig-cc only supports aarch64 but
|
||
> > M1 Macs return arm64.
|
||
> >
|
||
> > What's really spooky is that bazel-zig-cc worked on my M1 mac but it
|
||
> > didn't work for two other devs on my team also on M1 macs; they got
|
||
> > the above error.
|
||
>
|
||
> Hi, Joe,
|
||
>
|
||
> that's interesting indeed. I don't have an M1 mac, nor know anyone
|
||
> with M1 mac, to test this "more closely".
|
||
>
|
||
> > I was able to work around the problem with the following steps:
|
||
> > https://gist.github.com/jschaf/c9be10d806020087680310e49f6e2072.
|
||
> >
|
||
> > - Uploaded all zig SDKs to my own hosting. I had to use my own hosting
|
||
> > to create macos-arm64 which is really just a copy of maco-aarch64 but
|
||
> > I had to change the folder name to match the archive name.
|
||
> >
|
||
> > - Added "macos-arm64" to host_platform_include_root, similar to "macos-=
|
||
aarch64".
|
||
> >
|
||
> > I'm by no means a Bazel toolchain expert, but I would have thought
|
||
> > there's a better way to get the host platform architecture than by
|
||
> > shelling out to uname. Appears that there's not [2] but that answer is
|
||
> > from 2017. Maybe platforms provide a way out [3]?
|
||
>
|
||
> Re [3]: looks like `declare_toolchains` is an external function, and it
|
||
> accepts `host` as a parameter, which should be set by the caller? If so,
|
||
> I am not following how that would help.
|
||
>
|
||
> If you can dig in for more information why `uname -m` returns arm64 vs
|
||
> aarch64 (OSX minor version? something else?). If there is no other way
|
||
> out, I would be OK to for an internal workaround to map darwin/arm64 to
|
||
> darwin/aarch64 during download, provided it's the only problem
|
||
>
|
||
> Is downloading the toolchain the only problem? Once you add that
|
||
> workaround, does it keep working as one would expect?
|
||
>
|
||
> Motiejus
|
||
>
|
||
> > [1]: https://git.sr.ht/~motiejus/bazel-zig-cc/tree/main/item/toolchain/=
|
||
defs.bzl#L210
|
||
> > [2]: https://stackoverflow.com/a/45029999/30900
|
||
> > [3]: https://github.com/bazelbuild/rules_go/blob/master/go/private/go_t=
|
||
oolchain.bzl#L95
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-ed1-f48.google.com (mail-ed1-f48.google.com [209.85.208.48])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id 5DC9611EF4B
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Fri, 7 Jan 2022 19:10:47 +0000 (UTC)
|
||
Received: by mail-ed1-f48.google.com with SMTP id a18so24731800edj.7
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Fri, 07 Jan 2022 11:10:47 -0800 (PST)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=sender:date:from:to:cc:subject:message-id:references:mime-version
|
||
:content-disposition:in-reply-to;
|
||
bh=mta6/kgE1u4vhkm5wKRTH7vrhBWpwE4m037Yrcq+h8k=;
|
||
b=cwU6fvE8zumy7+kfivo84iJf9gJnFO3+SS8nGqTNtHk63A/mVHWUMjG/8Myof0S1iB
|
||
Evq8JKMfHWTlFNHAXQAqisYTJgQcDF/FhutaE0KYfGaoS0jZrASHQVLBzmSqAEL7CMsA
|
||
n7arDFnhywBPsYlQYcZJdS6DQQMwk5lOU7NDl3/vMmhCLzztb5pnDMVIHDYIeNuM6JiH
|
||
AnGlVvROwU2JHYu/oTZMngfhRr3qe7rAh5UVQDQAPStYvPYUPg3DVJfzlqUjlEq9dNTb
|
||
KoOiftL/jkiqgO6Ef9tfl86STF1jl7ovMTrUdfaM92oh2Lrg4mPrd6j9y9I1llGAEBOr
|
||
+oIQ==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:sender:date:from:to:cc:subject:message-id
|
||
:references:mime-version:content-disposition:in-reply-to;
|
||
bh=mta6/kgE1u4vhkm5wKRTH7vrhBWpwE4m037Yrcq+h8k=;
|
||
b=ahwosd6ENKxO3uOYiH1wRIn1v2+tXREtNQzPlkjcsS+a6BJXRgQr8fm+O2nvBbd9ji
|
||
a8g1wRrjgeY1W1wuVs+bUKrTxE0u22v5wUxrsJpxT0axtg6v13Q5jXaUyg7tisCWdu0k
|
||
B5zvX0LAzL3xkcll3CJ0lpr8B/KR+XZXGFXf5pjN4DYcnf+Wonk71z8h+WfJi6+g1cRP
|
||
xfKATpGqBEbvjNHwfN8PFw+kX1PYqHUmWcTcrr2J2iUlg+Qwb/rrdrUD2Tv3z9QRwa3h
|
||
w/O8Nxk1xTTf6ClJZ5S94Eb1D2Q2WQAkKNvyjg0/8sv/vWXELsfRed5FFju/KJGy6UHQ
|
||
CpNw==
|
||
X-Gm-Message-State: AOAM532KdgUfIklM7pNasbPCLx4Uxn6SCjPEQaXH0Xg9ng5RfMU3QrtV
|
||
1qD54g4GQcqyGWGiGcrrFc8=
|
||
X-Google-Smtp-Source: ABdhPJzfI4GCxLf8Gg1gskwaSfK0xpn5sH/6JMdgodDJX7fdSEAxLasmU6+TAV5+tlW9A8nUGdygPQ==
|
||
X-Received: by 2002:a17:907:9808:: with SMTP id ji8mr51547186ejc.665.1641582646132;
|
||
Fri, 07 Jan 2022 11:10:46 -0800 (PST)
|
||
Received: from localhost (c54-242.i04-14.onvol.net. [84.255.54.242])
|
||
by smtp.gmail.com with ESMTPSA id j9sm23919ejg.64.2022.01.07.11.10.44
|
||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||
Fri, 07 Jan 2022 11:10:45 -0800 (PST)
|
||
Sender: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <desired.mta@gmail.com>
|
||
Date: Fri, 7 Jan 2022 20:10:43 +0100
|
||
From: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
To: Joe Schafer <joesmoe10@gmail.com>
|
||
Cc: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Subject: Re: uname -m on M1 MacBook returns arm64
|
||
Message-ID: <20220107191043.5tl2jcliuh4ehp74@mtpad.i.jakstys.lt>
|
||
References: <CAOGO9CoqMcAp=_9KVB3g9o5Jp45OtcAP7TT_Cn_Gom-YfQ9pew@mail.gmail.com>
|
||
<20220104190142.gwu27ru3iprhkyr2@mtpad.i.jakstys.lt>
|
||
<CAOGO9Cr=foMi5dX8m_ygVxeX_YVMRU1D=Ex7mTxL9ew_VBpYQA@mail.gmail.com>
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=utf-8
|
||
Content-Disposition: inline
|
||
In-Reply-To: <CAOGO9Cr=foMi5dX8m_ygVxeX_YVMRU1D=Ex7mTxL9ew_VBpYQA@mail.gmail.com>
|
||
|
||
On Thu, Jan 06, 2022 at 02:43:28PM -0800, Joe Schafer wrote:
|
||
> > If you can dig in for more information why `uname -m` returns arm64 vs
|
||
> aarch64 (OSX minor version? something else?)
|
||
>
|
||
> I think I figured it out. It depends on whether the Bazel binary is an amd64
|
||
> or arm64 binary. I installed the amd64 version Bazel first on my team before
|
||
> arm64 was available. macOS runs the amd64 binary and propagates the
|
||
> architecture down the call chain, including the subshell to uname. I can
|
||
> confirm by running uname under x86_64 emulation with:
|
||
>
|
||
> arch -x86_64 uname -m
|
||
> x86_64
|
||
>
|
||
> So I think this package will not work for an M1 mac running an arm64 version
|
||
> of Bazel. I think an internal translation from arm64 to aarch64 is likely the
|
||
> easiest approach.
|
||
>
|
||
> > Is downloading the toolchain the only problem? Once you add that
|
||
> workaround, does it keep working as one would expect?
|
||
>
|
||
> Yep, as long as both the host_platform_sha256 and
|
||
> host_platform_include_root dictionaries account for arm64.
|
||
|
||
Hi Joe, thanks for clarifying!
|
||
|
||
In that case, I will accept a patch that rewrites the architecture for
|
||
OSX from arm64 to aarch64. Please don't extend the dict though, as it
|
||
will be duplicate information and thus harder to maintain. Something
|
||
along the lines:
|
||
|
||
arch = `uname -m`
|
||
# two sentence explanation (an extract from your email would suffice)
|
||
if macos and arch == "arm64"
|
||
arch = "aarch64"
|
||
|
||
... keep going with the `arch` variable.
|
||
|
||
See https://sr.ht/~motiejus/bazel-zig-cc/#questions-amp-contributions
|
||
for how to send the patch. Thanks for your report!
|
||
|
||
Motiejus
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id 9857111EF33
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Mon, 17 Jan 2022 15:11:32 +0000 (UTC)
|
||
Received: by mail-lf1-f54.google.com with SMTP id x7so58771527lfu.8
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Mon, 17 Jan 2022 07:11:32 -0800 (PST)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=sender:date:from:to:subject:message-id:mime-version
|
||
:content-disposition;
|
||
bh=LwNHKhyXvDWWILJKIlSXcX0ihphVZMlQHLLR1EMYlXU=;
|
||
b=qEWnJSQXmLoa7O7rrgOAvcO9WFQ2BvtWmA+ZCjxhXSlZOq66HeIAJPBP43FcfahZHj
|
||
pbqsSQjVKTIChLryf2wGpOZWTULsaez6ZMzKsE08t3uLr8g/MkeeiQbPT5Wfged8BBjg
|
||
1B/WJHerfObEcrxVft3aNArknPktFeXZiDJeySh3y3v2DJsp7yVJndpVfIq3YN0LLXXr
|
||
wzSQMLABLurB4GnuTkk3E0BiInNFMCkAjLvwNfLEBLYBSgXcJ+1dpu9H16OQJGUsTb9G
|
||
JJ6qOqclLXbTu7Wi//nFlxJEFXE7ZqI9H98nki+o1RA3nsyZtzwHXoCGXqTalXMHfId6
|
||
Kdgg==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:sender:date:from:to:subject:message-id
|
||
:mime-version:content-disposition;
|
||
bh=LwNHKhyXvDWWILJKIlSXcX0ihphVZMlQHLLR1EMYlXU=;
|
||
b=2YSu1BSyV/wzreFDcWI0y0RlG627clg0N4Ow0DVUajWxO+8kP2Jgmqnl4R2Bc4n0nS
|
||
gMRpQ/9mdpUv07Tea7VjmKvdg9OlflrmCP/W1MLKW/Dw56ynt7GEFR8X8EIwsL/lX/RU
|
||
71DyAp3Hbs10zM7Qti4C36uy9czFVC2DFKAtAO62y/UsFvntnRtKXmGq4f66VNTjhsVZ
|
||
rAixSKwc3Chp+YM5qIBPtdFry4rYu+/f0JR+mMhmHnrRA2fzPOU3WwLVBGvnCllHW9Xq
|
||
yGdH8Ij7MuD26ZpIfypZCd34GHGPW/gzUgITt6Pt2Dxfd6+Dx8TxIPFSNscpKRFgaCZj
|
||
0Skw==
|
||
X-Gm-Message-State: AOAM5332i04xrhpV3v4y8o7ezH1et4Cse/k14KT/IknPaUoLFoApOX7c
|
||
tQwofHgBoNfuU9P0tbNgVSzxvjB4CwM=
|
||
X-Google-Smtp-Source: ABdhPJzlsEGEQrpYJ8pZKope/CpBPy7mLUnLz2qSCClcr1R1PxGlIMy/Z9NGRoAtS9/FVRoNJHLa6Q==
|
||
X-Received: by 2002:a05:6512:a94:: with SMTP id m20mr14846375lfu.546.1642432291016;
|
||
Mon, 17 Jan 2022 07:11:31 -0800 (PST)
|
||
Received: from localhost ([88.223.105.24])
|
||
by smtp.gmail.com with ESMTPSA id u14sm532440lfc.292.2022.01.17.07.11.30
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>
|
||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||
Mon, 17 Jan 2022 07:11:30 -0800 (PST)
|
||
Sender: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <desired.mta@gmail.com>
|
||
Date: Mon, 17 Jan 2022 17:11:29 +0200
|
||
From: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Subject: bazel-zig-cc v0.4.0
|
||
Message-ID: <20220117151129.kdvzdw3w2dnuaxrj@mtpad.i.jakstys.lt>
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=utf-8
|
||
Content-Disposition: inline
|
||
|
||
Hi all,
|
||
|
||
I just released bazel-zig-cc v0.4.0. It is the first release after zig
|
||
0.9.0 came out. I didn't cut a release with 0.9.0 due to[1]. Many thanks
|
||
Xavier for addressing that one!
|
||
|
||
This version has no known upstream issues, and, as usual, a few ones[2]
|
||
I will be accepting patches to, or will get to myself at some point.
|
||
|
||
Happy hacking,
|
||
Motiejus
|
||
|
||
[1]: https://github.com/ziglang/zig/issues/10386
|
||
[2]: https://git.sr.ht/~motiejus/bazel-zig-cc#known-issues-in-bazel-zig-cc
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-lj1-f177.google.com (mail-lj1-f177.google.com [209.85.208.177])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id ABA1911EEB5
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Wed, 26 Jan 2022 05:44:02 +0000 (UTC)
|
||
Received: by mail-lj1-f177.google.com with SMTP id c15so14139217ljf.11
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Tue, 25 Jan 2022 21:44:02 -0800 (PST)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=sender:date:from:to:subject:message-id:mime-version
|
||
:content-disposition;
|
||
bh=ZPIE+T8JZChmC3IzGFrcmvVvO2ND70BBO5FF9GExK5Q=;
|
||
b=HTwHTDZX/I7CSkd0ZpQuKHqBc5aAjlYedJVaOjGL6wCgeX4F5Zwsq8HQtStMYNq1mG
|
||
OFHCaVkzvGAOyLNfArV0sXlrwHAUT1846q/jGURV1HJA7EGz4iMz0jMu/416FIiD55Td
|
||
SWlVLhn2gb2/FRBGE00k2uAYfFSaW2iQ/XkJW7cQ+0oIVvcGfoaxA1Vk45kneGri0Vkg
|
||
XZIa9J6D54SMxSIl2wsuWybMnWEgbL2jWUmvcZGpSrP1+kINzaYiPxXD8lyt5Doir4oy
|
||
ppc3QF+6AMLOIy4pPRKdsdw7xb8iC6pZBiFyolxV5ebccWcr7Vj5NhtC8853QXF/Q7n7
|
||
1FTw==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:sender:date:from:to:subject:message-id
|
||
:mime-version:content-disposition;
|
||
bh=ZPIE+T8JZChmC3IzGFrcmvVvO2ND70BBO5FF9GExK5Q=;
|
||
b=ebv8j2lQilm9IeIqajKQamk9SlFu0Erv0015fMchG4uPf+v3FIGDWbWwK52Mbprpjv
|
||
6Qcdj9y8uiD4qyG/HkZAjczQV7O+vwn+Q+nQB9jrSd/2D/1b02bOIXhVahFqCvZLYV8o
|
||
9PBrFVxpQ/UKjO+Jxmd8rxxpihhOxqdC6f8eT3MdjHRVt16oZUWxosvU/eWXBbDyvnLr
|
||
cML31Xm+HK5ZiPAi7raNpKYEpb0t/bAY+wm+R2mipl0CM9sW+I3yzXZGpVMsytqbaLOs
|
||
32znAYlz06L9ryeqo3tONEP6dxGoeRtAnADHhr1XK7b9ArsOIRxjTAXLpaPXpnjLt54J
|
||
r1bA==
|
||
X-Gm-Message-State: AOAM530GrI6qZZJctG4jJt/0OZ7XNlMN4GT4RfjHMZcRSB8ljHV31/Ns
|
||
WgSHFIZyjzgIUPwISqIAzBPSzJtpC+w=
|
||
X-Google-Smtp-Source: ABdhPJxus+2x3ziq6MGKHqA4hJMsMQAFXfVHMhG8j4pNQ2iT970HgmsFoP+8MjiP6ZeAHPsO0POZyA==
|
||
X-Received: by 2002:a2e:6e0e:: with SMTP id j14mr4657369ljc.510.1643175838877;
|
||
Tue, 25 Jan 2022 21:43:58 -0800 (PST)
|
||
Received: from localhost ([88.223.105.24])
|
||
by smtp.gmail.com with ESMTPSA id q12sm1419957ljh.16.2022.01.25.21.43.57
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>
|
||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||
Tue, 25 Jan 2022 21:43:58 -0800 (PST)
|
||
Sender: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <desired.mta@gmail.com>
|
||
Date: Wed, 26 Jan 2022 07:43:57 +0200
|
||
From: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Subject: bazel-zig-cc v0.4.1 and envoy PoC
|
||
Message-ID: <20220126054357.h5jxh7jtg75k3g57@mtpad.i.jakstys.lt>
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=utf-8
|
||
Content-Disposition: inline
|
||
|
||
Hi all,
|
||
|
||
I cut bazel-zig-cc v0.4.1, which upgrades zig to
|
||
0.10.0-dev.399+366c76744. Notably, it implements the following linker
|
||
args:
|
||
|
||
* --whole-archive, -whole-archive
|
||
* --no-whole-archive, -no-whole-archive
|
||
* -s, --strip-all
|
||
* -S, --strip-debug
|
||
|
||
... which were surfaced by Envoy trying out bazel-zig-cc[1].
|
||
|
||
I also renewed my gpg key (just updated the expiry date, keys are
|
||
unchanged), which you can find in today [2]. For some inexplicable
|
||
reason I keep signing my releases.
|
||
|
||
Regards,
|
||
Motiejus
|
||
|
||
[1]: https://github.com/envoyproxy/envoy/issues/19535
|
||
[2]: https://jakstys.lt/mtpad/gpg.txt
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-pj1-f44.google.com (mail-pj1-f44.google.com [209.85.216.44])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id 3C7CC11EFBD
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Thu, 27 Jan 2022 09:15:33 +0000 (UTC)
|
||
Received: by mail-pj1-f44.google.com with SMTP id b1-20020a17090a990100b001b14bd47532so2351913pjp.0
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Thu, 27 Jan 2022 01:15:33 -0800 (PST)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=sender:date:from:to:subject:message-id:mime-version
|
||
:content-disposition;
|
||
bh=l2IL1hDG/wSYO+PblgmPSfkqj7PPv5mJfn293Xgw73s=;
|
||
b=GgAXrKlG1tG2EbkFA/s7+RvEyH0tbRU06xQHi4/grJr5t34fiCntHOtuOGEM9/Ry8V
|
||
FZio35kw0jk5pr4bujR5di/jGk4UBBg+z/pGti9Pj69dk2Ea24alcNokiuzkbfHJ0PYC
|
||
9TYcgC/A08g3CyWJJ0A7HwKagKXKjnC7k7XaWkywSn/FDoCwfhHZzsSnu0B3ZxNFEC+R
|
||
hjqnERKrAU/urSTBamqChs9Q4zdn1cWPl7qnHMW/7o6z048YVGJP48azpBwhPFxQqWui
|
||
TOri7Fxg3/6BrNsa0MMOr4tcgzlHVPtlbArKBj3f4ftd3tQVN0qga1ZLK+MxQAm3LSrX
|
||
76EA==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:sender:date:from:to:subject:message-id
|
||
:mime-version:content-disposition;
|
||
bh=l2IL1hDG/wSYO+PblgmPSfkqj7PPv5mJfn293Xgw73s=;
|
||
b=7XviGnEKKaxoby6FvKmwDoejO/LGWTy4Z4FR4GZbuAAXW6tihvwnDbUy2YfYjDgGzE
|
||
3WE5kBPnibuTJklRKvnwoEmqHvTfIWb45rmoxK7niJ6+VNbsxwAvai7Y/jyNTq96cKCo
|
||
d/Gfc8RQeqG8O/p4jT8pYSnk7UGfRwvBirSfxWkcgGn06hEZGZOrsAk6FY2yRQpRCdav
|
||
0lOs91QBS/k2hG5SBt4kERGN5xPhshWbCB8jSPT+xpQxV4yWR3l8Q4IOuGrMZRk5xi68
|
||
QAtjXozIKl6SikjDF0V5/QOyqfNhxTAIUbP/TrA7cnZM+n3qGzGWASewO+Pv8kY0sxov
|
||
emmQ==
|
||
X-Gm-Message-State: AOAM531u9gQGl0U6kPxkXMkmxs6zxWCAblpRS977LnnylyyVQwSByswN
|
||
6OncviD3c0m1pTAzONn7y/whSWkygZ8=
|
||
X-Google-Smtp-Source: ABdhPJwylL0/y/L7pD9UsX5ejQIsUCE84DECwz3l+joFVSHQGXR3t35Btz/+0h4nVB/tBBoPWDiNqw==
|
||
X-Received: by 2002:a17:902:c403:: with SMTP id k3mr1966059plk.117.1643274930940;
|
||
Thu, 27 Jan 2022 01:15:30 -0800 (PST)
|
||
Received: from localhost (88-119-96-125.static.zebra.lt. [88.119.96.125])
|
||
by smtp.gmail.com with ESMTPSA id ip4sm2056750pjb.8.2022.01.27.01.15.29
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>
|
||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||
Thu, 27 Jan 2022 01:15:30 -0800 (PST)
|
||
Sender: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <desired.mta@gmail.com>
|
||
Date: Thu, 27 Jan 2022 11:15:27 +0200
|
||
From: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Subject: bazel-zig-cc v0.4.2
|
||
Message-ID: <20220127091527.oe53s3gm75354rdm@mtpad.i.jakstys.lt>
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=utf-8
|
||
Content-Disposition: inline
|
||
|
||
Hi all,
|
||
|
||
I cut bazel-zig-cc v0.4.2, which upgrades zig to
|
||
0.10.0-dev.430+35423b005. Notable changes:
|
||
- fix linux kernel's aarch64 include paths, use stable kernel for
|
||
headers[1].
|
||
- implement --hash-style linker parameter[2].
|
||
|
||
I am working on aarch64 at my dayjob, which resulted in (1). The latter
|
||
was surfaced in envoy's ongoing investigation into zig-cc and
|
||
bazel-zig-cc[3].
|
||
|
||
Motiejus
|
||
|
||
[1]: https://github.com/ziglang/zig/pull/10699
|
||
[2]: https://github.com/ziglang/zig/commit/40c9ce2caf8f
|
||
[3]: https://github.com/envoyproxy/envoy/issues/19535
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com [209.85.167.41])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id 7F1CF11EEDD
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Wed, 2 Feb 2022 13:32:17 +0000 (UTC)
|
||
Received: by mail-lf1-f41.google.com with SMTP id u14so40638261lfo.11
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Wed, 02 Feb 2022 05:32:17 -0800 (PST)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=sender:date:from:to:subject:message-id:mime-version
|
||
:content-disposition;
|
||
bh=CaNfsprl7AZ0nZjlw9C6IbI2Leuo8/M+n+R0iuzS+cY=;
|
||
b=L+7CoNGpEND6STivveZtxm5V2vE3pCeLaBKHvJvsFUh/x8n3BIVoiA/AG5o27MG0xF
|
||
4X1ikzp9eYLAFRK3ISIaZ5aYwbBwhU+noXuWqK/JRPmbLsj1rbPMefVWSfBRKud/aVhW
|
||
sKBrU0KwOstAnh9kajQEBR1oUhn9GN7rUok1WEl9zximfVVL+3dMbOP9Ry0oNauYRQQw
|
||
wJjL3/zlMlqaRSzhOMDMQNdXK0XXj5BdhIq6LYHG1lqTYc8Sm6ulBVY/Mc91nk2f7VMT
|
||
4REW+8p5rXDtATKuezmsM3ooxBxa6PR69aMn635w8M6YQQOyV0f/aNdW5Nc9xExoEOdM
|
||
nQNQ==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:sender:date:from:to:subject:message-id
|
||
:mime-version:content-disposition;
|
||
bh=CaNfsprl7AZ0nZjlw9C6IbI2Leuo8/M+n+R0iuzS+cY=;
|
||
b=c3+2Uvi12fzwT/Rdf21yrUu9zQry0vHZp1+IUOk3uFtE3SrceACYFbKqLuORdpfAno
|
||
3Noa/4kRkCLchOI0B8+mzMwzk2uTpxBqT+X2DPcz0c0t34p/yd0EkVjDZUr/iKHeVzh9
|
||
UULn/HOYm1dYyJhauFiMBmIuzuVkUx3Wt29XMBufKuoJgKWA0271BbYqC42XCf5yCk5a
|
||
OeLvnTPdRh6yGurvPcB30bpmQtUX8PWBDCACiq4qBU7Lf8mbbTbHmONyjRWw2g6+C1Gr
|
||
yekWw8zjayekGtAEwyFn1Ve0WN4hQYXkR2yF7+HhcSu2UmTIKbSXhUyKjTuLxbgsdjeG
|
||
owUg==
|
||
X-Gm-Message-State: AOAM530ewLoLRvtGBos0lqYEAwwXrUfGvqfLBiIlO/6HSSC26FgXyiRn
|
||
XeVc1bRmFHku4DlppyKu9rZIQ6i+qFQ=
|
||
X-Google-Smtp-Source: ABdhPJwEoIgMEhpBLz+ai9v9eSwdLa6kW5PAcKQK+5jQByExX2Rh1+OBULJPudgaVVKKSEwwEeb7Yg==
|
||
X-Received: by 2002:a05:6512:ac6:: with SMTP id n6mr22945258lfu.322.1643808734872;
|
||
Wed, 02 Feb 2022 05:32:14 -0800 (PST)
|
||
Received: from localhost ([88.223.105.24])
|
||
by smtp.gmail.com with ESMTPSA id u12sm3672275lfm.308.2022.02.02.05.32.14
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>
|
||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||
Wed, 02 Feb 2022 05:32:14 -0800 (PST)
|
||
Sender: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <desired.mta@gmail.com>
|
||
Date: Wed, 2 Feb 2022 15:32:13 +0200
|
||
From: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Subject: bazel-zig-cc v0.4.3
|
||
Message-ID: <20220202133213.g6c66zwont7qyrr4@mtpad.i.jakstys.lt>
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=utf-8
|
||
Content-Disposition: inline
|
||
|
||
Hi all,
|
||
|
||
I released v0.4.3. It only zig, which fixes[1] `--hash-style` and
|
||
`--whole-archive`. The README was also updated following some users'
|
||
questions[2]. "The starlark" remains the same.
|
||
|
||
At some point I will not be releasing new versions of bazel-zig-cc when
|
||
*only* zig is updated; at that point, you will need to download zig
|
||
provide it to bazel-zig-cc. Something akin to [3].
|
||
|
||
Motiejus
|
||
|
||
[1]:
|
||
https://github.com/envoyproxy/envoy/issues/19535#issuecomment-1024533163
|
||
[2]:
|
||
https://github.com/envoyproxy/envoy/issues/19535#issuecomment-1026111822
|
||
[3]: https://github.com/grailbio/bazel-toolchain#quickstart
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com [209.85.208.182])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id 6C8BC11EFDA
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Fri, 4 Feb 2022 11:56:02 +0000 (UTC)
|
||
Received: by mail-lj1-f182.google.com with SMTP id c7so8094148ljr.13
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Fri, 04 Feb 2022 03:56:02 -0800 (PST)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=sender:date:from:to:subject:message-id:mime-version
|
||
:content-disposition;
|
||
bh=FKPxTpAiSiY0k9tKJOGQ14KTAR6pM4E7CD61F5+ZIZg=;
|
||
b=Q71lKWPQHHD7J7ZIiQyw9CPA/wvS6GzZN3HjrOD58SK/g6CFpfHwBFeDGLyI7QlD2x
|
||
LaHTPfJ8QGMtubI9dhFzTxBLJGUPqk7JTKDWHWe8Hwu5UY2ngDc6GnoDmf2t+98vhwiT
|
||
iZQdCzUYq3k5Od7kSi7J3MEIuuIvUNa2nDvRKCgbeCGZGenFzJ06aH64Ht6GfX2PbAaK
|
||
xTPWCY8/G83aRCiCC/diLatM4RCUTDkI254mcJ55/xJJ/DvmM2cmrxvRRBldly/jZmeF
|
||
gh2ZVz84Hik8v29pmbHh7fV4XHXLpMyCARe249KGIFmdDb5WFF8rKtubb7X0Jl/Uv5ML
|
||
Bnng==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:sender:date:from:to:subject:message-id
|
||
:mime-version:content-disposition;
|
||
bh=FKPxTpAiSiY0k9tKJOGQ14KTAR6pM4E7CD61F5+ZIZg=;
|
||
b=q3seF01i5nl0FcHfaPDeGtBzJUeuUhZdYawh3fvAOimJmUKLkjTZZZmiyHfkn9hbvr
|
||
UXcHcXizu0+QLPwb+z2gIOeO5zQdjOSV6+2SnNvrNWwFxpN2t5teCqsUJtTr2G9n5pXl
|
||
YdNRtCZUSQjOvOsGhH0Ncv4H8wHBnchGzT8HT+K39tsSrjsPwVVFNmzQdcLYGc9O48ae
|
||
3yLJ1FB41qiFX8M/PRc32aeIDxRYhTCoD4i5AoGJ6CkvtZtQtcbg7n+d9SRy9d0FyGXL
|
||
f4hdYavfhxiCLljcS0VmJskiJ58aFbPkRvKcJP9N2tafMSaS85x7MbSPVWFjn1N11hW6
|
||
elsw==
|
||
X-Gm-Message-State: AOAM533rCo1xV4yuik3hvvB17GySt46j8+KS4cEhKTHoJeQ3kgaV7vjH
|
||
9FzcGJK4wJetxV5cFR4BPKwpb9Azuzo=
|
||
X-Google-Smtp-Source: ABdhPJz+wWN6uIoFx23yDrPATpG+aJ1LdP/b1iN2zD70pcef7VbGScFaG0UPhS8LtIkUtd4JBKfoGw==
|
||
X-Received: by 2002:a2e:b8c7:: with SMTP id s7mr1606227ljp.118.1643975759407;
|
||
Fri, 04 Feb 2022 03:55:59 -0800 (PST)
|
||
Received: from localhost ([88.223.105.24])
|
||
by smtp.gmail.com with ESMTPSA id bu32sm280744lfb.287.2022.02.04.03.55.58
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>
|
||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||
Fri, 04 Feb 2022 03:55:58 -0800 (PST)
|
||
Sender: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <desired.mta@gmail.com>
|
||
Date: Fri, 4 Feb 2022 13:55:57 +0200
|
||
From: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Subject: bazel test under qemu-aarch64: help needed
|
||
Message-ID: <20220204115557.dhs7gvnyk3bapyja@mtpad.i.jakstys.lt>
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=utf-8
|
||
Content-Disposition: inline
|
||
|
||
Hi folks,
|
||
|
||
I spent a good day trying to figure this out, I need help enabling tests
|
||
for aarch64.
|
||
|
||
Goal: run `bazel test //test/...` for 2 architectures: amd64 and arm64.
|
||
Arm64 would be executed under qemu-aarch64.
|
||
|
||
This works on my laptop (amd64/buster):
|
||
|
||
git clone https://git.sr.ht/~motiejus/bazel-zig-cc -b qemu
|
||
cd bazel-zig-cc; direnv allow .
|
||
bazel test --run_under=qemu-aarch64 \
|
||
--platforms @zig_sdk//:linux_arm64_platform \
|
||
--extra_toolchains @zig_sdk//:linux_arm64_musl_toolchain \
|
||
//test/go:go_test
|
||
|
||
Fails[1] on builds.sr.ht, which is also buster/amd64.
|
||
|
||
2022/02/04 09:21:03 fork/exec /home/<...>/go_test: exec format error
|
||
|
||
However, when executed directly via qemu-aarch64 on the given CI
|
||
machine, it works:
|
||
|
||
build@build:~/bazel-zig-cc$ qemu-aarch64 /<...>/go_test
|
||
PASS
|
||
build@build:~/bazel-zig-cc$
|
||
|
||
strace, investigating the bazel's sandboxing (I suspected this may be
|
||
caused by linux-sandbox-pid1.cc) didn't reveal anything. Any pointers?
|
||
|
||
Thanks,
|
||
Motiejus
|
||
|
||
[1]: https://builds.sr.ht/~motiejus/job/687819
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-lf1-f54.google.com (mail-lf1-f54.google.com [209.85.167.54])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id DFEC611F2DA
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Sat, 5 Feb 2022 04:55:32 +0000 (UTC)
|
||
Received: by mail-lf1-f54.google.com with SMTP id u6so16394869lfm.10
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Fri, 04 Feb 2022 20:55:32 -0800 (PST)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=sender:date:from:to:subject:message-id:references:mime-version
|
||
:content-disposition:content-transfer-encoding:in-reply-to;
|
||
bh=XKOR1hOp9WbzmRujEKM5M3zyyBvcZgTOpIPrU4XXc20=;
|
||
b=KwIUKAX2O9OUNMyVWbwGDD75T/hCnF8WJgURSnnJ7LcHZiHyPh3LUzdxrovVHj70GS
|
||
ZgMP25hwmgDJlexldlQ5goH7XRn/EwV+viynlbq/8W3X4Zi8r2FpH0Waa4ds/g0uLJri
|
||
Xhchxy8fX8h6JKX8faOOwrTmsYrQ20oOAqxfrFfa0Fsfdy5f9JRviCmRdqcb4gyvHw5P
|
||
3JvIvyaGmL95RlR4mL5iQfKXB5pewagGtOKSf4zuqUgcyyKfP7HIHA7bOPXweyJsFJ6F
|
||
KsfSuztCsYO0jA5PAGv5VZqS3L8nZUdDWgNRsyxSA85zaLH98zDrn1w7uveQ9Oycp7/D
|
||
QdYQ==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:sender:date:from:to:subject:message-id
|
||
:references:mime-version:content-disposition
|
||
:content-transfer-encoding:in-reply-to;
|
||
bh=XKOR1hOp9WbzmRujEKM5M3zyyBvcZgTOpIPrU4XXc20=;
|
||
b=pDyTgKvM5oVBXYVcmDAHVYBF6u69uAleBhZXMtxTABp6jGMbdX0oFv5SD5Z+AQTyuq
|
||
Qoz2/iX0A1erkQ3JTejCG5zjYIOYqbh7MvgOtAM+sgzS9xk3ASfbTCYtf3lemN4ZjBN0
|
||
R9nt+huX7vqqIDmFhBVf6UaQ3nFHu7c5HiBSIhEGE7Ck6KTQQYAXCFM2QCo68Ez3AeHF
|
||
uFaHgYZBQSvY5Dpr1/8nHd9yzKPVdipni3gErD600QTHwRZ1KTW0evKmhBcmwuPoiOVz
|
||
cKUOZzOKZM1fLL2S84Q0kSNyoqRDv9kfAP6Xg8jdkacdnNVzYdi7R/v8nKH8pUjiXX7y
|
||
lXnQ==
|
||
X-Gm-Message-State: AOAM530784Z7OOYq/FydPztz1MiT4dtQ4Hr+v++1DfRT3rqwoYRlw/3V
|
||
RWN1qZX3Aunatwrf1e6RtRU6UnxfiRI=
|
||
X-Google-Smtp-Source: ABdhPJxJ0QD5Cq/QWw3sHoVTecWwIu9kamdfu4rahFH5eT2GWNJIdzr+y76ReriZ2P0sWLeLjCDvoQ==
|
||
X-Received: by 2002:a05:6512:4014:: with SMTP id br20mr1577156lfb.217.1644036931198;
|
||
Fri, 04 Feb 2022 20:55:31 -0800 (PST)
|
||
Received: from localhost ([88.223.105.24])
|
||
by smtp.gmail.com with ESMTPSA id z27sm577500lfg.31.2022.02.04.20.55.30
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>
|
||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||
Fri, 04 Feb 2022 20:55:30 -0800 (PST)
|
||
Sender: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <desired.mta@gmail.com>
|
||
Date: Sat, 5 Feb 2022 06:55:29 +0200
|
||
From: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Subject: Re: bazel test under qemu-aarch64: help needed
|
||
Message-ID: <20220205045529.c4quz7koyncgfqiz@mtpad.i.jakstys.lt>
|
||
References: <20220204115557.dhs7gvnyk3bapyja@mtpad.i.jakstys.lt>
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=utf-8
|
||
Content-Disposition: inline
|
||
Content-Transfer-Encoding: 8bit
|
||
In-Reply-To: <20220204115557.dhs7gvnyk3bapyja@mtpad.i.jakstys.lt>
|
||
|
||
On Fri, Feb 04, 2022 at 01:55:57PM +0200, Motiejus Jakštys wrote:
|
||
> Hi folks,
|
||
>
|
||
> I spent a good day trying to figure this out, I need help enabling tests
|
||
> for aarch64.
|
||
|
||
Hi all,
|
||
|
||
Piotr Sikora replied out-of-band[1]. Two things needed to be changed:
|
||
|
||
1. Install binfmt-support. That registers qemu handlers to binfmt.
|
||
2. use qemu-aarch64-static instead of the shared version.
|
||
|
||
... and now we run all unit tests on both amd64 and arm64, and the test
|
||
runner[2] is less ugly.
|
||
|
||
Motiejus
|
||
|
||
[1]:
|
||
https://github.com/PiotrSikora/bazel-zig-cc/commit/10101bf7f11ff404e66f582bbb64a3a875f8e45f#commitcomment-66048081
|
||
[2]: https://git.sr.ht/~motiejus/bazel-zig-cc/tree/main/item/ci/test
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-lf1-f48.google.com (mail-lf1-f48.google.com [209.85.167.48])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id 4707611F2DA
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Sat, 5 Feb 2022 05:06:31 +0000 (UTC)
|
||
Received: by mail-lf1-f48.google.com with SMTP id x23so16612445lfc.0
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Fri, 04 Feb 2022 21:06:31 -0800 (PST)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=sender:date:from:to:subject:message-id:mime-version
|
||
:content-disposition;
|
||
bh=YqUW7x3rsx9mzzxrNShByRFQQHaM25RXdnjFURhRiTc=;
|
||
b=aUMZbJhDNBCB6wVPI8VBaPiGorrlY2MGcHpyX5chxJEWcdl0gWmAFL5V55Vcor0E4i
|
||
VhdChdEOXTHAxFrvDOIABVrpnZp/XrToQa1dqphOLjelmVAbyu6XI0XNgy3uXJ94kHec
|
||
APDqE0WpflKzbmggrrU+85yjh/jmEW6XuLJ054dkkf8K6grBNlRi5KBQyfqfwAwuJLT6
|
||
FciVpP5r8QQ7hBCtdEUw36s/flZNMRAxvdoBnLUUNjAndU73JZwy5WyCZ6YepAIiFwpl
|
||
3m3oYcX1A7AOPI/OntxO9KYqR39DGEkfbURn8nmAYccrvY3Iw1X8yC3aTU1t7F7HP8U8
|
||
Hlnw==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:sender:date:from:to:subject:message-id
|
||
:mime-version:content-disposition;
|
||
bh=YqUW7x3rsx9mzzxrNShByRFQQHaM25RXdnjFURhRiTc=;
|
||
b=eobDiXZbHrULR7IVzjffjOMSIRbBOjGpoBNcmRjZOxXm1LKQ+75fa/gO3+fKG6WaZs
|
||
jIk77c+LTLCETXGTNwQ5mb/9n7dpCOv5M0qydN6cw2yUe49i+ooJ6CHg1ZFVMeHD+QA2
|
||
6+TnYvY2N1qsicSfaoPvHW249jbWHjvro5KKuMh+QBgwibXmo0LvICQCjA0U8dJ7adBZ
|
||
7QHOJiBPxc2kmN0jk8SUL5oi3+2lawi58Enas2XwGwk+gpwtUUsp6F6BZ/5JuuvuDs3G
|
||
YSSyCmt5a3CJmvZ2dCm6e8gAJF0fk1/Us4fZ1GWjp54QhQfi45xXgv+87tuqAK0jFn0X
|
||
EGAA==
|
||
X-Gm-Message-State: AOAM530HYBE3U1cQ8IVpBmUBM25gs3Cl/xw++l9knhpUQUCYWIUIpy3Z
|
||
pUMy1q0uu3uLFLCkwRdyd7Y6BsnaXg8=
|
||
X-Google-Smtp-Source: ABdhPJzfulESjC6wntPstFC25e8xaYDPKQen6k5HrvMwq6aQsB65WuJBlVzadqsNnwNGQNv6hu9BvA==
|
||
X-Received: by 2002:ac2:43ae:: with SMTP id t14mr1493698lfl.599.1644037590060;
|
||
Fri, 04 Feb 2022 21:06:30 -0800 (PST)
|
||
Received: from localhost ([88.223.105.24])
|
||
by smtp.gmail.com with ESMTPSA id be20sm524965ljb.105.2022.02.04.21.06.29
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>
|
||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||
Fri, 04 Feb 2022 21:06:29 -0800 (PST)
|
||
Sender: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <desired.mta@gmail.com>
|
||
Date: Sat, 5 Feb 2022 07:06:28 +0200
|
||
From: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Subject: bazel-zig-cc v0.4.4 and upcoming zig 0.9.1
|
||
Message-ID: <20220205050628.3m6ewpkxnvqngcqw@mtpad.i.jakstys.lt>
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=utf-8
|
||
Content-Disposition: inline
|
||
|
||
Hi all,
|
||
|
||
bazel-zig-cc v0.4.4 is out. Major changes:
|
||
|
||
- register "bazel platforms" @zig_sdk//:<os>_<arch>_platform. Example
|
||
`--platform @zig_sdk//:linux_amd64_platform`. Note that this is in the
|
||
wrong place[1] and is likely to be changed.
|
||
- Tests are now executed[2] with `bazel test //test/...` on amd64
|
||
(natively) and arm64 (via qemu-aarch64-static). You are enocouraged to
|
||
add your own tests if you would like me to catch issues for you before
|
||
bumping zig-cc.
|
||
- I did NOT upgrade zig, it's the same as in v0.4.3.
|
||
|
||
Zig's maintainer Andrew asked me to test the 0.9.x release branch before
|
||
he does a zig 0.9.1 release. So if you care for zig not breaking
|
||
something before the release, but that doesn't really fit into zig's
|
||
test suite, a test in test/ may be a good place.
|
||
|
||
Motiejus
|
||
|
||
[1]: https://git.sr.ht/~motiejus/bazel-zig-cc/tree/v0.4.4/item/README.md#toolchain-and-platform-target-locations
|
||
[2]: https://git.sr.ht/~motiejus/bazel-zig-cc/tree/v0.4.4/item/ci/test
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=none
|
||
Received: from git.sr.ht (unknown [173.195.146.142])
|
||
by mail-b.sr.ht (Postfix) with ESMTPSA id 2D5CC11F033;
|
||
Thu, 10 Feb 2022 23:32:58 +0000 (UTC)
|
||
From: ~kmicklas <kmicklas@git.sr.ht>
|
||
Date: Thu, 10 Feb 2022 23:32:57 +0000
|
||
Subject: [PATCH bazel-zig-cc 0/3] Support ARM64 Mac
|
||
MIME-Version: 1.0
|
||
Message-ID: <164453597791.17553.15415322179801626658-0@git.sr.ht>
|
||
X-Mailer: git.sr.ht
|
||
Reply-to: ~kmicklas <accounts@kmicklas.com>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Cc: kmicklas@uber.com
|
||
Content-Type: text/plain; charset="utf-8"
|
||
Content-Transfer-Encoding: 7bit
|
||
|
||
With this I'm able to build a simple `cc_library` target on an M1.
|
||
|
||
Ken Micklas (3):
|
||
Fix darwin arm64 case in .envrc for loading bazel
|
||
Interpret arm64 output from uname as aarch64 on mac OS
|
||
Fix and adjust darwin libc header paths depending on CPU
|
||
|
||
.envrc | 2 +-
|
||
toolchain/defs.bzl | 21 +++++++++++++--------
|
||
2 files changed, 14 insertions(+), 9 deletions(-)
|
||
|
||
--
|
||
2.32.0
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=none
|
||
Received: from git.sr.ht (unknown [173.195.146.142])
|
||
by mail-b.sr.ht (Postfix) with ESMTPSA id 5AB6311F0C1;
|
||
Thu, 10 Feb 2022 23:32:58 +0000 (UTC)
|
||
From: ~kmicklas <kmicklas@git.sr.ht>
|
||
Date: Thu, 10 Feb 2022 18:20:56 -0500
|
||
Subject:
|
||
[PATCH bazel-zig-cc 1/3] Fix darwin arm64 case in .envrc for loading bazel
|
||
Message-ID: <164453597791.17553.15415322179801626658-1@git.sr.ht>
|
||
X-Mailer: git.sr.ht
|
||
Reply-to: ~kmicklas <accounts@kmicklas.com>
|
||
In-Reply-To: <164453597791.17553.15415322179801626658-0@git.sr.ht>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Cc: kmicklas@uber.com
|
||
Content-Type: text/plain; charset="utf-8"
|
||
Content-Transfer-Encoding: quoted-printable
|
||
MIME-Version: 1.0
|
||
|
||
From: Ken Micklas <kmicklas@uber.com>
|
||
|
||
---
|
||
.envrc | 2 +-
|
||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
||
diff --git a/.envrc b/.envrc
|
||
index 802d197..2b1d835 100644
|
||
--- a/.envrc
|
||
+++ b/.envrc
|
||
@@ -17,7 +17,7 @@ case "$(uname | tr A-Z a-z)-$(uname -m)" in
|
||
bzl=3D$(direnv fetchurl "${_u}linux-arm64" sha256-wd5oYN1PjV4uwnAJe9=
|
||
RtaiEblxoLizhVl4S9BR6pUKE=3D);;
|
||
darwin-x86_64)
|
||
bzl=3D$(direnv fetchurl "${_u}darwin-amd64" sha256-5IW7+EUy0CpgsOsjx=
|
||
wJhC1QI3zoZkIek8rXgmVu/LVo=3D);;
|
||
- darwin-aarch64)
|
||
+ darwin-arm64)
|
||
bzl=3D$(direnv fetchurl "${_u}darwin-arm64" sha256-wi1IYBRm2dOwQ8zXQ=
|
||
FHy9CMPm59FCfCXAXyXMDqojRM=3D);;
|
||
*)
|
||
>&2 echo "unsupported architecture tuple $(uname | tr A-Z a-z)-$(una=
|
||
me -m)"
|
||
--=20
|
||
2.32.0
|
||
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=none
|
||
Received: from git.sr.ht (unknown [173.195.146.142])
|
||
by mail-b.sr.ht (Postfix) with ESMTPSA id 7571711F0C9;
|
||
Thu, 10 Feb 2022 23:32:58 +0000 (UTC)
|
||
From: ~kmicklas <kmicklas@git.sr.ht>
|
||
Date: Thu, 10 Feb 2022 18:22:37 -0500
|
||
Subject: [PATCH bazel-zig-cc 2/3] Interpret arm64 output from uname as aarch64
|
||
on mac OS
|
||
Message-ID: <164453597791.17553.15415322179801626658-2@git.sr.ht>
|
||
X-Mailer: git.sr.ht
|
||
Reply-to: ~kmicklas <accounts@kmicklas.com>
|
||
In-Reply-To: <164453597791.17553.15415322179801626658-0@git.sr.ht>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Cc: kmicklas@uber.com
|
||
Content-Type: text/plain; charset="utf-8"
|
||
Content-Transfer-Encoding: quoted-printable
|
||
MIME-Version: 1.0
|
||
|
||
From: Ken Micklas <kmicklas@uber.com>
|
||
|
||
---
|
||
toolchain/defs.bzl | 11 +++++++----
|
||
1 file changed, 7 insertions(+), 4 deletions(-)
|
||
|
||
diff --git a/toolchain/defs.bzl b/toolchain/defs.bzl
|
||
index 693e2da..2b572d3 100644
|
||
--- a/toolchain/defs.bzl
|
||
+++ b/toolchain/defs.bzl
|
||
@@ -222,12 +222,15 @@ def _zig_repository_impl(repository_ctx):
|
||
res =3D repository_ctx.execute(["uname", "-m"])
|
||
if res.return_code !=3D 0:
|
||
fail("failed to run uname -m")
|
||
- uname =3D res.stdout.strip()
|
||
+ arch =3D res.stdout.strip()
|
||
=20
|
||
+ os =3D "linux"
|
||
if repository_ctx.os.name.lower().startswith("mac os"):
|
||
- host_platform =3D "macos-{}".format(uname)
|
||
- else:
|
||
- host_platform =3D "linux-{}".format(uname)
|
||
+ os =3D "macos"
|
||
+ if arch =3D=3D "arm64":
|
||
+ # uname -m reports arm64 on an M1 Mac.
|
||
+ arch =3D "aarch64"
|
||
+ host_platform =3D "{}-{}".format(os, arch)
|
||
=20
|
||
zig_include_root =3D repository_ctx.attr.host_platform_include_root[host=
|
||
_platform]
|
||
zig_sha256 =3D repository_ctx.attr.host_platform_sha256[host_platform]
|
||
--=20
|
||
2.32.0
|
||
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=none
|
||
Received: from git.sr.ht (unknown [173.195.146.142])
|
||
by mail-b.sr.ht (Postfix) with ESMTPSA id 93FE611F189;
|
||
Thu, 10 Feb 2022 23:32:58 +0000 (UTC)
|
||
From: ~kmicklas <kmicklas@git.sr.ht>
|
||
Date: Thu, 10 Feb 2022 18:24:21 -0500
|
||
Subject: [PATCH bazel-zig-cc 3/3] Fix and adjust darwin libc header paths
|
||
depending on CPU
|
||
Message-ID: <164453597791.17553.15415322179801626658-3@git.sr.ht>
|
||
X-Mailer: git.sr.ht
|
||
Reply-to: ~kmicklas <accounts@kmicklas.com>
|
||
In-Reply-To: <164453597791.17553.15415322179801626658-0@git.sr.ht>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Cc: kmicklas@uber.com
|
||
Content-Type: text/plain; charset="utf-8"
|
||
Content-Transfer-Encoding: 7bit
|
||
MIME-Version: 1.0
|
||
|
||
From: Ken Micklas <kmicklas@uber.com>
|
||
|
||
---
|
||
toolchain/defs.bzl | 10 ++++++----
|
||
1 file changed, 6 insertions(+), 4 deletions(-)
|
||
|
||
diff --git a/toolchain/defs.bzl b/toolchain/defs.bzl
|
||
index 2b572d3..8ed93c7 100644
|
||
--- a/toolchain/defs.bzl
|
||
+++ b/toolchain/defs.bzl
|
||
@@ -54,15 +54,17 @@ _GLIBCS = [
|
||
]
|
||
|
||
def _target_darwin(gocpu, zigcpu):
|
||
+ min_os = "10"
|
||
+ if zigcpu == "aarch64":
|
||
+ min_os = "11"
|
||
return struct(
|
||
gotarget = "darwin_{}".format(gocpu),
|
||
zigtarget = "{}-macos-gnu".format(zigcpu),
|
||
includes = [
|
||
"libunwind/include",
|
||
- # FIXME: add macos.10, macos.11 and macos.12 targets,
|
||
- # and adjust the includes
|
||
- "libc/include/{}-macos.10-gnu".format(zigcpu),
|
||
- "libc/include/{}-macos-any".format(zigcpu),
|
||
+ # TODO: Define a toolchain for each minimum OS version
|
||
+ "libc/include/{}-macos.{}-gnu".format(zigcpu, min_os),
|
||
+ "libc/include/any-macos.{}-any".format(min_os),
|
||
"libc/include/any-macos-any",
|
||
],
|
||
linkopts = [],
|
||
--
|
||
2.32.0
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
DKIM-Signature: a=rsa-sha256; bh=iFZPni2s8+PUNzy+zRMfM/84OlUZYNc44+op1j+85vU=;
|
||
c=simple/simple; d=sr.ht; h=Date:From:In-Reply-To:Subject:To:Cc;
|
||
q=dns/txt; s=srht; t=1644536758; v=1;
|
||
b=nwchpQbJskdTrW86U+nIYMXtY5qtrAAQ1PmhQMEU2DRVR6LyoUWQ0m/XoKSOakS2QYNAtKFG
|
||
eH7jqHuViZjuINpv4NscE+l+u238PRAf5qTMiusugMOetvvlzw6n25oPckO9bs5/2kidDkRiuVF
|
||
ZbDyp/L4+98ACknuwLr9+kOd1QZjU34L6S81GkOKE23jKHNnLT+wAmyDq2KS91EQUk4rGPuCTuK
|
||
0NnT9gJrEx3ytD5iyb7eyjtcupQBHTqbEDUpPpW7pc0QsvgTOobiv1rK7K6dwcSGBT1Kx6pml3V
|
||
eMidvLC1gkLkL0Tx+2371PVoanmuBKJ+Jy/uN43X1NFlA==
|
||
Received: from localhost (unknown [173.195.146.249])
|
||
by mail-b.sr.ht (Postfix) with UTF8SMTPSA id 6539E11F033;
|
||
Thu, 10 Feb 2022 23:45:58 +0000 (UTC)
|
||
MIME-Version: 1.0
|
||
Date: Thu, 10 Feb 2022 23:45:58 +0000
|
||
From: "builds.sr.ht" <builds@sr.ht>
|
||
Message-ID: <CHSRML2SAOY5.1NQDDWU9LNOYA@cirno>
|
||
In-Reply-To: <164453597791.17553.15415322179801626658-3@git.sr.ht>
|
||
Subject: [bazel-zig-cc/patches/.build.yml] build success
|
||
To: "~kmicklas" <accounts@kmicklas.com>
|
||
Cc: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Content-Type: text/plain; charset=UTF-8
|
||
Content-Transfer-Encoding: quoted-printable
|
||
|
||
bazel-zig-cc/patches/.build.yml: SUCCESS in 12m57s
|
||
|
||
[Support ARM64 Mac][0] from [~kmicklas][1]
|
||
|
||
[0]: https://lists.sr.ht/~motiejus/bazel-zig-cc/patches/29276
|
||
[1]: mailto:accounts@kmicklas.com
|
||
|
||
=E2=9C=93 #693103 SUCCESS bazel-zig-cc/patches/.build.yml https://builds.sr=
|
||
.ht/~motiejus/job/693103
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id 1A0A511F006
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Fri, 11 Feb 2022 04:34:02 +0000 (UTC)
|
||
Received: by mail-lj1-f171.google.com with SMTP id z20so10896707ljo.6
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Thu, 10 Feb 2022 20:34:02 -0800 (PST)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=sender:date:from:to:cc:subject:message-id:references:mime-version
|
||
:content-disposition:in-reply-to;
|
||
bh=uNKHiAfOE1XXriWNUtxZO2RyASkqd7Sf7RgJXzrnxZw=;
|
||
b=bG/yg7+8EDr7XPFG5C4Pi9CaXTtY36Ndidvr6aaLEQxdc9Vk7OXjhkIsS2e3AhkmqO
|
||
QMAT8Yluz5r1VpQ+/5UWk0DfRWbEI9Q7KMPS1NkkgFmbzNljLdfs8HuV1JsbjAqbDixn
|
||
beA4+J1vxNy5nj0eeP70+TaPC5G+W7Rrzr7dPDa/ZY4ey3Itx3kHDZA7b5BTTVYeSNrB
|
||
bNcvS+x5mpTYFaacqYSuS7pZfiF1JhC9LjOeE5mQjpVztRWPAeJJKh0tdx0/2q3zf/Kb
|
||
iecc2tcaMmUerc78LmogJ4QPBlUEapaew8FQe1k12N7UNQ0blQP3SLVRf1eelSQUyF/v
|
||
jUXg==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:sender:date:from:to:cc:subject:message-id
|
||
:references:mime-version:content-disposition:in-reply-to;
|
||
bh=uNKHiAfOE1XXriWNUtxZO2RyASkqd7Sf7RgJXzrnxZw=;
|
||
b=3kpFIibEGFkECokJqdQej4nn8+cg4yeLhxFMgU4/IxcQaxTcpkeBGU7zh3jl6KQJTa
|
||
WOn9lYlWNzZXGJtjAajDqELCqMFiTAJLPU16OE43QKNVzhhr5aLpIUoTp6b1AFtRYTTZ
|
||
VmXLnMBsP+0AE1GaksMzm6f6wjlsUWz++hY0NcX5qKdPUogbXFQu5KzWUJDejB4sROeo
|
||
l7pPb8MvLRg7sTjhRfzMffL96sIqtjXAK6o9wHAyExWH5RjQhOTXnJk8BJ2iOezNVsmw
|
||
mnybyeSrIoHnl8PEovLDriZFgWJpgpmqTd0Vj82UH/50LZK+PbKEVjaGBMf7/1B8Lw6Y
|
||
w+wA==
|
||
X-Gm-Message-State: AOAM533jR9y8KlycSsOOu2CgJ8L5yL5a869ALofm8kSQ6tSwqAa+YvAO
|
||
VTpASzqriQCJEvn/7j0F+1I=
|
||
X-Google-Smtp-Source: ABdhPJybI1W3A3/4xVRPIq7fWV8haq5HpYKCBiFGcgS9/uhSDBKHjInW6LLK6a75vfURGLbrb1KjUw==
|
||
X-Received: by 2002:a2e:b047:: with SMTP id d7mr7118977ljl.359.1644554038457;
|
||
Thu, 10 Feb 2022 20:33:58 -0800 (PST)
|
||
Received: from localhost ([88.223.105.24])
|
||
by smtp.gmail.com with ESMTPSA id l1sm2988565lfh.151.2022.02.10.20.33.57
|
||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||
Thu, 10 Feb 2022 20:33:57 -0800 (PST)
|
||
Sender: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <desired.mta@gmail.com>
|
||
Date: Fri, 11 Feb 2022 06:33:56 +0200
|
||
From: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
To: ~kmicklas <accounts@kmicklas.com>
|
||
Cc: ~motiejus/bazel-zig-cc@lists.sr.ht, kmicklas@uber.com,
|
||
joesmoe10@gmail.com
|
||
Subject: Re: [PATCH bazel-zig-cc 0/3] Support ARM64 Mac
|
||
Message-ID: <20220211043356.xgchjv34q246kxa3@mtpad.i.jakstys.lt>
|
||
References: <164453597791.17553.15415322179801626658-0@git.sr.ht>
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=utf-8
|
||
Content-Disposition: inline
|
||
In-Reply-To: <164453597791.17553.15415322179801626658-0@git.sr.ht>
|
||
|
||
On Thu, Feb 10, 2022 at 11:32:57PM +0000, ~kmicklas wrote:
|
||
> With this I'm able to build a simple `cc_library` target on an M1.
|
||
>
|
||
> Ken Micklas (3):
|
||
> Fix darwin arm64 case in .envrc for loading bazel
|
||
> Interpret arm64 output from uname as aarch64 on mac OS
|
||
> Fix and adjust darwin libc header paths depending on CPU
|
||
|
||
Thank you. Applied all 3 patches and tagged v0.4.5.
|
||
|
||
cc Joe, who had problems with M1 before. These are now fixed.
|
||
|
||
Motiejus
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=none
|
||
Received: from git.sr.ht (unknown [173.195.146.142])
|
||
by mail-b.sr.ht (Postfix) with ESMTPSA id 5024911EF37;
|
||
Thu, 17 Mar 2022 20:04:30 +0000 (UTC)
|
||
From: ~kmicklas <kmicklas@git.sr.ht>
|
||
Date: Thu, 17 Mar 2022 20:04:29 +0000
|
||
Subject: [PATCH bazel-zig-cc 0/3] Download improvments
|
||
MIME-Version: 1.0
|
||
Message-ID: <164754746999.13783.11303815672892555536-0@git.sr.ht>
|
||
X-Mailer: git.sr.ht
|
||
Reply-to: ~kmicklas <git@kmicklas.com>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Cc: kmicklas@uber.com
|
||
Content-Type: text/plain; charset="utf-8"
|
||
Content-Transfer-Encoding: 7bit
|
||
|
||
This adds support for netrc and multiple download mirrors.
|
||
|
||
Ken Micklas (3):
|
||
Pull default SHA256s into constant and don't update
|
||
Support multiple URL formats
|
||
Support netrc for Zig SDK download
|
||
|
||
toolchain/defs.bzl | 66 +++++++++++++++++++++++++++++++++++-----------
|
||
1 file changed, 50 insertions(+), 16 deletions(-)
|
||
|
||
--
|
||
2.34.1
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=none
|
||
Received: from git.sr.ht (unknown [173.195.146.142])
|
||
by mail-b.sr.ht (Postfix) with ESMTPSA id 7FAB111EF43;
|
||
Thu, 17 Mar 2022 20:04:30 +0000 (UTC)
|
||
From: ~kmicklas <kmicklas@git.sr.ht>
|
||
Date: Thu, 17 Mar 2022 15:11:17 -0400
|
||
Subject:
|
||
[PATCH bazel-zig-cc 1/3] Pull default SHA256s into constant and don't update
|
||
Message-ID: <164754746999.13783.11303815672892555536-1@git.sr.ht>
|
||
X-Mailer: git.sr.ht
|
||
Reply-to: ~kmicklas <git@kmicklas.com>
|
||
In-Reply-To: <164754746999.13783.11303815672892555536-0@git.sr.ht>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Cc: kmicklas@uber.com
|
||
Content-Type: text/plain; charset="utf-8"
|
||
Content-Transfer-Encoding: quoted-printable
|
||
MIME-Version: 1.0
|
||
|
||
From: Ken Micklas <kmicklas@uber.com>
|
||
|
||
Starlark's default argument semantics are pretty weird and likely not
|
||
what you would expect:
|
||
https://github.com/bazelbuild/starlark/blob/master/spec.md#functions
|
||
|
||
Additionally, this is just easier to read.
|
||
---
|
||
toolchain/defs.bzl | 19 +++++++++----------
|
||
1 file changed, 9 insertions(+), 10 deletions(-)
|
||
|
||
diff --git a/toolchain/defs.bzl b/toolchain/defs.bzl
|
||
index 8ed93c7..f942c5b 100644
|
||
--- a/toolchain/defs.bzl
|
||
+++ b/toolchain/defs.bzl
|
||
@@ -158,29 +158,28 @@ _URL_FORMAT_JAKSTYS =3D "https://dl.jakstys.lt/zig/zig-=
|
||
{host_platform}-{version}.t
|
||
=20
|
||
_VERSION =3D "0.10.0-dev.513+029844210"
|
||
=20
|
||
+_HOST_PLATFORM_SHA256 =3D {
|
||
+ "linux-aarch64": "fc0b929948d57d1b15aaac33db0cd136a1f79830926c9285fd3f5b=
|
||
6445f1ef95",
|
||
+ "linux-x86_64": "c6f323b02b0bcf7b18143983bf2525640dd541f39af661e963823c9=
|
||
a61a09b28",
|
||
+ "macos-aarch64": "0ccd8dad1264474ca824d45c3021b7e549b67792fa1a66cb9d4d70=
|
||
40775319bb",
|
||
+ "macos-x86_64": "3c939bebe8648c277ee66d1c600e68576e382d0309dc29eb4c32aba=
|
||
96b83f6f0",
|
||
+}
|
||
+
|
||
def register_toolchains(
|
||
register =3D [],
|
||
version =3D _VERSION,
|
||
url_format =3D _URL_FORMAT_JAKSTYS,
|
||
- host_platform_sha256 =3D {}):
|
||
+ host_platform_sha256 =3D _HOST_PLATFORM_SHA256):
|
||
"""
|
||
Download zig toolchain and register some.
|
||
@param register registers the given toolchains to the system using
|
||
native.register_toolchains(). See README for possible choices.
|
||
"""
|
||
- sha256s =3D {
|
||
- "linux-aarch64": "fc0b929948d57d1b15aaac33db0cd136a1f79830926c9285fd=
|
||
3f5b6445f1ef95",
|
||
- "linux-x86_64": "c6f323b02b0bcf7b18143983bf2525640dd541f39af661e9638=
|
||
23c9a61a09b28",
|
||
- "macos-aarch64": "0ccd8dad1264474ca824d45c3021b7e549b67792fa1a66cb9d=
|
||
4d7040775319bb",
|
||
- "macos-x86_64": "3c939bebe8648c277ee66d1c600e68576e382d0309dc29eb4c3=
|
||
2aba96b83f6f0",
|
||
- }
|
||
- sha256s.update(host_platform_sha256)
|
||
-
|
||
zig_repository(
|
||
name =3D "zig_sdk",
|
||
version =3D version,
|
||
url_format =3D url_format,
|
||
- host_platform_sha256 =3D sha256s,
|
||
+ host_platform_sha256 =3D host_platform_sha256,
|
||
host_platform_include_root =3D {
|
||
"linux-aarch64": "lib/",
|
||
"linux-x86_64": "lib/",
|
||
--=20
|
||
2.34.1
|
||
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=none
|
||
Received: from git.sr.ht (unknown [173.195.146.142])
|
||
by mail-b.sr.ht (Postfix) with ESMTPSA id AFC4C11EF44;
|
||
Thu, 17 Mar 2022 20:04:30 +0000 (UTC)
|
||
From: ~kmicklas <kmicklas@git.sr.ht>
|
||
Date: Thu, 17 Mar 2022 15:39:41 -0400
|
||
Subject: [PATCH bazel-zig-cc 2/3] Support multiple URL formats
|
||
Message-ID: <164754746999.13783.11303815672892555536-2@git.sr.ht>
|
||
X-Mailer: git.sr.ht
|
||
Reply-to: ~kmicklas <git@kmicklas.com>
|
||
In-Reply-To: <164754746999.13783.11303815672892555536-0@git.sr.ht>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Cc: kmicklas@uber.com
|
||
Content-Type: text/plain; charset="utf-8"
|
||
Content-Transfer-Encoding: quoted-printable
|
||
MIME-Version: 1.0
|
||
|
||
From: Ken Micklas <kmicklas@uber.com>
|
||
|
||
---
|
||
toolchain/defs.bzl | 20 +++++++++++++++-----
|
||
1 file changed, 15 insertions(+), 5 deletions(-)
|
||
|
||
diff --git a/toolchain/defs.bzl b/toolchain/defs.bzl
|
||
index f942c5b..f883cc2 100644
|
||
--- a/toolchain/defs.bzl
|
||
+++ b/toolchain/defs.bzl
|
||
@@ -168,7 +168,8 @@ _HOST_PLATFORM_SHA256 =3D {
|
||
def register_toolchains(
|
||
register =3D [],
|
||
version =3D _VERSION,
|
||
- url_format =3D _URL_FORMAT_JAKSTYS,
|
||
+ url_format =3D [_URL_FORMAT_JAKSTYS],
|
||
+ url_formats =3D [],
|
||
host_platform_sha256 =3D _HOST_PLATFORM_SHA256):
|
||
"""
|
||
Download zig toolchain and register some.
|
||
@@ -178,7 +179,8 @@ def register_toolchains(
|
||
zig_repository(
|
||
name =3D "zig_sdk",
|
||
version =3D version,
|
||
- url_format =3D url_format,
|
||
+ url_format =3D url_format if type(url_format) =3D=3D type("") else N=
|
||
one,
|
||
+ url_formats =3D url_format if type(url_format) =3D=3D type([""]) els=
|
||
e None,
|
||
host_platform_sha256 =3D host_platform_sha256,
|
||
host_platform_include_root =3D {
|
||
"linux-aarch64": "lib/",
|
||
@@ -239,10 +241,17 @@ def _zig_repository_impl(repository_ctx):
|
||
"version": repository_ctx.attr.version,
|
||
"host_platform": host_platform,
|
||
}
|
||
- zig_url =3D repository_ctx.attr.url_format.format(**format_vars)
|
||
+
|
||
+ url_format =3D repository_ctx.attr.url_format
|
||
+ url_formats =3D repository_ctx.attr.url_formats
|
||
+
|
||
+ if len(url_formats) =3D=3D 0:
|
||
+ url_formats =3D [url_format]
|
||
+ elif url_format !=3D "":
|
||
+ fail("Only one of url_format and url_formats should be specified.")
|
||
=20
|
||
repository_ctx.download_and_extract(
|
||
- url =3D zig_url,
|
||
+ url =3D [uf.format(**format_vars) for uf in url_formats],
|
||
stripPrefix =3D "zig-{host_platform}-{version}/".format(**format_var=
|
||
s),
|
||
sha256 =3D zig_sha256,
|
||
)
|
||
@@ -279,7 +288,8 @@ zig_repository =3D repository_rule(
|
||
attrs =3D {
|
||
"version": attr.string(),
|
||
"host_platform_sha256": attr.string_dict(),
|
||
- "url_format": attr.string(),
|
||
+ "url_format": attr.string(doc =3D "Deprecated in favor of url_format=
|
||
s"),
|
||
+ "url_formats": attr.string_list(),
|
||
"host_platform_include_root": attr.string_dict(),
|
||
},
|
||
implementation =3D _zig_repository_impl,
|
||
--=20
|
||
2.34.1
|
||
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=none
|
||
Received: from git.sr.ht (unknown [173.195.146.142])
|
||
by mail-b.sr.ht (Postfix) with ESMTPSA id D52B611EF52;
|
||
Thu, 17 Mar 2022 20:04:30 +0000 (UTC)
|
||
From: ~kmicklas <kmicklas@git.sr.ht>
|
||
Date: Thu, 17 Mar 2022 15:47:45 -0400
|
||
Subject: [PATCH bazel-zig-cc 3/3] Support netrc for Zig SDK download
|
||
Message-ID: <164754746999.13783.11303815672892555536-3@git.sr.ht>
|
||
X-Mailer: git.sr.ht
|
||
Reply-to: ~kmicklas <git@kmicklas.com>
|
||
In-Reply-To: <164754746999.13783.11303815672892555536-0@git.sr.ht>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Cc: kmicklas@uber.com
|
||
Content-Type: text/plain; charset="utf-8"
|
||
Content-Transfer-Encoding: quoted-printable
|
||
MIME-Version: 1.0
|
||
|
||
From: Ken Micklas <kmicklas@uber.com>
|
||
|
||
---
|
||
toolchain/defs.bzl | 29 +++++++++++++++++++++++++++--
|
||
1 file changed, 27 insertions(+), 2 deletions(-)
|
||
|
||
diff --git a/toolchain/defs.bzl b/toolchain/defs.bzl
|
||
index f883cc2..0ea7a26 100644
|
||
--- a/toolchain/defs.bzl
|
||
+++ b/toolchain/defs.bzl
|
||
@@ -1,5 +1,5 @@
|
||
load("@bazel_skylib//lib:shell.bzl", "shell")
|
||
-load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
||
+load("@bazel_tools//tools/build_defs/repo:utils.bzl", "read_netrc", "use_net=
|
||
rc")
|
||
load(":zig_toolchain.bzl", "zig_cc_toolchain_config")
|
||
=20
|
||
DEFAULT_TOOL_PATHS =3D {
|
||
@@ -250,8 +250,11 @@ def _zig_repository_impl(repository_ctx):
|
||
elif url_format !=3D "":
|
||
fail("Only one of url_format and url_formats should be specified.")
|
||
=20
|
||
+ urls =3D [uf.format(**format_vars) for uf in url_formats]
|
||
+
|
||
repository_ctx.download_and_extract(
|
||
- url =3D [uf.format(**format_vars) for uf in url_formats],
|
||
+ auth =3D use_netrc(read_user_netrc(repository_ctx), urls, {}),
|
||
+ url =3D urls,
|
||
stripPrefix =3D "zig-{host_platform}-{version}/".format(**format_var=
|
||
s),
|
||
sha256 =3D zig_sha256,
|
||
)
|
||
@@ -407,3 +410,25 @@ def zig_build_macro(absolute_path, zig_include_root):
|
||
name =3D "{os}_{gocpu}_platform".format(os =3D os, gocpu=
|
||
=3D gocpu),
|
||
constraint_values =3D constraint_values,
|
||
)
|
||
+
|
||
+# Copied from https://github.com/bazelbuild/bazel/blob/master/tools/build_de=
|
||
fs/repo/utils.bzl
|
||
+# TODO: Upgrade to Bazel 5.1 and import this instead.
|
||
+def read_user_netrc(ctx):
|
||
+ """Read user's default netrc file.
|
||
+ Args:
|
||
+ ctx: The repository context of the repository rule calling this utilit=
|
||
y function.
|
||
+ Returns:
|
||
+ dict mapping a machine names to a dict with the information provided a=
|
||
bout them.
|
||
+ """
|
||
+ if ctx.os.name.startswith("windows"):
|
||
+ home_dir =3D ctx.os.environ.get("USERPROFILE", "")
|
||
+ else:
|
||
+ home_dir =3D ctx.os.environ.get("HOME", "")
|
||
+
|
||
+ if not home_dir:
|
||
+ return {}
|
||
+
|
||
+ netrcfile =3D "{}/.netrc".format(home_dir)
|
||
+ if not ctx.path(netrcfile).exists:
|
||
+ return {}
|
||
+ return read_netrc(ctx, netrcfile)
|
||
--=20
|
||
2.34.1
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
DKIM-Signature: a=rsa-sha256; bh=7E5ugq03gQepqZijHDKqWwmyoSoljjtR17dVHMYjfto=;
|
||
c=simple/simple; d=sr.ht; h=Date:In-Reply-To:Subject:To:Cc:From;
|
||
q=dns/txt; s=srht; t=1647548274; v=1;
|
||
b=aTuLBd3oZ//M2LwIw2Rup9HB16zQiEx5QkEq/L8E/T+y7EX72a7E5EVzqniFdJ+YN0l6Lb+y
|
||
3l5fvv4E43+2OwzTCAvnIHZU0FLLjYNzCG8FuyAssCABK3+Tj+jjplVZm/StyQjbIPiEuj6/XFa
|
||
jBx2L1zac0NHkjCHyQ6tcGY8pjFksQGdHoZ9DcLuUEVlXsf7xL+DUK31RzMlZFFcLPaR/wyYaf8
|
||
GUpjAWdoIp+54H0vUQgt+cjtTxzv7ILPkF1E7xUuvtpdE7pzpOLygodgIKZB2ImLMa3w/CZ11rf
|
||
L0mNJgGnomwUBTrALMJZnjlwSlB3v0bYP3n2tNVTOA9hQ==
|
||
Received: from localhost (unknown [173.195.146.249])
|
||
by mail-b.sr.ht (Postfix) with UTF8SMTPSA id F25FC11EF37;
|
||
Thu, 17 Mar 2022 20:17:53 +0000 (UTC)
|
||
MIME-Version: 1.0
|
||
Date: Thu, 17 Mar 2022 20:17:53 +0000
|
||
Message-ID: <CIMF4C956NY6.XAHMHMOADXNQ@cirno>
|
||
In-Reply-To: <164754746999.13783.11303815672892555536-3@git.sr.ht>
|
||
Subject: [bazel-zig-cc/patches/.build.yml] build success
|
||
To: "~kmicklas" <git@kmicklas.com>
|
||
Cc: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
From: "builds.sr.ht" <builds@sr.ht>
|
||
Content-Type: text/plain; charset=UTF-8
|
||
Content-Transfer-Encoding: quoted-printable
|
||
|
||
bazel-zig-cc/patches/.build.yml: SUCCESS in 13m21s
|
||
|
||
[Download improvments][0] from [~kmicklas][1]
|
||
|
||
[0]: https://lists.sr.ht/~motiejus/bazel-zig-cc/patches/30313
|
||
[1]: mailto:git@kmicklas.com
|
||
|
||
=E2=9C=93 #717171 SUCCESS bazel-zig-cc/patches/.build.yml https://builds.sr=
|
||
.ht/~motiejus/job/717171
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-lj1-f171.google.com (mail-lj1-f171.google.com [209.85.208.171])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id 8FFDB11EFC0
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Fri, 18 Mar 2022 05:58:51 +0000 (UTC)
|
||
Received: by mail-lj1-f171.google.com with SMTP id 25so10006112ljv.10
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Thu, 17 Mar 2022 22:58:51 -0700 (PDT)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=sender:date:from:to:subject:message-id:mime-version
|
||
:content-disposition;
|
||
bh=O5wygcx8YHlm9775MqZTv4VJEnvHYlC1UwlOjkrGTrU=;
|
||
b=f92Rz2hfsT15yHex1cxQWB0PaPyKA48jRdlarTnZj2BiC/jJ9ZHRBQzbZw9bTgHaU9
|
||
X/8+7wTlBzGgsrot4pN+2q1TAxL0lcYR3EpBUihhIPWNRYRx2odjeBm3khgRKs4tGfy5
|
||
mZvIuoncaj5su8mw6G9rP4MF0l0BSFoF4YX9zrkMYblOxO8Pst8VpyqN83qv/wTkCYER
|
||
EKD/qD3bTuD/V7qyZ37D5NudbabbwggRdazfuXcFMu7UKMY6I+JOWumd7ptA6GXiPPrh
|
||
E1Tkk1cQN9CY4UAF+Ie4I3ghZ1qCMq0R6BbsO01g0tKOAOuarPmQSyN7TJAOXq8wDRaE
|
||
E6zg==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:sender:date:from:to:subject:message-id
|
||
:mime-version:content-disposition;
|
||
bh=O5wygcx8YHlm9775MqZTv4VJEnvHYlC1UwlOjkrGTrU=;
|
||
b=x+4EEFsiiz57BGZprGzyJZLYG5Ci2gvxI1xHGgyfL6PAA3t+1lS1MAK6jLbwgHf6IG
|
||
ZLZ9BvaD7zR8QtFWGjoKKlVtSagMvjiGHT9k67hNMDcy3ZEX76UFBxFQTXbv0DkIYrYu
|
||
r+YXtKAQhmxgCsX2Jxia0xPLHQtZJR2w6E/devmhpb8v4m1QEcVqjvkzSTbmQEY11S0b
|
||
pxJAx9/7ZJPjUd9R7BGr50050Yzmxln8hk3ERFb6dBbvP49lqW2yZxrpioKr6ciGYTP7
|
||
0Bd33Y7VEMRgEin0ImL3kGDyD2sTjEFL9lkLcnGXkCxm5VIPpQIvFfHYW0jHDf5Nq5zt
|
||
FNmg==
|
||
X-Gm-Message-State: AOAM5310aa6U0D3DwRUXBG0km88Duds7a04XE9uMa5/NHpkVlM7i4M7Y
|
||
hNtj0uOOIetpr+7wBBHVgOYvEf4a08Kg7A==
|
||
X-Google-Smtp-Source: ABdhPJyQwYb1aPDuUAsW4HWDz5avo2+R7rK/HjA9tOlhOyQodRvS76ToI2lMUcBnpSgb1Jy4zkwl/A==
|
||
X-Received: by 2002:a05:651c:512:b0:249:71cf:37ee with SMTP id o18-20020a05651c051200b0024971cf37eemr339884ljp.484.1647583128947;
|
||
Thu, 17 Mar 2022 22:58:48 -0700 (PDT)
|
||
Received: from localhost ([87.54.21.186])
|
||
by smtp.gmail.com with ESMTPSA id j14-20020a056512108e00b004481ee0cee1sm690552lfg.67.2022.03.17.22.58.48
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>
|
||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||
Thu, 17 Mar 2022 22:58:48 -0700 (PDT)
|
||
Sender: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <desired.mta@gmail.com>
|
||
Date: Fri, 18 Mar 2022 06:58:47 +0100
|
||
From: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Subject: bazel-zig-cc v0.5.0
|
||
Message-ID: <20220318055847.p3qo75w55piucvix@mtpad.i.jakstys.lt>
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=utf-8
|
||
Content-Disposition: inline
|
||
|
||
Hi all,
|
||
|
||
thanks to Ken Micklas contributions, bazel-zig-cc can now do the
|
||
following:
|
||
|
||
- support netrc authentication. You can use internal mirrors for zig
|
||
bundle now (assuming they support netrc, of course).
|
||
- provide multiple download urls for the zig toolchain via
|
||
`url_formats`. This option is now documented, among with `version` and
|
||
`sha256`.
|
||
- while at it, upgraded zig to 0.10.0-dev.1393+291f5055f. I will be
|
||
cleaning up pre-0.10.0 from dl.jakstys.lt, consider yourself warned.
|
||
|
||
Since `sha256`, `urls` and `version` are part of the "official" API, I
|
||
will not be upgrading zig in bazel-zig-cc (or, rather, will upgrade much
|
||
more rarely); please do so in your application.
|
||
|
||
Reminder: dl.jakstys.lt is a small machine in my home closet. No UPS, no
|
||
monitoring whatsoever. So, if you are depending on this for work, you
|
||
may want to use your mirror.
|
||
|
||
Happy compiling,
|
||
Motiejus
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=none
|
||
Received: from git.sr.ht (unknown [173.195.146.142])
|
||
by mail-b.sr.ht (Postfix) with ESMTPSA id B878611EF57;
|
||
Fri, 25 Mar 2022 15:53:45 +0000 (UTC)
|
||
From: ~kmicklas <kmicklas@git.sr.ht>
|
||
Date: Fri, 25 Mar 2022 15:53:45 +0000
|
||
Subject:
|
||
[PATCH bazel-zig-cc 0/4] Upgrade to Bazel 5.1.0 and associated cleanups
|
||
MIME-Version: 1.0
|
||
Message-ID: <164822362548.25319.8453123527885867890-0@git.sr.ht>
|
||
X-Mailer: git.sr.ht
|
||
Reply-to: ~kmicklas <git@kmicklas.com>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Cc: kmicklas@uber.com
|
||
Content-Type: text/plain; charset="utf-8"
|
||
Content-Transfer-Encoding: 7bit
|
||
|
||
Also pins the Go SDK version.
|
||
|
||
Ken Micklas (4):
|
||
Upgrade to Bazel 5.1.0
|
||
Remove repo fetch-time uname dependency, use new os.arch instead
|
||
Use upstream read_user_netrc from Bazel 5.1
|
||
Pin Go SDK to 1.18 for reproducibility
|
||
|
||
.bazelversion | 2 +-
|
||
WORKSPACE | 2 +-
|
||
toolchain/defs.bzl | 41 ++++++++---------------------------------
|
||
3 files changed, 10 insertions(+), 35 deletions(-)
|
||
|
||
--
|
||
2.34.1
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=none
|
||
Received: from git.sr.ht (unknown [173.195.146.142])
|
||
by mail-b.sr.ht (Postfix) with ESMTPSA id D86DC11F01F;
|
||
Fri, 25 Mar 2022 15:53:45 +0000 (UTC)
|
||
From: ~kmicklas <kmicklas@git.sr.ht>
|
||
Date: Fri, 25 Mar 2022 11:45:39 -0400
|
||
Subject: [PATCH bazel-zig-cc 1/4] Upgrade to Bazel 5.1.0
|
||
Message-ID: <164822362548.25319.8453123527885867890-1@git.sr.ht>
|
||
X-Mailer: git.sr.ht
|
||
Reply-to: ~kmicklas <git@kmicklas.com>
|
||
In-Reply-To: <164822362548.25319.8453123527885867890-0@git.sr.ht>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Cc: kmicklas@uber.com
|
||
Content-Type: text/plain; charset="utf-8"
|
||
Content-Transfer-Encoding: 7bit
|
||
MIME-Version: 1.0
|
||
|
||
From: Ken Micklas <kmicklas@uber.com>
|
||
|
||
---
|
||
.bazelversion | 2 +-
|
||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
||
diff --git a/.bazelversion b/.bazelversion
|
||
index af8c8ec..831446c 100644
|
||
--- a/.bazelversion
|
||
+++ b/.bazelversion
|
||
@@ -1 +1 @@
|
||
-4.2.2
|
||
+5.1.0
|
||
--
|
||
2.34.1
|
||
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=none
|
||
Received: from git.sr.ht (unknown [173.195.146.142])
|
||
by mail-b.sr.ht (Postfix) with ESMTPSA id F2C8E11F0F2;
|
||
Fri, 25 Mar 2022 15:53:45 +0000 (UTC)
|
||
From: ~kmicklas <kmicklas@git.sr.ht>
|
||
Date: Fri, 25 Mar 2022 11:46:11 -0400
|
||
Subject: [PATCH bazel-zig-cc 2/4] Remove repo fetch-time uname dependency, use
|
||
new os.arch instead
|
||
Message-ID: <164822362548.25319.8453123527885867890-2@git.sr.ht>
|
||
X-Mailer: git.sr.ht
|
||
Reply-to: ~kmicklas <git@kmicklas.com>
|
||
In-Reply-To: <164822362548.25319.8453123527885867890-0@git.sr.ht>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Cc: kmicklas@uber.com
|
||
Content-Type: text/plain; charset="utf-8"
|
||
Content-Transfer-Encoding: quoted-printable
|
||
MIME-Version: 1.0
|
||
|
||
From: Ken Micklas <kmicklas@uber.com>
|
||
|
||
---
|
||
toolchain/defs.bzl | 15 ++++++---------
|
||
1 file changed, 6 insertions(+), 9 deletions(-)
|
||
|
||
diff --git a/toolchain/defs.bzl b/toolchain/defs.bzl
|
||
index 810db50..840976d 100644
|
||
--- a/toolchain/defs.bzl
|
||
+++ b/toolchain/defs.bzl
|
||
@@ -221,17 +221,14 @@ _ZIG_TOOLS =3D [
|
||
]
|
||
=20
|
||
def _zig_repository_impl(repository_ctx):
|
||
- res =3D repository_ctx.execute(["uname", "-m"])
|
||
- if res.return_code !=3D 0:
|
||
- fail("failed to run uname -m")
|
||
- arch =3D res.stdout.strip()
|
||
+ arch =3D repository_ctx.os.arch
|
||
+ if arch =3D=3D "amd64":
|
||
+ arch =3D "x86_64"
|
||
=20
|
||
- os =3D "linux"
|
||
- if repository_ctx.os.name.lower().startswith("mac os"):
|
||
+ os =3D repository_ctx.os.name.lower()
|
||
+ if os.startswith("mac os"):
|
||
os =3D "macos"
|
||
- if arch =3D=3D "arm64":
|
||
- # uname -m reports arm64 on an M1 Mac.
|
||
- arch =3D "aarch64"
|
||
+
|
||
host_platform =3D "{}-{}".format(os, arch)
|
||
=20
|
||
zig_include_root =3D repository_ctx.attr.host_platform_include_root[host=
|
||
_platform]
|
||
--=20
|
||
2.34.1
|
||
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=none
|
||
Received: from git.sr.ht (unknown [173.195.146.142])
|
||
by mail-b.sr.ht (Postfix) with ESMTPSA id 3AA1D11F178;
|
||
Fri, 25 Mar 2022 15:53:46 +0000 (UTC)
|
||
From: ~kmicklas <kmicklas@git.sr.ht>
|
||
Date: Fri, 25 Mar 2022 11:46:59 -0400
|
||
Subject: [PATCH bazel-zig-cc 3/4] Use upstream read_user_netrc from Bazel 5.1
|
||
Message-ID: <164822362548.25319.8453123527885867890-3@git.sr.ht>
|
||
X-Mailer: git.sr.ht
|
||
Reply-to: ~kmicklas <git@kmicklas.com>
|
||
In-Reply-To: <164822362548.25319.8453123527885867890-0@git.sr.ht>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Cc: kmicklas@uber.com
|
||
Content-Type: text/plain; charset="utf-8"
|
||
Content-Transfer-Encoding: quoted-printable
|
||
MIME-Version: 1.0
|
||
|
||
From: Ken Micklas <kmicklas@uber.com>
|
||
|
||
---
|
||
toolchain/defs.bzl | 26 ++------------------------
|
||
1 file changed, 2 insertions(+), 24 deletions(-)
|
||
|
||
diff --git a/toolchain/defs.bzl b/toolchain/defs.bzl
|
||
index 840976d..112a64a 100644
|
||
--- a/toolchain/defs.bzl
|
||
+++ b/toolchain/defs.bzl
|
||
@@ -1,6 +1,6 @@
|
||
load("@bazel_skylib//lib:shell.bzl", "shell")
|
||
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
|
||
-load("@bazel_tools//tools/build_defs/repo:utils.bzl", "read_netrc", "use_net=
|
||
rc")
|
||
+load("@bazel_tools//tools/build_defs/repo:utils.bzl", "read_user_netrc", "us=
|
||
e_netrc")
|
||
load(":zig_toolchain.bzl", "zig_cc_toolchain_config")
|
||
=20
|
||
DEFAULT_TOOL_PATHS =3D {
|
||
@@ -240,7 +240,7 @@ def _zig_repository_impl(repository_ctx):
|
||
=20
|
||
urls =3D [uf.format(**format_vars) for uf in repository_ctx.attr.url_for=
|
||
mats]
|
||
repository_ctx.download_and_extract(
|
||
- auth =3D use_netrc(_read_user_netrc(repository_ctx), urls, {}),
|
||
+ auth =3D use_netrc(read_user_netrc(repository_ctx), urls, {}),
|
||
url =3D urls,
|
||
stripPrefix =3D "zig-{host_platform}-{version}/".format(**format_var=
|
||
s),
|
||
sha256 =3D zig_sha256,
|
||
@@ -396,25 +396,3 @@ def zig_build_macro(absolute_path, zig_include_root):
|
||
name =3D "{os}_{gocpu}_platform".format(os =3D os, gocpu=
|
||
=3D gocpu),
|
||
constraint_values =3D constraint_values,
|
||
)
|
||
-
|
||
-# Copied from https://github.com/bazelbuild/bazel/blob/master/tools/build_de=
|
||
fs/repo/utils.bzl
|
||
-# TODO: Upgrade to Bazel 5.1 and import this instead.
|
||
-def _read_user_netrc(ctx):
|
||
- """Read user's default netrc file.
|
||
- Args:
|
||
- ctx: The repository context of the repository rule calling this utilit=
|
||
y function.
|
||
- Returns:
|
||
- dict mapping a machine names to a dict with the information provided a=
|
||
bout them.
|
||
- """
|
||
- if ctx.os.name.startswith("windows"):
|
||
- home_dir =3D ctx.os.environ.get("USERPROFILE", "")
|
||
- else:
|
||
- home_dir =3D ctx.os.environ.get("HOME", "")
|
||
-
|
||
- if not home_dir:
|
||
- return {}
|
||
-
|
||
- netrcfile =3D "{}/.netrc".format(home_dir)
|
||
- if not ctx.path(netrcfile).exists:
|
||
- return {}
|
||
- return read_netrc(ctx, netrcfile)
|
||
--=20
|
||
2.34.1
|
||
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=none
|
||
Received: from git.sr.ht (unknown [173.195.146.142])
|
||
by mail-b.sr.ht (Postfix) with ESMTPSA id 5A3F711EF57;
|
||
Fri, 25 Mar 2022 15:53:46 +0000 (UTC)
|
||
From: ~kmicklas <kmicklas@git.sr.ht>
|
||
Date: Fri, 25 Mar 2022 11:47:10 -0400
|
||
Subject: [PATCH bazel-zig-cc 4/4] Pin Go SDK to 1.18 for reproducibility
|
||
Message-ID: <164822362548.25319.8453123527885867890-4@git.sr.ht>
|
||
X-Mailer: git.sr.ht
|
||
Reply-to: ~kmicklas <git@kmicklas.com>
|
||
In-Reply-To: <164822362548.25319.8453123527885867890-0@git.sr.ht>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Cc: kmicklas@uber.com
|
||
Content-Type: text/plain; charset="utf-8"
|
||
Content-Transfer-Encoding: 7bit
|
||
MIME-Version: 1.0
|
||
|
||
From: Ken Micklas <kmicklas@uber.com>
|
||
|
||
---
|
||
WORKSPACE | 2 +-
|
||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||
|
||
diff --git a/WORKSPACE b/WORKSPACE
|
||
index eeb098a..0aff5db 100644
|
||
--- a/WORKSPACE
|
||
+++ b/WORKSPACE
|
||
@@ -28,7 +28,7 @@ load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
|
||
go_rules_dependencies()
|
||
|
||
# use latest stable.
|
||
-go_download_sdk(name = "go_sdk")
|
||
+go_download_sdk(name = "go_sdk", version = "1.18")
|
||
|
||
go_register_toolchains()
|
||
|
||
--
|
||
2.34.1
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
DKIM-Signature: a=rsa-sha256; bh=vl6q2l7OOKEBhNt4qtJAxHIft46gdMwjqZrsBx08HLM=;
|
||
c=simple/simple; d=sr.ht; h=Date:In-Reply-To:Subject:To:Cc:From;
|
||
q=dns/txt; s=srht; t=1648224469; v=1;
|
||
b=grlGdG4ZDS5JH4IcFhaf7h4A5MUCfTSq78jO+bUR4LXCdjgOxQD4LUiHPJVGHkqAWEItA8rp
|
||
kagxXYt7EYuF2U3R2Ub0ygW/2G3JiwFDAlpUdA0E5d0Zm3KCMaiI8OpLwZO0C0TdJ4SdgL28K83
|
||
IuxKzxJwp/hl31zQROAhFlPI0Lln10Bo9qC1tcCqDB5qjSwBPeFl3yTD8lvlwScp0VzNvoVVKKt
|
||
qFn0sfWwWkE/12x4SzFcm+HzJFvMaVIiPfxJFhvyj1z7ATuNMo18n4jFOCb0LRECw02rPIrbgvs
|
||
sxbGBnopieamHloWulztJlETdQrYe/J8vsc+eIYwic5Gg==
|
||
Received: from localhost (unknown [173.195.146.244])
|
||
by mail-b.sr.ht (Postfix) with UTF8SMTPSA id 89B2D11F01F;
|
||
Fri, 25 Mar 2022 16:07:49 +0000 (UTC)
|
||
MIME-Version: 1.0
|
||
Date: Fri, 25 Mar 2022 16:07:49 +0000
|
||
Message-ID: <CIT2T87A4BL6.2OSWJY7N2ORZ8@cirno2>
|
||
In-Reply-To: <164822362548.25319.8453123527885867890-4@git.sr.ht>
|
||
Subject: [bazel-zig-cc/patches/.build.yml] build failed
|
||
To: "~kmicklas" <git@kmicklas.com>
|
||
Cc: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
From: "builds.sr.ht" <builds@sr.ht>
|
||
Content-Type: text/plain; charset=UTF-8
|
||
Content-Transfer-Encoding: quoted-printable
|
||
|
||
bazel-zig-cc/patches/.build.yml: FAILED in 14m1s
|
||
|
||
[Upgrade to Bazel 5.1.0 and associated cleanups][0] from [~kmicklas][1]
|
||
|
||
[0]: https://lists.sr.ht/~motiejus/bazel-zig-cc/patches/30549
|
||
[1]: mailto:git@kmicklas.com
|
||
|
||
=E2=9C=97 #722785 FAILED bazel-zig-cc/patches/.build.yml https://builds.sr.=
|
||
ht/~motiejus/job/722785
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-lf1-f42.google.com (mail-lf1-f42.google.com [209.85.167.42])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id 2AE3F11EEFB
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Sat, 26 Mar 2022 14:06:40 +0000 (UTC)
|
||
Received: by mail-lf1-f42.google.com with SMTP id bu29so17829100lfb.0
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Sat, 26 Mar 2022 07:06:40 -0700 (PDT)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=sender:date:from:to:cc:subject:message-id:references:mime-version
|
||
:content-disposition:in-reply-to;
|
||
bh=Pjp+gqfwJjtlGbhG+5IobsfAGPuvy8DjKMfMfW3ADko=;
|
||
b=RI7sHW8r7FyGW0vbk3qyqAq3MuUjawc9/2p29i3aZxM87nfsYuD62WXN5evfRFez2t
|
||
NfhZhLLpXh7WEHvD5DJYsMJQ5/w9q+JPs+M/Px9OJkRzh9LNQWIyKHax8oNw3k+yqOEv
|
||
A2KF2vD8d64ryhYW0eyeCKPNCrHNiz+xs3cxGr139Uds3+yVhFohqkuXtzSaciXbyv+d
|
||
Iv1qc5/ag2fsCHjUmaPakLmGqrH0qkxo5fCD8YNcV1K0ihH6u37dZL4vxPTgx4IZUnY1
|
||
tXHuTXZOmlFafkK7rKSQSubju4TSvh0gIkpL2k07/qEkZs826Ic2LfZ6CQ+Wp1FFPK4D
|
||
3wGA==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:sender:date:from:to:cc:subject:message-id
|
||
:references:mime-version:content-disposition:in-reply-to;
|
||
bh=Pjp+gqfwJjtlGbhG+5IobsfAGPuvy8DjKMfMfW3ADko=;
|
||
b=C4Yr3Sd0roSvg87qIpO7coq1CuXnajM/v7T1MqnSSjxl2M4lYT2GiSTEXTUreffZ7D
|
||
Wrnr9o+wXrwDfm6FIg6DTuOHXJBz47j9aF5kp8DlGxSq692B62mhW4Cfs9sMslk38KxF
|
||
xIpThBrG+JoSkdrGw0uds9uutUP+/yJja/JTs9DEY/HfalnTu9IylQxAOTdOa8u8ON6y
|
||
VpyIEe1fXB14IsUwpyWfVNm6IzYf/ioDtW/DLs8AiDf/Z8qcyZO+UDaslRXn9Hx/8zHL
|
||
u3i/gaqj77fkMfkjuISHsPz/bkjYZNCoaOKY5G3LnO2poyvmSs04hffjtdPEFKQQV4nZ
|
||
UA3w==
|
||
X-Gm-Message-State: AOAM533hURPTlwQiQpKPHi6X0Pec8XKTXELjIFbPijs7YX/qsA2lhh96
|
||
mudeKBHrIAjCtXojtDPGne4=
|
||
X-Google-Smtp-Source: ABdhPJz8vo3yFz/ewrYm/4U/ieOtYJRdVogRkE0lVcRSKpjbVUEhyKlhBOQiTFQsXTSs8ANMmkPCxw==
|
||
X-Received: by 2002:a05:6512:224e:b0:44a:7bae:527f with SMTP id i14-20020a056512224e00b0044a7bae527fmr3850225lfu.322.1648303597462;
|
||
Sat, 26 Mar 2022 07:06:37 -0700 (PDT)
|
||
Received: from localhost ([88.223.105.24])
|
||
by smtp.gmail.com with ESMTPSA id q17-20020a2e8751000000b00244beaacef1sm1043982ljj.18.2022.03.26.07.06.36
|
||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||
Sat, 26 Mar 2022 07:06:36 -0700 (PDT)
|
||
Sender: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <desired.mta@gmail.com>
|
||
Date: Sat, 26 Mar 2022 16:06:35 +0200
|
||
From: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
To: ~kmicklas <git@kmicklas.com>
|
||
Cc: ~motiejus/bazel-zig-cc@lists.sr.ht, kmicklas@uber.com
|
||
Subject: Re: [PATCH bazel-zig-cc 4/4] Pin Go SDK to 1.18 for reproducibility
|
||
Message-ID: <20220326140635.yhzoo74n2gudaihk@mtpad.i.jakstys.lt>
|
||
References: <164822362548.25319.8453123527885867890-0@git.sr.ht>
|
||
<164822362548.25319.8453123527885867890-4@git.sr.ht>
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=utf-8
|
||
Content-Disposition: inline
|
||
In-Reply-To: <164822362548.25319.8453123527885867890-4@git.sr.ht>
|
||
|
||
On Fri, Mar 25, 2022 at 11:47:10AM -0400, ~kmicklas wrote:
|
||
> From: Ken Micklas <kmicklas@uber.com>
|
||
>
|
||
> ---
|
||
> WORKSPACE | 2 +-
|
||
> 1 file changed, 1 insertion(+), 1 deletion(-)
|
||
>
|
||
> diff --git a/WORKSPACE b/WORKSPACE
|
||
> index eeb098a..0aff5db 100644
|
||
> --- a/WORKSPACE
|
||
> +++ b/WORKSPACE
|
||
> @@ -28,7 +28,7 @@ load("@bazel_gazelle//:deps.bzl", "gazelle_dependencies")
|
||
> go_rules_dependencies()
|
||
>
|
||
> # use latest stable.
|
||
> -go_download_sdk(name = "go_sdk")
|
||
> +go_download_sdk(name = "go_sdk", version = "1.18")
|
||
|
||
I was on the edge about this myself, since that would require us to
|
||
upgrade it with every go version, even patch ones. But I guess you're
|
||
right, leaving it like this for reproducibility.
|
||
|
||
Motiejus
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=pass header.d=gmail.com header.i=@gmail.com
|
||
Received: from mail-lj1-f174.google.com (mail-lj1-f174.google.com [209.85.208.174])
|
||
by mail-b.sr.ht (Postfix) with ESMTPS id 942C011EEFB
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Sat, 26 Mar 2022 14:07:22 +0000 (UTC)
|
||
Received: by mail-lj1-f174.google.com with SMTP id g24so13600550lja.7
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Sat, 26 Mar 2022 07:07:22 -0700 (PDT)
|
||
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=gmail.com; s=20210112;
|
||
h=sender:date:from:to:cc:subject:message-id:references:mime-version
|
||
:content-disposition:in-reply-to;
|
||
bh=skzF2rzi5tynBle2oTMXjUWcWv4l0MA2+RTOPpkNpPM=;
|
||
b=GZ5rcUtXhyF0l2l1SEFkrIH4P9N+zQTGl+HTbUxhaDXriIWpkKIBg+yyl2L4pHnfe9
|
||
tEGxxjFItRJr2362cUOhjeepUZQccgruWISJdojLDpP/MKVnJF9Dbcz37lvgwzlZDhGT
|
||
v3H8UVUadD1VcSBm5Wil0svCKqtmgZ49WJ6JAlY07LJqAN5O/JMZKXLG6aBvr4bP0OqI
|
||
+lQRPdyCrpFPU8hSAhzVFW3TpSWqv/vpQhUeiIckZaaaig+iONeOHggcWUsouNhVVPlE
|
||
eXGXLilT79UYbJUlMjMoppfy8NIHlVfnf4QLP462YF1aEjWp79hKUZhPjOc9zCAXhuPl
|
||
2uug==
|
||
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
|
||
d=1e100.net; s=20210112;
|
||
h=x-gm-message-state:sender:date:from:to:cc:subject:message-id
|
||
:references:mime-version:content-disposition:in-reply-to;
|
||
bh=skzF2rzi5tynBle2oTMXjUWcWv4l0MA2+RTOPpkNpPM=;
|
||
b=cQGHnNmkyoRITbX37Kh4Xk+F1Hrwgas32m+irYiGC0GnHc9ETWxeTBIK6I0SctgYYL
|
||
CqvJmahfPtgchqLFb2XS+MVK+M5p/55PSL1n7NIyaILIe4yF6Bfc086uGtFvdgy5LeWx
|
||
s1zJyJoakElOu+tInarcVCS0tnXa83DKoyqir64TuK1iz0Yp/Hh/f5pB1a85DD31zeS4
|
||
MXHOwY8RVNAWcRCNnQpujtC7/VEVh1xy87FSeDeCMs+PJn5KKlOn27bc1iy6/HuwZ7vr
|
||
NogutdjHUOx5MoQt4Jtu32/zv1XEOhmcyS0I5CCEM9FhN3sggvj7DNUwFM0kdj6mP1c8
|
||
ZOeQ==
|
||
X-Gm-Message-State: AOAM530ltYKvJutOC++bK2hnktHvvRWxnaa5Ql87dRHhMFOLflj9+qkz
|
||
1aN/+FXRivw/AYqj/BRkEXXjHqv+br0=
|
||
X-Google-Smtp-Source: ABdhPJymq04BSTzfJpVHdZ+laiZbzglDSEIbJnE2fdBBOkR9NviuD4mebDzB5lu2c+1zY8w4/rSv9g==
|
||
X-Received: by 2002:a2e:a58c:0:b0:249:b1ce:ba97 with SMTP id m12-20020a2ea58c000000b00249b1ceba97mr9423600ljp.78.1648303638993;
|
||
Sat, 26 Mar 2022 07:07:18 -0700 (PDT)
|
||
Received: from localhost ([88.223.105.24])
|
||
by smtp.gmail.com with ESMTPSA id d6-20020a193846000000b0044a589efadbsm1075763lfj.2.2022.03.26.07.07.18
|
||
(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);
|
||
Sat, 26 Mar 2022 07:07:18 -0700 (PDT)
|
||
Sender: =?UTF-8?Q?Motiejus_Jak=C5=A1tys?= <desired.mta@gmail.com>
|
||
Date: Sat, 26 Mar 2022 16:07:17 +0200
|
||
From: Motiejus =?utf-8?Q?Jak=C5=A1tys?= <motiejus@jakstys.lt>
|
||
To: ~kmicklas <git@kmicklas.com>
|
||
Cc: ~motiejus/bazel-zig-cc@lists.sr.ht, kmicklas@uber.com
|
||
Subject: Re: [PATCH bazel-zig-cc 0/4] Upgrade to Bazel 5.1.0 and associated
|
||
cleanups
|
||
Message-ID: <20220326140717.oep2mxniosjzzetg@mtpad.i.jakstys.lt>
|
||
References: <164822362548.25319.8453123527885867890-0@git.sr.ht>
|
||
MIME-Version: 1.0
|
||
Content-Type: text/plain; charset=utf-8
|
||
Content-Disposition: inline
|
||
In-Reply-To: <164822362548.25319.8453123527885867890-0@git.sr.ht>
|
||
|
||
On Fri, Mar 25, 2022 at 03:53:45PM +0000, ~kmicklas wrote:
|
||
> Also pins the Go SDK version.
|
||
>
|
||
> Ken Micklas (4):
|
||
> Upgrade to Bazel 5.1.0
|
||
> Remove repo fetch-time uname dependency, use new os.arch instead
|
||
> Use upstream read_user_netrc from Bazel 5.1
|
||
> Pin Go SDK to 1.18 for reproducibility
|
||
|
||
Thanks, applied all of them (+buildifier). Do you want me to cut v0.5.1?
|
||
|
||
Motiejus
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=none
|
||
Received: from git.sr.ht (unknown [173.195.146.142])
|
||
by mail-b.sr.ht (Postfix) with ESMTPSA id 150F811EF0D
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Thu, 7 Apr 2022 09:37:53 +0000 (UTC)
|
||
From: ~laurynasl <laurynasl@git.sr.ht>
|
||
Date: Thu, 07 Apr 2022 09:37:52 +0000
|
||
Subject: [PATCH bazel-zig-cc 0/4] Move platforms and toolchains
|
||
MIME-Version: 1.0
|
||
Message-ID: <164932427279.26543.1789507091630612744-0@git.sr.ht>
|
||
X-Mailer: git.sr.ht
|
||
Reply-to: ~laurynasl <laurynasl@uber.com>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Content-Type: text/plain; charset="utf-8"
|
||
Content-Transfer-Encoding: 7bit
|
||
|
||
Move platform and toochains definitions into their own "namespaces".
|
||
|
||
laurynasl (4):
|
||
move platforms under @zig_cc//platform:
|
||
Move declare_platforms() to platform/
|
||
Move toolchainss under @zig_sdk//platform:
|
||
Move toolchain definitions to toolchains/
|
||
|
||
.bazelrc | 8 +-
|
||
README.md | 27 +--
|
||
ci/test | 4 +-
|
||
toolchain/BUILD.sdk.bazel | 5 +-
|
||
toolchain/defs.bzl | 244 +++-------------------------
|
||
toolchain/platform/BUILD | 3 +
|
||
toolchain/platform/defs.bzl | 17 ++
|
||
toolchain/private/BUILD | 0
|
||
toolchain/private/defs.bzl | 124 ++++++++++++++
|
||
toolchain/toolchain/BUILD | 0
|
||
toolchain/toolchain/BUILD.sdk.bazel | 10 ++
|
||
toolchain/toolchain/defs.bzl | 87 ++++++++++
|
||
12 files changed, 277 insertions(+), 252 deletions(-)
|
||
create mode 100644 toolchain/platform/BUILD
|
||
create mode 100644 toolchain/platform/defs.bzl
|
||
create mode 100644 toolchain/private/BUILD
|
||
create mode 100644 toolchain/private/defs.bzl
|
||
create mode 100644 toolchain/toolchain/BUILD
|
||
create mode 100644 toolchain/toolchain/BUILD.sdk.bazel
|
||
create mode 100644 toolchain/toolchain/defs.bzl
|
||
|
||
--
|
||
2.34.1
|
||
|
||
From MAILER-DAEMON Mon Apr 24 14:05:40 2023
|
||
Authentication-Results: mail-b.sr.ht; dkim=none
|
||
Received: from git.sr.ht (unknown [173.195.146.142])
|
||
by mail-b.sr.ht (Postfix) with ESMTPSA id 30F8411EF31
|
||
for <~motiejus/bazel-zig-cc@lists.sr.ht>; Thu, 7 Apr 2022 09:37:53 +0000 (UTC)
|
||
From: ~laurynasl <laurynasl@git.sr.ht>
|
||
Date: Wed, 06 Apr 2022 19:16:53 +0000
|
||
Subject: [PATCH bazel-zig-cc 1/4] move platforms under @zig_cc//platform:
|
||
Message-ID: <164932427279.26543.1789507091630612744-1@git.sr.ht>
|
||
X-Mailer: git.sr.ht
|
||
Reply-to: ~laurynasl <laurynasl@uber.com>
|
||
In-Reply-To: <164932427279.26543.1789507091630612744-0@git.sr.ht>
|
||
To: ~motiejus/bazel-zig-cc@lists.sr.ht
|
||
Content-Type: text/plain; charset="utf-8"
|
||
Content-Transfer-Encoding: quoted-printable
|
||
MIME-Version: 1.0
|
||
|
||
From: laurynasl <laurynasl@uber.com>
|
||
|
||
---
|
||
README.md | 9 +++------
|
||
ci/test | 2 +-
|
||
toolchain/defs.bzl | 10 ++++++++--
|
||
toolchain/platform/BUILD | 3 +++
|
||
4 files changed, 15 insertions(+), 9 deletions(-)
|
||
create mode 100644 toolchain/platform/BUILD
|
||
|
||
diff --git a/README.md b/README.md
|
||
index 1c8e011..d855c78 100644
|
||
--- a/README.md
|
||
+++ b/README.md
|
||
@@ -114,9 +114,6 @@ The path to Bazel toolchains is `@zig_sdk//:<toolchain>_t=
|
||
oolchain`. It should
|
||
be moved to `@zig_sdk//toolchain:<toolchain>` or similar; so the user-facing
|
||
targets are in their own namespace.
|
||
=20
|
||
-Likewise, platforms are `@zig_sdk//:<platform>_platform`, and should be moved
|
||
-to `@zig_sdk//:platform:<platform>`.
|
||
-
|
||