From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id 1B6AB3847718 for ; Wed, 3 Apr 2024 14:37:04 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 1B6AB3847718 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 1B6AB3847718 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712155026; cv=none; b=YJw7KXIwuQ0fdUeTsrnD78gqYFU5k9L8cqZpnyejzMF0kShtwo17o4zkcNKTUNewTf8RqDkMBd1vM2LL4u7MZTDsv0gQ+QxaJDsUWYyMb+bVEPAA61885U+Jta+RpFrJ4sq9x7fSa312nJ0OxI1PwNgyZUbpIls7+ubR3C1IaCU= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1712155026; c=relaxed/simple; bh=nkVT0PnMtQ95epr+FEtgqc2YGy55syk6zxFV0W/Tg1w=; h=DKIM-Signature:DKIM-Signature:Message-ID:Date:MIME-Version: Subject:To:From; b=ILJXnzujGrmvh9Vsz6Z5dNuQd62nFBI1zbuVWlahR0XUGfoaYi7Mi4tUjyAhI4AHSM7saPG4LBgyB5i/h0vldqrB5ZHIYG/xauSulwzzPKcqPLGrG6CC8OzsBZ7dZs/9TLThq0J42Omwr/cTU/mOJW3ak+HgnNdmNQoVlj4ghCg= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap2.dmz-prg2.suse.org (imap2.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:98]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 07AA55CD91; Wed, 3 Apr 2024 14:37:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1712155023; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pIkRGplsv9NmsH4TItdGz5A7nYGKQQNl4jRO6XytrwE=; b=cc8aFxhDubIyYh3nWIXR/sedVUHJKKSOi0/0stEgRRUvcy/y1rQsMXKYVRmbQyQgeFZrNI IrAEfZF3E1kilkzKjfTZUHk4ewLKQ2/Ae7ut/W3U8dtwLbFRg9Eu/PGFCDERiYnATSWdl6 5+ZI95ZiZMlJHFzZSR6pdudlE6cpisM= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1712155023; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=pIkRGplsv9NmsH4TItdGz5A7nYGKQQNl4jRO6XytrwE=; b=KntM5GOBcQ2Zj1O7xhRXHR2zdd66/JZLht7e5yGmgOEGFY+kLnzRZ3EaHbrBt2vtWOatGB 9F/heZh8iQVq5bAQ== Authentication-Results: smtp-out2.suse.de; dkim=none Received: from imap2.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap2.dmz-prg2.suse.org (Postfix) with ESMTPS id CB66513357; Wed, 3 Apr 2024 14:37:02 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap2.dmz-prg2.suse.org with ESMTPSA id GdfdL45pDWaHYwAAn2gu4w (envelope-from ); Wed, 03 Apr 2024 14:37:02 +0000 Message-ID: Date: Wed, 3 Apr 2024 16:37:03 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] gdb/compile: Use std::filesystem::remove_all in cleanup Content-Language: en-US To: Tom Tromey , Lancelot SIX Cc: gdb-patches@sourceware.org, lsix@lancelotsix.com References: <20240303164756.870514-1-lancelot.six@amd.com> <8734t0sn8d.fsf@tromey.com> From: Tom de Vries In-Reply-To: <8734t0sn8d.fsf@tromey.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Score: -0.41 X-Spamd-Bar: / X-Spamd-Result: default: False [-0.41 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; XM_UA_NO_VERSION(0.01)[]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[]; NEURAL_HAM_SHORT(-0.20)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(2.20)[]; MIME_TRACE(0.00)[0:+]; MID_RHS_MATCH_FROM(0.00)[]; BAYES_HAM(-0.81)[84.96%]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[4]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; DBL_BLOCKED_OPENRESOLVER(0.00)[amd.com:email]; FUZZY_BLOCKED(0.00)[rspamd.com]; RCVD_IN_DNSWL_HI(-0.50)[2a07:de40:b281:104:10:150:64:98:from]; RCVD_TLS_ALL(0.00)[] X-Spam-Level: X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Rspamd-Queue-Id: 07AA55CD91 X-Spam-Status: No, score=-6.2 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_SHORT,SPF_HELO_NONE,SPF_PASS,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: On 3/8/24 17:27, Tom Tromey wrote: >>>>>> "Lancelot" == Lancelot SIX writes: > > Lancelot> In a previous review, I noticed that some code in gdb/compile/compile.c > Lancelot> could use c++17's `std::filesystem::remove_all` instead of using some > Lancelot> `system ("rm -rf ...");`. > > Lancelot> This patch implements this. > > Lancelot> Note that I use the noexcept overload of std::filesystem::remove_all and > Lancelot> explicitly check for an error code. This means that this code called > Lancelot> during the cleanup procedure cannot throw, and does not risk preventing > Lancelot> other cleanup functions to be called. > > Lancelot> Tested on x86_64-linux. > > Lancelot> Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31420 > Lancelot> Change-Id: If5668bf3e15e66c020e5c3b4fa999f861690e4cf > > Thank you. I think this is ok. > > There might be some risk that there's a compiler that implements C++17 > but not std::filesystem. If this happens I suppose we can either > consider simply rejecting that compiler, or alternatively, revert this > patch. This broke the build for me with gcc 7.5.0, which apparently falls into the category of "mostly implements C++17 but not std::filesystem". As we can see here ( https://gcc.gnu.org/gcc-8/changes.html#cxx ) support was added in gcc 8. Thanks, - Tom