[edk2-devel] [PATCH 1/1] Remove bashisms from edksetup.sh and BaseTools/BuildEnv

Pedro Falcato pedro.falcato at gmail.com
Sun May 7 03:51:03 UTC 2023


On Sun, May 7, 2023 at 4:31 AM Rebecca Cran <rebecca at bsdio.com> wrote:
>
> On 5/6/23 15:48, Pedro Falcato wrote:
> >
> > My local installations of Net (latest stable) and FreeBSD (13.1 with a
> > hacked-up kernel) do not have a python3 symlink.
> >
> > I'm slightly worried that this breaks something. I know requiring
> > whereis isn't ideal, but I'm fairly sure it did handle this situation?
>
> I uninstalled the python and python3 packages, leaving only python39.
>
> I got the following results on edk2 master:
>
>
> [bcran at maxamd ~/src/uefi/edk2]$ whereis python3
> python3:
>
> [bcran at maxamd ~/src/uefi/edk2]$ ls /usr/local/bin | grep python
>
> python3.9
>
> python3.9-config
>
> [bcran at maxamd ~/src/uefi/edk2]$ . edksetup.sh
> Using EDK2 in-source Basetools
> WORKSPACE: /home/bcran/src/uefi/edk2
> EDK_TOOLS_PATH: /home/bcran/src/uefi/edk2/BaseTools
>
> CONF_PATH: /home/bcran/src/uefi/edk2/Conf
>
>
> [bcran at maxamd ~/src/uefi/edk2]$ echo $PYTHON_COMMAND
>
> [bcran at maxamd ~/src/uefi/edk2]$ gmake -C BaseTools/ -j16
> gmake: Entering directory '/usr/home/bcran/src/uefi/edk2/BaseTools'
> gmake -C Source/C
> gmake -C Source/Python
> gmake[1]: Entering directory
> '/usr/home/bcran/src/uefi/edk2/BaseTools/Source/C'
> gmake[1]: Entering directory
> '/usr/home/bcran/src/uefi/edk2/BaseTools/Source/Python'
> gmake[1]: Nothing to be done for 'all'.
> gmake[1]: Leaving directory
> '/usr/home/bcran/src/uefi/edk2/BaseTools/Source/Python'
> Attempting to detect HOST_ARCH from 'uname -m': amd64
> Detected HOST_ARCH of X64 using uname.
> mkdir -p .
> mkdir ./libs
> mkdir ./bin
> gmake -C VfrCompile VfrLexer.h
> gmake -C Common
> gmake[2]: Entering directory
> '/usr/home/bcran/src/uefi/edk2/BaseTools/Source/C/VfrCompile'
> gmake[2]: Entering directory
> '/usr/home/bcran/src/uefi/edk2/BaseTools/Source/C/Common'
>
> .....
>
> Finished building BaseTools C Tools with HOST_ARCH=X64
> gmake[1]: Leaving directory
> '/usr/home/bcran/src/uefi/edk2/BaseTools/Source/C'
> gmake -C Tests
> gmake[1]: Entering directory '/usr/home/bcran/src/uefi/edk2/BaseTools/Tests'
> /bin/sh: python: not found
> gmake[1]: *** [GNUmakefile:11: test] Error 127
> gmake[1]: Leaving directory '/usr/home/bcran/src/uefi/edk2/BaseTools/Tests'
> gmake: *** [GNUmakefile:19: Tests] Error 2
> gmake: Leaving directory '/usr/home/bcran/src/uefi/edk2/BaseTools'
> ...
>
> [bcran at maxamd ~/src/uefi/edk2]$ build -p OvmfPkg/OvmfPkgX64.dsc -a X64
> -t GCC -b RELEASE
> /home/bcran/src/uefi/edk2/BaseTools/BinWrappers/PosixLike/build: line
> 14: exec: python: not found

Thank you for your testing. I asked around and came to the conclusion
it's a FreeBSD "meta-package" that lots of people don't have
installed.

If this doesn't break anything, I'm ok with it. Although there should
really be a better solution, the status quo sucks.

That said, the rest of the POSIX sh conversion looks ok to me.

Acked-by: Pedro Falcato <pedro.falcato at gmail.com>

Although there's a small fixup you may want to do at
   >echo "source $SCRIPTNAME"
Since source is not POSIX, but '.' is.

-- 
Pedro


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104214): https://edk2.groups.io/g/devel/message/104214
Mute This Topic: https://groups.io/mt/98729541/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-




More information about the edk2-devel-archive mailing list