From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.groups.io with SMTP id smtpd.web10.19844.1675356639226660771 for ; Thu, 02 Feb 2023 08:50:39 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=FoTwFISs; spf=pass (domain: redhat.com, ip: 170.10.133.124, mailfrom: kraxel@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1675356638; 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=1pytd5FxP4f6NG1pTE/yZp/ys5qDbQkMLDvGHE+17RU=; b=FoTwFISsGuyUvozs+x+p743YQ/i62vqW9JmED2HvRceZebPNmAEv9ZJFLtrzpKZC3L94Z6 ZdObNX0fJq30ZP77n4A5zIVQUOuhFu+wX+8nNLDeF82MGYaapoH07yCINevBdVwJxJ+h0P ZvXI+ZQsQCWOOSmVN2L6R4jL9BDLoh0= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-414-_IN4dVEZOaiYHA1JxHJJKQ-1; Thu, 02 Feb 2023 11:50:35 -0500 X-MC-Unique: _IN4dVEZOaiYHA1JxHJJKQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 98772183B3CA; Thu, 2 Feb 2023 16:50:34 +0000 (UTC) Received: from sirius.home.kraxel.org (unknown [10.39.192.85]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 44B09112132C; Thu, 2 Feb 2023 16:50:34 +0000 (UTC) Received: by sirius.home.kraxel.org (Postfix, from userid 1000) id B7089180061A; Thu, 2 Feb 2023 17:50:32 +0100 (CET) Date: Thu, 2 Feb 2023 17:50:32 +0100 From: "Gerd Hoffmann" To: devel@edk2.groups.io, tlaronde@polynum.com Cc: Andrew Fish , Leif Lindholm , Michael D Kinney Subject: Re: [edk2-devel] edk2setup.sh shortcomings Message-ID: <20230202165032.e2kvjxsntrmhc3ue@sirius.home.kraxel.org> References: MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 3.1 on 10.11.54.3 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Feb 02, 2023 at 12:29:32PM +0100, tlaronde@polynum.com wrote: > edk2setup.sh has shortcomings. To list some: > > - The functions return a status but it is not tested; hence the > script goes to the end with a final "return $?" that simply > returns the status of the last command that is "unset" which > always successfully unsets, even a not set variable. Hence a > script can not catch a failure by testing the end status that is > always 0; > - If WORKSPACE is set, --reconfig does nothing; > - If EDK_TOOLS_PATH and PACKAGES_PATH are set, even to incorrect > values, the script succeeds even if BaseTools/ is not found > anywhere; > - The comments are obsolete (1): bash(1) is required because the syntax > is not POSIX.2 sh(1) compliant and because some Makefile recipes > have "bash'isms" (indeed, a GMAKE variable should be exported > with a definition of "/path/to/gnu/make SHELL=/path/to/bash" and > a canonical call should be "$GMAKE ..."); > - The comments are obsolete (2): CYGWIN is not treated in anyway > specifically and, on the contrary, the regexp translation of ':' > in spaces for PACKAGES_PATH would be sure to create a mess with > a MS Windows like path; > - The settings have obviously evolved and the help message does not > list all the variables that can be set and that do modify the > way the setting is done; > - Some commands (notably whereis(1)) are not standard utilities, not > to be found on all Unix like systems and, even if found, have > greatly diverging behaviors. > > What is the preferred procedure? Ignore it and to just use BaseTools/BuildEnv directly? I'm not fully sure what value it adds ... > Should I file BZ to list all the > problems so that someone authorized may address them? Or can I propose > a patch to address these (keeping it backward compatible with a present > correct use) with a reasonable hope that, as an exception that will not > become a rule, it will not be ignored? Sending patches has a much higher chance to succeed, although there is no guarantee unfortunately. I'd start with removing code: The python handling it adds should be obsolete, python2 is EOL and I think meanwhile the python tools require python3 anyway. So all that can probably replaced with "export PYTHON_COMMAND=python3". Leaves less code which needs actual fixing ;) take care, Gerd