public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Laszlo Ersek" <lersek@redhat.com>
To: Sean Brogan <sean.brogan@microsoft.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>,
	Matthew Carlson <macarl@microsoft.com>
Cc: "ray.ni@intel.com" <ray.ni@intel.com>,
	"Ard Biesheuvel (ARM address)" <ard.biesheuvel@arm.com>
Subject: Re: [edk2-devel] FW: Discussion: Basetools a separate repo
Date: Tue, 21 Apr 2020 17:49:27 +0200	[thread overview]
Message-ID: <47363f23-b979-c587-ed8c-0e894f13157f@redhat.com> (raw)
In-Reply-To: <MW2PR2101MB0924AA4021424CDEAB31056CE1D40@MW2PR2101MB0924.namprd21.prod.outlook.com>

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


  parent reply	other threads:[~2020-04-21 15:49 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-20 18:23 [edk2-devel] FW: Discussion: Basetools a separate repo Sean
2020-04-21  4:53 ` Purma, Kondal R
2020-04-21 15:49 ` Laszlo Ersek [this message]
2020-04-22  0:05   ` Matthew Carlson
2020-04-22 17:12     ` Laszlo Ersek
2020-04-22 19:30       ` Matthew Carlson
2020-04-24  9:27         ` Laszlo Ersek
2020-04-26  4:47           ` Purma, Kondal R
     [not found] <MWHPR21MB0799442E11A8E5DB4DE9E89ED1DA0@MWHPR21MB0799.namprd21.prod.outlook.com>
     [not found] ` <MWHPR21MB07998A4AD6385569A5703DE5D1DA0@MWHPR21MB0799.namprd21.prod.outlook.com>
     [not found]   ` <734D49CCEBEEF84792F5B80ED585239D5C4FEF0B@SHSMSX104.ccr.corp.intel.com>
     [not found]     ` <MW2PR2101MB0924A5AA30095DA7BB77CC0BE1D80@MW2PR2101MB0924.namprd21.prod.outlook.com>
     [not found]       ` <734D49CCEBEEF84792F5B80ED585239D5C500738@SHSMSX104.ccr.corp.intel.com>
2020-04-17  1:40         ` Ni, Ray
2020-04-20 12:49           ` [edk2-devel] " Laszlo Ersek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47363f23-b979-c587-ed8c-0e894f13157f@redhat.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox