From nobody Wed Sep 22 04:07:26 2021 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 909A8175B623 for ; Wed, 22 Sep 2021 04:07:45 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-oo1-f46.google.com (mail-oo1-f46.google.com [209.85.161.46]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4HDlBS4Cq2z3hh3 for ; Wed, 22 Sep 2021 04:07:44 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-oo1-f46.google.com with SMTP id i26-20020a4ad09a000000b002a9d58c24f5so488842oor.0 for ; Tue, 21 Sep 2021 21:07:44 -0700 (PDT) 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=yCL+w+yJY28kfO3RR/7GM6b5krX0OKymzhSkFbznFcU=; b=RMnkDvE5n+wb0SUHl0gRH2OGPfd51k9jeM+1B8WO/AeA0OXgUM984vmkDVb2tzzATi 3U3ukc8XWX5lLwnqxdQTA1AUqAiqp+9nsYxZ+0xbfQooMFEW7CVXQPNtEqfaWzzaNElU 3qEwnCQgdF3DihMvbxsp4dxZNdOcd2v6BrkLinTFUhzaR4bNDTMwvfVH73N/C21mgoRf lPo6IaOF9Dg7JGkpnbctzgQcoXf1g+Fq0M1p3oFK0spuQFE3JtdfU71EdYw8fboOy91Z r+jC6Yoa+AbwmLUh+hFyc+cNYKZ0TCW095khvO2/wFrtyzw+RefLCYx5wbeRy+3KAxi/ SUnA== X-Gm-Message-State: AOAM531sc3y70EM3WyiiPOjlc6ezKTMEez3bhSBnwafvXBsrTsVPJ1xK u7EkDSljXM/fq5NEAxX/NUCfOT+fErqzvFUaEsMwebcuQzo= X-Google-Smtp-Source: ABdhPJwd6uXf2A1eJQhFvX26LEoSn0YKO30b+yC3BmBA3ubie9uqSRCR8zgH+oc1kYd/1BGV2GH3qBzrIbgCp9l3dlQ= X-Received: by 2002:a4a:954c:: with SMTP id n12mr27346950ooi.12.1632283657799; Tue, 21 Sep 2021 21:07:37 -0700 (PDT) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 From: Alan Somers Date: Tue, 21 Sep 2021 22:07:26 -0600 Message-ID: Subject: Using modern APIs in Rust on FreeBSD To: FreeBSD CURRENT Content-Type: multipart/alternative; boundary="000000000000988dc205cc8da716" X-Rspamd-Queue-Id: 4HDlBS4Cq2z3hh3 X-Spamd-Bar: / Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of asomers@gmail.com designates 209.85.161.46 as permitted sender) smtp.mailfrom=asomers@gmail.com X-Spamd-Result: default: False [-0.92 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-0.92)[-0.915]; RCVD_COUNT_TWO(0.00)[2]; FREEFALL_USER(0.00)[asomers]; FROM_HAS_DN(0.00)[]; RWL_MAILSPIKE_GOOD(0.00)[209.85.161.46:from]; R_SPF_ALLOW(-0.20)[+ip4:209.85.128.0/17:c]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; DMARC_NA(0.00)[freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; NEURAL_HAM_LONG(-1.00)[-1.000]; TO_DN_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_IN_DNSWL_NONE(0.00)[209.85.161.46:from]; NEURAL_SPAM_SHORT(1.00)[0.997]; FORGED_SENDER(0.30)[asomers@freebsd.org,asomers@gmail.com]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ASN(0.00)[asn:15169, ipnet:209.85.128.0/17, country:US]; FROM_NEQ_ENVFROM(0.00)[asomers@freebsd.org,asomers@gmail.com]; FREEMAIL_ENVFROM(0.00)[gmail.com]; TO_DOM_EQ_FROM_DOM(0.00)[] X-ThisMailContainsUnwantedMimeParts: Y --000000000000988dc205cc8da716 Content-Type: text/plain; charset="UTF-8" tldr; should the Rust ecosystem ditch FreeBSD 10 compat for new code? Rust uses FFI to talk to the OS's C library. That makes cross-compiling a breeze. Unfortunately, it also fossilizes the ABI. FreeBSD's libc makes careful use of ELF symbol versioning. That's how we were able to change ino_t to 64-bits while maintaining backwards-compatibility with old binaries, for example. But the Rust toolchain isn't able to take advantage. Right now, the toolchain uses a FreeBSD 10 ABI, and the libc crate (which virtually all crates depend on) uses a FreeBSD 11 ABI. That means, for example, that no crate can use: * The offset field in a struct dirent * 64-bit nlink_t * 64-bit ino_t * No NOTE_ABSTIME with kevent * filesystem and mountpoint names in statfs(2) limited to 88 characters Until somebody fixes that hard problem, the easy thing for Rust to do would be to drop support for EoL versions. FreeBSD 10 has been EoL for nearly 3 years, and FreeBSD 11 will be EoL in a few days. I for one think that it would be fine for new Rust toolchains and libc releases to drop support for FreeBSD 10 and 11. People who need to build for old releases can easily get old toolchains from rustup, or even from old Ports snapshots. But the Rust core developers are conservative, and don't want to upset users of a platform that many of them don't understand. Do you agree with me? If so (or even if you don't), make some noise on this Github issue! Give the Rust core team the confidence they need to move forward. https://github.com/rust-lang/rust/issues/89058 -Alan --000000000000988dc205cc8da716--