From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id BDFD0A09E4; Thu, 28 Jan 2021 11:55:52 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 490354067A; Thu, 28 Jan 2021 11:55:52 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [63.128.21.124]) by mails.dpdk.org (Postfix) with ESMTP id 6FA0040395 for ; Thu, 28 Jan 2021 11:55:50 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1611831349; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yzkqLfftL6hDK9LJB25gqvhpE1SqZxpbM9ZZNxW4fuI=; b=XpnJT5/aOX7WSERWMARekLIGk2ktSOqMZEyTE9nYuodzsoV9OesgdxBFI/oClcpcNiQgH1 EgTSVOP7lPgkKK5czlWt4+ZhMSMtQHEJzXxyAvxLDUM0kHIVz6no+bnc3YQqHWUGVasR+I 4NSecozDzIUuAEqH0Bw+14kt7ykLcE4= Received: from mail-ua1-f71.google.com (mail-ua1-f71.google.com [209.85.222.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-320-TnyfWadtNPCHFLVrkEmBng-1; Thu, 28 Jan 2021 05:55:46 -0500 X-MC-Unique: TnyfWadtNPCHFLVrkEmBng-1 Received: by mail-ua1-f71.google.com with SMTP id a33so1378236uae.7 for ; Thu, 28 Jan 2021 02:55:46 -0800 (PST) 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; bh=yzkqLfftL6hDK9LJB25gqvhpE1SqZxpbM9ZZNxW4fuI=; b=JpSNqhV5zS0JgRcRbIaV+/fnuiA24fTABdnPgBLYa9h+uqKKhjAln+i2rVkO6bfEpF AUveQWCr8fh6VWHWYKCn/lVucVR3V0eN4s0enbK8XhniBPAnmeDvtiSCVUo3ENcrYtMv kcFW/lgeCZ0j53zt+UPn7+8BwulVhEQplhKk0K1M7dtAg8n16INl7NPkf8tnoYi1awTP m3NNRdaxGmibDKHlDDZTYpGvB1yedT/QzcqvQH9WTKcjWPKoj3v9Qk3c0K0j61ds4bve cuzGgO6Bs+0NwSPPJhhaFcxxGykiD3GQ1MX/8B/0I020nQXZDuF3DYJmaTLhacJ4uBHK ZYUQ== X-Gm-Message-State: AOAM532/pcLJGPdNHB/pzAryMUprNkCVx/fCBtOIl4bEWqJL76V7znMA e0g+wXXw2txYMDFmhz+pJqtlGwHdhqqZgaONmcUxuOul83tu7Hnfd0HZZsWhotlkALsOG6+ZBC9 qgxeTqH1KhbhqjbA40NQ= X-Received: by 2002:a67:3093:: with SMTP id w141mr10737018vsw.27.1611831346369; Thu, 28 Jan 2021 02:55:46 -0800 (PST) X-Google-Smtp-Source: ABdhPJy6zmnBCVsPFPPwCDSv/bLpxGXjnsqjynb+yR/7M3l+AqsSB+0N47dygs8fiEVPQzxEUjbZIl9Kz8p61d5Di0M= X-Received: by 2002:a67:3093:: with SMTP id w141mr10737003vsw.27.1611831345981; Thu, 28 Jan 2021 02:55:45 -0800 (PST) MIME-Version: 1.0 References: <20210114110606.21142-1-bruce.richardson@intel.com> <20210127173330.1671341-1-bruce.richardson@intel.com> In-Reply-To: <20210127173330.1671341-1-bruce.richardson@intel.com> From: David Marchand Date: Thu, 28 Jan 2021 11:55:34 +0100 Message-ID: To: Bruce Richardson Cc: dev , Thomas Monjalon , Ray Kinsella Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dmarchan@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Subject: Re: [dpdk-dev] [PATCH v6 0/8] add checking of header includes X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On Wed, Jan 27, 2021 at 6:33 PM Bruce Richardson wrote: > > As a general principle, each header file should include any other > headers it needs to provide data type definitions or macros. For > example, any header using the uintX_t types in structures or function > prototypes should include "stdint.h" to provide those type definitions. > > In practice, while many, but not all, headers in DPDK did include all > necessary headers, it was never actually checked that each header could > be included in a C file and compiled without having any compiler errors > about missing definitions. The script "check-includes.sh" could be used > for this job, but it was not called out in the documentation, so many > contributors may not have been aware of it's existance. It also was > difficult to run from a source-code directory, as the script did not > automatically allow finding of headers from one DPDK library directory > to another [this was probably based on running it on a build created by > the "make" build system, where all headers were in a single directory]. > To attempt to have a build-system integrated replacement, this patchset > adds a "chkincs" app in the buildtools directory to verify this on an > ongoing basis. > > This chkincs app does nothing when run, and is not installed as part of > a DPDK "ninja install", it's for build-time checking only. Its source > code consists of one C file per public DPDK header, where that C file > contains nothing except an include for that header. Therefore, if any > header is added to the lib folder which fails to compile when included > alone, the build of chkincs will fail with a suitable error message. > Since this compile checking is not needed on most builds of DPDK, the > building of chkincs is disabled by default, but can be enabled by the > "test_includes" meson option. To catch errors with patch submissions, > the final patch of this series enables it for a single build in > test-meson-builds script. > > Future work could involve doing similar checks on headers for C++ > compatibility, which was something done by the check-includes.sh script > but which is missing here. > > V6: > * Added release notes updates for: > - renamed, no-longer-installed header files > - new "check_includes" build option > - removal of old check_includes script > * Included acks from previous versions I have some comments, see replies on patches. I can address them if you are ok, and I would take this series for -rc2 without needing a respin. Sidenote: I like how we are hiding API by simply not exporting headers. We need more cleanups like this. Ethdev has been cleaned; this will probably remove the need for the ABI exception on eth_dev_ops. Eventdev, other driver classes and bus drivers will probably be the next to look at. -- David Marchand