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 5B7CF3881D37 for ; Tue, 7 Nov 2023 10:25:01 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5B7CF3881D37 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 5B7CF3881D37 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699352702; cv=none; b=Fu9EhiT7w/RX2hWSk8P+c0C70ifZY/+F+BMEktOJBeDRyC9ypcJ9RXB9zHgqNtEMpSO51bVlJxlLq/koz9iVu+XL3V6t3hWSzACqvzT8ekZWXJJDVJ5rBoWSC7XF/qbEsD4i+QDdyk4xpM5bfBfAHcW+NJ0i83PgXbUFb8JEE/8= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1699352702; c=relaxed/simple; bh=OrmGMk+BZe62EOepwgz2+KB17QJiG0w2d7wq3GfXR6k=; h=DKIM-Signature:MIME-Version:From:Date:Message-ID:Subject:To; b=YLbmovYU4h7m1z547CvGwv8+aWCki4J91TPHUJq93v89DVRujZv1khA+cNXCNvp5Trtb9sEsj5SVoWdO3KI8OtXR7wB9RUOjXuxlBEmq0OwltF3r+frru1nZtHyYMSMe8uzK6zPqC+GRtxoEVRSzTWVzfAAxsmEnpwSiXUcHD6Q= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1699352700; 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=/iednHXT2baar7MWZuTcSapugVgQbRZ1D/f138nrCnk=; b=flNalrIj8Aea6oq2YfJHSACyOdmXuXbrLZDsaomEuAO+W4dvJQ0mVszM8lzhSF7YOmgBC6 LvH3apAjsIPphXMjXIkiUzbUQiPgErnWIGAjdzy8Hw1xArZD5eVXjVv2RJMKYfuWxWJoGb 4/n1bJt5Y7BSjYjwltYdCTKQe5RjX1s= Received: from mail-yb1-f200.google.com (mail-yb1-f200.google.com [209.85.219.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-605-pZ7tMaO8N02UFWFsxF1V5A-1; Tue, 07 Nov 2023 05:24:59 -0500 X-MC-Unique: pZ7tMaO8N02UFWFsxF1V5A-1 Received: by mail-yb1-f200.google.com with SMTP id 3f1490d57ef6-da03c5ae220so5160977276.1 for ; Tue, 07 Nov 2023 02:24:59 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1699352699; x=1699957499; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=/iednHXT2baar7MWZuTcSapugVgQbRZ1D/f138nrCnk=; b=ZcOzadK8QBdcV/GfWNILkniT6tIzp/LkVOmsDCyv0JmnG5ryF9UkF3kR+kHKyKQDAe Y1NfoI58pBzOZLSigYDEe6Bph0bkpr6WJ7k9zj+CG42fXHgqvIUirYo200WWZCZFsPeF JlhiMm9dWrl2yRR5qZYEWzTBvgaIyjIYKAWcUoMqxnqTxlrHcYobPOsPsa58Ww9KPt84 /LH/FmusO3VfIbdTcQB4Mm7Jsits4Rv/pqarrOlLFSRqtygX+phCgb838XtfprfaQeNt /Fyw/Z1L09Eg9u7nOu5ODW1vkceCJH8+sUjmsXUPMA4SHh3Nv6EkHbF3ka/SgB1vI+p3 X8kA== X-Gm-Message-State: AOJu0YwcxP1Obb+y4WRKQf5+oHaOzCdWqvYhrdnVgggLrODFWMWvKzg/ jHnClPfhdlTycQnjHKj2FOYOc/N7aOylFrAlpq/J176ei/s2unOH+cQsjl7Evy5xJjAPbo0nsfY flHqJ8+fRXis9vh0dcyPyUdxsn7eFEYTVlg== X-Received: by 2002:a25:b4f:0:b0:d9a:b844:a16 with SMTP id 76-20020a250b4f000000b00d9ab8440a16mr1591546ybl.16.1699352698933; Tue, 07 Nov 2023 02:24:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IHHQFULPTjVeJ2A2mzQ7pW/fac8HEIVi42WupsL3mOh//pya10ZnKTJPWMa461ijd1D60nU+k9eb2nPj1FIqpw= X-Received: by 2002:a25:b4f:0:b0:d9a:b844:a16 with SMTP id 76-20020a250b4f000000b00d9ab8440a16mr1591540ybl.16.1699352698678; Tue, 07 Nov 2023 02:24:58 -0800 (PST) MIME-Version: 1.0 References: <600FDF8F-67C5-408F-BD24-9A3964A8BFA1@comcast.net> In-Reply-To: From: Jonathan Wakely Date: Tue, 7 Nov 2023 10:24:47 +0000 Message-ID: Subject: Re: testsuite: introduce hostedlib effective target To: Alexandre Oliva Cc: Mike Stump , gcc-patches@gcc.gnu.org, Rainer Orth , libstdc++@gcc.gnu.org, =?UTF-8?Q?Arsen_Arsenovi=C4=87?= X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP,T_SCC_BODY_TEXT_LINE 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: On Tue, 7 Nov 2023 at 10:18, Jonathan Wakely wrote: > > On Tue, 7 Nov 2023 at 10:04, Alexandre Oliva wrote: > > > > [adding libstdc++@] > > > > On Nov 5, 2023, Mike Stump wrote: > > > > > Ick. > > > > Indeed ;-) > > > > > I wish there were fewer changed lines and not 1 per test > > > case. It feels like we've painted ourselves into a corner. > > > > The libstdc++ testsuite took a different approach, detecting missing > > headers (and libraries?) at error pruning time, and xfailing the tests, > > which seems to be more in line with what you are looking for. > > > > That approach, though more expedient, seems more fragile to me, in that > > an actual bug that caused headers to go missing would cause tests to be > > silently skipped rather than fail. > > I don't think we XFAIL based on missing headers. We XFAIL based on a > specific #error message in certain headers. > > If a header goes missing, we'll still XFAIL. > > > > > I expect the set of headers, and thus of affected tests, won't by very > > dynamic, so it's kind of a one-shot change. > > > > Of course new tests might be added that rely on such headers, and would > > likely go unnoticed until someone tries them on a non-hosted libstdc++. > > Since GCC 13 you don't need to build a non-hosted libstdc++ to test > it, you can just add -ffreestanding to the runtestflags. > > > We could alleviate this if libstdc++ headers that are not installed on > > hosted systems issued a warning (conditional on some macro defined by > > the testsuite, say -D_GLIBCXX_WARN_HOSTED_ONLY). > > That's exactly what happens (except #error not #warning) when you > compile with -ffreestanding. > > > For tests aimed > > exclusively at hosted libstdc++, we'd then use a dg directive that both > > implied this requirement, and changed the macro definition to suppress > > the warning. Then anyone who added a testcase that included hosted > > headers without indicating its hostedlib requirement would get a fail > > even when testing with a hosted libstdc++. > > I don't think we need to add checks for a new macro and then use that > when testing, you can just test with -ffreestanding instead. This > already works today. Ah, reading back in the thread for the context I missed, I see that you're specifically testing a --disable-hosted-libstdcxx build. In that case some headers really will be absent, not just present-with-#error. But I am still not concerned about failing to notice if a header goes unintentionally missing, because the libstdc++ testsuite will still notice that. We don't prune based on "no such header" errors, so would still get FAILs for those tests that depend on headers which are supposed to be present for freestanding.