linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
To: Bartosz Golaszewski <brgl@bgdev.pl>,
	Erik Schilling <erik.schilling@linaro.org>
Cc: Linux-GPIO <linux-gpio@vger.kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Manos Pitsidianakis <manos.pitsidianakis@linaro.org>,
	Kent Gibson <warthog618@gmail.com>,
	Phil Howard <phil@gadgetoid.com>
Subject: Re: [libgpiod][PATCH 0/2] bindings: rust: feature gate unreleased features
Date: Mon, 09 Oct 2023 17:39:54 +0300	[thread overview]
Message-ID: <29nnq.9lre8l3k31x@linaro.org> (raw)
In-Reply-To: <CAMRc=McUJ+4gJNGJ=UfBJk980BQ3Swk=kE7rjrfoKJP_0MimGg@mail.gmail.com>

On Mon, 09 Oct 2023 17:32, Bartosz Golaszewski <brgl@bgdev.pl> wrote:
>I'm Cc'ing Phil Howard who's the developer behind the Python bindings 
>work.
>
>In Phil's WiP branch[1] that should soon be posted to this list the
>autotools flow is entirely omitted and building of the libgpiod C
>sources happens in setup.py directly. Can cargo compile C sources like
>that?

The rust compiler team maintains a library for that:

https://crates.io/crates/cc

You can find examples of it in use in many popular rust crates, like 
when building the openssl crate https://docs.rs/openssl/latest/openssl/ 
with the `vendored` feature, it uses the following build-time dependency 
to build the static librarie:

https://github.com/alexcrichton/openssl-src-rs/tree/main

There is no general need to put the vendoring code in a build-time 
dependency by the way, it can be done in in the bindings crate's 
build.rs as well.

>
>I'm not sure how that would work honestly. The stable branches in
>libgpiod are per libgpiod minor release. This doesn't map onto rust
>releases anymore with decoupled versioning. Maybe rust should get its
>own tags in the repo (on the master branch for major and minor
>releases) and its own stable branches?

In cases Rust crates want to support multiple releases, the usual route 
is to expose different bindings per release exposed via feature flags.

I can't say if that makes sense for libgpiod though, because I'm not 
familiar that much.

Manos

  reply	other threads:[~2023-10-09 14:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06  7:24 [libgpiod][PATCH 0/2] bindings: rust: feature gate unreleased features Erik Schilling
2023-10-06  7:24 ` [libgpiod][PATCH 1/2] " Erik Schilling
2023-10-06  9:25   ` Viresh Kumar
2023-10-06  7:24 ` [libgpiod][PATCH 2/2] DONOTMERGE: bindings: rust: simulate v2.1 release Erik Schilling
2023-10-09  8:58 ` [libgpiod][PATCH 0/2] bindings: rust: feature gate unreleased features Bartosz Golaszewski
2023-10-09 11:38   ` Erik Schilling
2023-10-09 12:43     ` Bartosz Golaszewski
2023-10-09 14:16       ` Erik Schilling
2023-10-09 14:32         ` Bartosz Golaszewski
2023-10-09 14:39           ` Manos Pitsidianakis [this message]
2023-10-09 15:21             ` Erik Schilling
2023-10-10  6:55               ` Bartosz Golaszewski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=29nnq.9lre8l3k31x@linaro.org \
    --to=manos.pitsidianakis@linaro.org \
    --cc=brgl@bgdev.pl \
    --cc=erik.schilling@linaro.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=phil@gadgetoid.com \
    --cc=viresh.kumar@linaro.org \
    --cc=warthog618@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).