DPDK patches and discussions
 help / color / mirror / Atom feed
From: Dariusz Sosnowski <dsosnowski@nvidia.com>
To: Gregory Etelson <getelson@nvidia.com>
Cc: <bruce.richardson@intel.com>, <dev@dpdk.org>,
	<mkashani@nvidia.com>, <thomas@monjalon.net>,
	<harry.van.haaren@intel.com>, <igootorov@gmail.com>,
	<stephen@networkplumber.org>
Subject: Re: [PATCH v3] rust: support raw DPDK API
Date: Tue, 18 Mar 2025 10:12:40 +0100	[thread overview]
Message-ID: <20250318091240.hou7mwcjexlqlgqi@ds-vm-debian.local> (raw)
In-Reply-To: <20250318084723.qb53zqp4yelscdgy@ds-vm-debian.local>

On Tue, Mar 18, 2025 at 09:51:05AM +0100, Dariusz Sosnowski wrote:
> > +use std::process::Command;
> > +
> > +pub fn main() {
> > +    let mut pkgconfig = Command::new("pkg-config");
> > +
> > +    match pkgconfig.args(["--libs", "libdpdk"]).output() {
> > +        Ok(output) => {
> > +            let stdout = String::from_utf8_lossy(&output.stdout)
> > +                .trim_end()
> > +                .to_string();
> > +            for token in stdout.split_ascii_whitespace().filter(|s| !s.is_empty()) {
> > +                if token.starts_with("-L") {
> > +                    println!("cargo::rustc-link-search=native={}", &token[2..]);
> > +                } else if token.starts_with("-l") {
> > +                    println!("cargo::rustc-link-lib={}", &token[2..]);
> > +                }
> > +            }
> > +            println!("cargo:rerun-if-changed=build.rs");
> > +        }
> > +        Err(error) => {
> > +            panic!("failed to read libdpdk package: {:?}", error);
> > +        }
> > +    }
> > +}
> 
> 
> What do you think about using pkg_config crate in build scripts?
> (https://crates.io/crates/pkg-config)
> 
> This would allow to remove manual command execution and output parsing with the following:
> 
> 	fn main() {
> 	  pkg_config::probe_library("libdpdk").expect("Unable to find libdpdk");
> 	}
> 
> Also, what do you think about moving this logic to dpdk crate?
> This way dependency resolution would be shared by all examples/applications
> which use the dpdk crate.

I just noticed that similar proposal was raised by Harry previously.
Sorry for the duplication :)

      reply	other threads:[~2025-03-18  9:13 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-06 13:37 [PATCH] rust: support " Gregory Etelson
2025-03-06 19:26 ` Van Haaren, Harry
2025-03-07 16:56   ` Etelson, Gregory
2025-03-07 15:54 ` Van Haaren, Harry
2025-03-07 16:20   ` Bruce Richardson
2025-03-07 18:15     ` Etelson, Gregory
2025-03-07 18:00   ` Etelson, Gregory
2025-03-08 14:28 ` Igor Gutorov
2025-03-08 19:14   ` Etelson, Gregory
2025-03-10 15:31     ` Stephen Hemminger
2025-03-12  5:21       ` Etelson, Gregory
2025-03-08 18:50 ` [PATCH v2] rust: support raw " Gregory Etelson
2025-03-10 16:13   ` Van Haaren, Harry
2025-03-10 16:25     ` Bruce Richardson
2025-03-12 17:19       ` Thomas Monjalon
2025-03-14 19:12     ` Etelson, Gregory
2025-03-10 15:00 ` [PATCH] rust: support " Stephen Hemminger
2025-03-12  5:12   ` Etelson, Gregory
2025-03-10 16:18 ` Stephen Hemminger
2025-03-10 16:30   ` Bruce Richardson
2025-03-12 14:30   ` Etelson, Gregory
2025-03-13  7:56     ` Igor Gutorov
2025-03-12 15:29   ` Igor Gutorov
2025-03-12 17:24     ` Thomas Monjalon
2025-03-14 18:38 ` [PATCH v3] rust: support raw " Gregory Etelson
2025-03-18  8:51   ` Dariusz Sosnowski
2025-03-18  9:12     ` Dariusz Sosnowski [this message]

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=20250318091240.hou7mwcjexlqlgqi@ds-vm-debian.local \
    --to=dsosnowski@nvidia.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=getelson@nvidia.com \
    --cc=harry.van.haaren@intel.com \
    --cc=igootorov@gmail.com \
    --cc=mkashani@nvidia.com \
    --cc=stephen@networkplumber.org \
    --cc=thomas@monjalon.net \
    /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).