From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andreas Rottmann Subject: Re: patch-shebang and Rust - Change on core-updates? Date: Tue, 21 Jan 2020 00:24:30 +0100 Message-ID: <87lfq1zp75.fsf@londo.h.r0tty.org> References: <20200120202814.3ad015d0@scratchpost.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:47879) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iv8AK-0002NK-NA for guix-devel@gnu.org; Fri, 24 Jan 2020 18:15:05 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iv8AJ-0006iq-OB for guix-devel@gnu.org; Fri, 24 Jan 2020 18:15:04 -0500 Received: from ciao.gmane.io ([159.69.161.202]:37054) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iv8AJ-0006fi-I1 for guix-devel@gnu.org; Fri, 24 Jan 2020 18:15:03 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1iv8AH-000TVe-Um for guix-devel@gnu.org; Sat, 25 Jan 2020 00:15:01 +0100 List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane-mx.org@gnu.org Sender: "Guix-devel" To: guix-devel@gnu.org [ Note that this is my first post on this list, and I'm posting via gmane, so if I'm messing something up, please let me know, either on-list, or in private, whichever you deem more appropriate ] Danny Milosavljevic writes: > Hi, > > Rust uses #![...] for something that is definitely not a shebang > (file-wide feature tests). > Just some background info regarding Rust syntax: These are attributes applied to the enclosing file, common examples including #![feature(...)] to enable nightly-only features, #![deny(unsafe_code)], to deny the use of `unsafe` in the codebase (crate), and more. As those need to be placed before any actual code, and it is common for Rust files to not have preceding comments, encountering those at the very start of the file, where a shebang could occur, is indeed bound to be (and stay) a common occurence. > Currently, our patch-shebang[1] emits a lot of warnings because of those. > > Should we change patch-shebang to ignore lines starting with "#![" ? > Note that Rust is not the only language that has a construct conflicting with the sheebang pattern as described, e.g. #!r6rs or #!case-fold in Scheme; there might be others as well. Wouldn't "#!/" work to detect sheebangs reliably? Are there legitimate sheebangs that do not use an absolute file name? Regards, Rotty