From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 5F59E3857C42 for ; Wed, 28 Sep 2022 16:59:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 5F59E3857C42 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1664384374; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=RwOilyOwzHdDK4A/e2TBtpXRv8bxoRgwa++zcIDgKP8=; b=JMmFHqvdQ1pAfMyppPUuyzWoRidu1o4luMaks7ISFOCMicfICXkpJxiXuRYaOCKdwqb0YG CMLxKxr+mNQC//sA0WFU/O5u26n+ufYkIFtKxhD84WzH7iXitzvE3hEwz7tT+x/ly0U+BR Xvw5VrDLZpXeumwVauzR44YCECaPvrE= Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-635-MQhzXrISNZyTItd0SYczVQ-1; Wed, 28 Sep 2022 12:59:32 -0400 X-MC-Unique: MQhzXrISNZyTItd0SYczVQ-1 Received: by mail-pl1-f200.google.com with SMTP id q3-20020a17090311c300b0017898180dddso8558615plh.0 for ; Wed, 28 Sep 2022 09:59:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=to:subject:message-id:date:from:in-reply-to:references:mime-version :x-gm-message-state:from:to:cc:subject:date; bh=RwOilyOwzHdDK4A/e2TBtpXRv8bxoRgwa++zcIDgKP8=; b=4LgSLRZIs0/S/XB3e4S/K3SiiYfCHePbfXHDofzbZsbf4tQAHzLi8jYy5JaEJNG8CE PTLoOc6WwV9nOj/jq8jiufXBc63y2au/DGSaAzukUt2RiZqRab+IgeYe4M7MzyHcwXh4 geiJ85GwLt+BbC/BRDxshmlbl01/9/X+4VopS4tHCqvSo3KwqiUfmB2rX5OtAosOU8A5 4qP5hf/k4ROpdlbwlluH849zUErFgnm+pHfxn5hsG0Sd3rtwMJjOBCwFLvWtWP1HIooT 2eIwuYVy1A68IKQssSMkdkM7MYNJN6DYOfEH7H0PMyHd68Al2FbJTFaGnSYLrHMpkP3y Atzg== X-Gm-Message-State: ACrzQf2jXd/xXPP98GEMDANxA5vkAZuSQoqr0qs/pnZw9QzL3WiqKH3+ SYWSezWHZBBVhEVfXYBbYm0NQntQTNEFZ+a+cPyQAq0QlEpY2/HklZEgdMa9VxU8YZ6dSTmCWzw /cbaQOd8E5SZn79N1XgF/TuYZ0hLQWd89mg== X-Received: by 2002:a17:90b:1801:b0:202:7cf6:9f93 with SMTP id lw1-20020a17090b180100b002027cf69f93mr11238234pjb.170.1664384371561; Wed, 28 Sep 2022 09:59:31 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5QuEoPHAgxYUKjkHrxkSn7gd3TNNrPBSE9MgW/ShZU1P1HrX96RGI7q62k3GKdhyopn95nrmO9++dwfVq7MiI= X-Received: by 2002:a17:90b:1801:b0:202:7cf6:9f93 with SMTP id lw1-20020a17090b180100b002027cf69f93mr11238202pjb.170.1664384371213; Wed, 28 Sep 2022 09:59:31 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Ulrich Drepper Date: Wed, 28 Sep 2022 18:59:20 +0200 Message-ID: Subject: Re: [PATCH] C++ API database To: gcc-patches@gcc.gnu.org X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: multipart/alternative; boundary="00000000000037593505e9bfaf40" X-Spam-Status: No, score=-4.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: --00000000000037593505e9bfaf40 Content-Type: text/plain; charset="UTF-8" Ping. Anyone having problems with this? And the governance of the file? On Mon, Sep 12, 2022 at 1:51 PM Ulrich Drepper wrote: > After my prior inquiry into the use of python as a build tool for > maintainers didn't produce any negative comments and several active and > even enthusiastic support message I'm going forward with submitting the > patch. > > To repeat the detail, for the generation of the upcoming C++ standard > library module and the hints for missing definitions/declarations in the > std:: namespace we need a list of standard C++ APIs. The information > needed for the two use cases is different but the actual APIs overlap > almost completely and therefore it would be a bad idea to have the data > separated. > > We could opt for a file format that is easy to read in awk and writing the > appropriate scripts to transform the data into the appropriate output > format but this looks ugly, is hard to understand, and a nightmare to > maintain. On the other hand, writing the code in Python is simple and > clean. > > > Therefore, Jonathan and I worked on a CSV file which contains the > necessary information and a Python to create the gperf input file to > generate std-name-hint.h and also, in future, the complete source of the > export interface description for the standard library module. This mode is > not yet used because the module support isn't ready yet. The output file > corresponds to the hand-coded version of the export code Jonathan uses > right now. > > Note that in both of these cases the generated files are static, they > don't depend on the local configuration and therefore are checked into the > source code repository. The script only has to run if the generated files > are explicitly removed or, in maintainer mode, if the CSV file has > changed. For normal compilation from a healthy source code tree the tool > is not needed. > > > One remaining issue is the responsibility for the CSV file. The file > needs to live in the directory of the frontend and therefore nominally > changes need to be approved by the frontend maintainers. The content > entirely consists of information from the standard library, though. Any > change that doesn't break the build on one machine (i.e., the Python script > doesn't fail) will not course any problem because the output format of the > script is correct. Therefore we have been wondering whether the CSV file > should at least have shared ownership between the frontend maintainers and > the libstdc++ maintainers. > > The CSV file contain more hint information than the old hand-coded .gperf > file. So, an additional effect of this patch is the extension of the hints > that are provided but given that the lookup is now fast this shouldn't have > any negative impact. The file is not complete, though, this will come over > time and definitely before the module support is done. > > I build my complete set of compilers with this patch without problems. > > Any comments? > > 2022-09-12 Jonathan Wakely > Ulrich Drepper > > contrib/ChangeLog > * gcc_update: Add rule to generate gcc/cp/std-name-hint.gperf. > > gcc/cp/ChangeLog > * Make-lang.in: Add rule to generate gcc/cp/std-name-hint.gperf. > Adjust rule to generate $(srcdir)/cp/std-name-hint.h. > Add explicit rule to depend cp/name-lookup.o on > $(srcdir)/cp/std-name-hint.h. > * cxxapi-data.csv: New file. Database of C++ APIs. > * gen-cxxapi-file.py: New file. Script to generate source code for > C++ standard library exports and to generate C++ std:: namespace > fix hints. > * std-name-hint.gperf: Regenerated. > * std-name-hint.h: Regenerated. > --00000000000037593505e9bfaf40--