From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [207.211.31.120]) by mx.groups.io with SMTP id smtpd.web12.2205.1587484176153863279 for ; Tue, 21 Apr 2020 08:49:36 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Mh2E4tdz; spf=pass (domain: redhat.com, ip: 207.211.31.120, mailfrom: lersek@redhat.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587484175; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UQQVvkmjzczXSMt5KqAEZmWweq27SCCAOF6Hi0NTHhY=; b=Mh2E4tdzUtUZrJ0tmqDXDzGjZMzplxaqsyTFr3Y2vcZM/YpzwgNm4wvORRiImbEU+RDO8Z eW+81gErbmniTSl5cskLz3kxTab0mYWI6LlgFQYOJS6hAeFb6tiuZpRnrSkaHxOROJh6Za c6kXb7Fdhhn+oJcJVQi6X7qp1VvD1Ac= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-57-mTeW6oviN2W9Kx-XfGTaAg-1; Tue, 21 Apr 2020 11:49:30 -0400 X-MC-Unique: mTeW6oviN2W9Kx-XfGTaAg-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8D1BC190B2A0; Tue, 21 Apr 2020 15:49:29 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-115-52.ams2.redhat.com [10.36.115.52]) by smtp.corp.redhat.com (Postfix) with ESMTP id 01FA9B3A62; Tue, 21 Apr 2020 15:49:27 +0000 (UTC) Subject: Re: [edk2-devel] FW: Discussion: Basetools a separate repo To: Sean Brogan , "devel@edk2.groups.io" , Matthew Carlson Cc: "ray.ni@intel.com" , "Ard Biesheuvel (ARM address)" References: From: "Laszlo Ersek" Message-ID: <47363f23-b979-c587-ed8c-0e894f13157f@redhat.com> Date: Tue, 21 Apr 2020 17:49:27 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Language: en-US Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit On 04/20/20 20:23, Sean Brogan wrote: > Laszlo, > > PIP vs Submodules: > The issue with submodule and not using python packages (pip is really just a super convenient helper to install that consistently) is that it requires the paradigm of file system python path management. Think of this as edk1 vs edk2 public includes (if you remember back that far), basically you just figure out the path from yourself to the file you want and add that. It gives you no ability to apply consistent ways to access modules and in the end means you just have a folder with python scripts/modules in it. It causes major pain for downstream consumers when/if there is ever refactoring (and we know there needs to be refactoring). It leads to others not being able to extend or leverage these modules without introducing significant fragility. > > What Pip does is gives you a way to consistently install and access the python modules. You can pip install from a local copy of the git repo or you can pip install a "release" using something like pypi. Either way it doesn't change how consuming code accesses the python modules. This is the value of pip in this case. > > If there is a strong desire from the developer community to have a workflow that avoids pip I believe a little documentation could handle that. Pip is just a helper. Python packages can be built from the source and installed. I see no reason to recommend this as it requires numerous more commands but if avoiding pip is your goal, it is possible. > > More value for python package management (PIP): > As we start looking at refactoring and potentially moving tools from C to python we can take advantage of package management to lower our maintenance burden. For example Brotli has a pypi release and thus we wouldn't need to carry that code. https://pypi.org/project/Brotli/ > > > VERSION / DEPENDENCY: > To minimize the dependency challenges and "bisectability" I would suggest we leverage the versioning capabilities within pip and repo tagging. With versioning you have lots of options as you can lock to a specific version which requires an update each time or you can use some sort of floating version within the tuple of version (xx.yy.zz). It also needs to be discussed if a release would be generated for every change in the python or only on an important change. These two tools can make this pretty flexible. > > In your scenario of DEC or INF syntax change. My first pass on workflow would be. > 1. Create the issue for basetools > 2. Update basetools python > 3. Write the unit test that shows it works as expected > 4. Check in and make a release > 5. Update edk2 pip-requirements.txt to require at least this new version. This gives you the tracking necessary to align with the tools. > 6. Use this new feature in the edk2 fw code. > > > TOOLS DEVELOPER WORKFLOWS: > You mentioned you wanted to make sure a developer could modify source locally and test against local code. This is covered by workflow C. It is very easy to manage and is one of the reasons we are proposing this change. Please provide a step by step guide for the following use case: - Edk2 at commit C1 uses a particular new BaseTools feature. However, there is a regression in BaseTools, and an independent MdeModulePkg module (unrelated to the new BaseTools feature) no longer builds. - Edk2 at commit C0 works fine. At this point in time (i.e. when C0 was made), the BaseTools feature / regression didn't exist yet. - The edk2 clone is checked out at C1, and the breakage is witnessed. The user wants to return to state C0, and get a functional build. The user wants to revert BaseTools too, to the same version that was "BaseTools master" at the time edk2 commit C0 was made. - The user is not allowed to run commands as root, and they also don't want to confuse other python programs they may have installed under their $HOME. - How *exactly* does the user determine the exact BaseTools version, in retrospect, for when commit C0 was the HEAD of edk2 master? For example, is it git show C0:pip-requirements.txt ? - What are the *precise* commands the user needs to run, for moving from state C1 to C0, covering both edk2 and BaseTools? I know I can run "git checkout C0" in the edk2 tree, to return to that point in the past. What are the exact commands I need to run for synching BaseTools to that state? If the C1->C0 transition requires (re)installing BaseTools to some private directory under $HOME, using a "virtual environment" or some such with pip, that's entirely fine. I'm happy to do that. I've just never done it before, and I want to make it absolutely sure that "moving (back) through time" like this is doable without interfering with either system Python state, or the user's general ($HOME) Python state. For reference, with a git submodule, the BaseTools "sync" command would be git submodule update --init --force Thanks Laszlo