Skip to contentSkip to conversation

roms/edk2: Avoid cloning unused cmocka submodule

PATCH Superseded Philippe Mathieu-Daudé 2 participants 7 messages Oct 18, 2021

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover roms/edk2: Avoid cloning unused cmocka submodule

cmocka website SSL certificate expired, making CI pipelines fail [*]. However EDK2 images built to test QEMU don't need cmocka. Avoid cloning it.

[*] https://gitlab.com/rth7680/qemu/-/jobs/1685387520
fatal: unable to access 'https://git.cryptomilk.org/projects/cmocka.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
fatal: clone of 'https://git.cryptomilk.org/projects/cmocka.git' into submodule path 'UnitTestFrameworkPkg/Library/CmockaLib/cmocka' failed

Philippe Mathieu-Daudé (2):
roms/edk2: Only init brotli submodule to build BaseTools roms/edk2: Only initialize required submodules

 .gitlab-ci.d/edk2.yml | 4 ++++
 roms/Makefile         | 3 ++-
 roms/Makefile.edk2    | 7 ++++++-
 scripts/make-release  | 7 ++++++-
 4 files changed, 18 insertions(+), 3 deletions(-)
Signature · 1 line
2.31.1
#1 lore raw

PATCH 1/2 roms/edk2: Only init brotli submodule to build BaseTools

Since EDK2 BaseTools only require the brotli submodule, we don't need to initialize other submodules at to build it.

---
 roms/Makefile | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
roms/Makefile +2 -1
index eeb5970348c..b967b53bb76 100644
@@ -143,7 +143,8 @@ build-efi-roms: build-pxe-roms
 #    efirom
 #
 edk2-basetools:
-	cd edk2/BaseTools && git submodule update --init --force
+	cd edk2/BaseTools && git submodule update --init --force \
+		Source/C/BrotliCompress/brotli
 	$(MAKE) -C edk2/BaseTools \
 		PYTHON_COMMAND=$${EDK2_PYTHON_COMMAND:-python3} \
 		EXTRA_OPTFLAGS='$(EDK2_BASETOOLS_OPTFLAGS)' \
Signature · 1 line
2.31.1
Reviewed-by on v1 1/2
#2 lore raw

Re: [PATCH 1/2] roms/edk2: Only init brotli submodule to build BaseTools

Quoted 2 lines · Philippe Mathieu-Daudé

Since EDK2 BaseTools only require the brotli submodule, we don't need to initialize other submodules at to build it.

s/at to/to/

Quoted 10 lines
---
  roms/Makefile | 3 ++-
  1 file changed, 2 insertions(+), 1 deletion(-)
roms/Makefile +0 -0
index eeb5970348c..b967b53bb76 100644

roms/Makefile build-efi-roms: build-pxe-roms · line 150

Quoted 9 lines
roms/Makefile +2 -1
@@ -143,7 +143,8 @@ build-efi-roms: build-pxe-roms
  #    efirom
  #
  edk2-basetools:
-	cd edk2/BaseTools && git submodule update --init --force
+	cd edk2/BaseTools && git submodule update --init --force \
+		Source/C/BrotliCompress/brotli
  	$(MAKE) -C edk2/BaseTools \
  		PYTHON_COMMAND=$${EDK2_PYTHON_COMMAND:-python3} \
  		EXTRA_OPTFLAGS='$(EDK2_BASETOOLS_OPTFLAGS)' \
#3 lore raw

PATCH 2/2 roms/edk2: Only initialize required submodules

In reply to Philippe Mathieu-Daudé

The EDK2 firmware images built to test QEMU do not require the following submodules:

- MdeModulePkg/Universal/RegularExpressionDxe/oniguruma
- UnitTestFrameworkPkg/Library/CmockaLib/cmocka

The only submodules required are:

- ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3
- BaseTools/Source/C/BrotliCompress/brotli
- CryptoPkg/Library/OpensslLib/openssl
- MdeModulePkg/Library/BrotliCustomDecompressLib/brotli

Adapt the buildsys machinery to only initialize the required submodules.

---
 .gitlab-ci.d/edk2.yml | 4 ++++
 roms/Makefile.edk2    | 7 ++++++-
 scripts/make-release  | 7 ++++++-
 3 files changed, 16 insertions(+), 2 deletions(-)
.gitlab-ci.d/edk2.yml +4 -0
index 62497ba47fb..2f12939d744 100644
@@ -51,6 +51,10 @@ build-edk2:
  script: # Clone the required submodules and build EDK2
  - git submodule update --init roms/edk2
  - git -C roms/edk2 submodule update --init
+     ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3
+     BaseTools/Source/C/BrotliCompress/brotli
+     CryptoPkg/Library/OpensslLib/openssl
+     MdeModulePkg/Library/BrotliCustomDecompressLib/brotli
  - export JOBS=$(($(getconf _NPROCESSORS_ONLN) + 1))
  - echo "=== Using ${JOBS} simultaneous jobs ==="
  - make -j${JOBS} -C roms efi 2>&1 1>edk2-stdout.log | tee -a edk2-stderr.log >&2
roms/Makefile.edk2 +6 -1
index a8ed3255757..fdae0b511f5 100644
@@ -51,7 +51,12 @@ all: $(foreach flashdev,$(flashdevs),../pc-bios/edk2-$(flashdev).fd.bz2) \
 # make-release/tarball scripts.
 submodules:
 	if test -d edk2/.git; then \
-		cd edk2 && git submodule update --init --force; \
+		cd edk2 && git submodule update --init --force -- \
+			ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 \
+			BaseTools/Source/C/BrotliCompress/brotli \
+			CryptoPkg/Library/OpensslLib/openssl \
+			MdeModulePkg/Library/BrotliCustomDecompressLib/brotli \
+		; \
 	fi
 
 # See notes on the ".NOTPARALLEL" target and the "+" indicator in
scripts/make-release +6 -1
index a2a8cda33c0..a9ff933a4ca 100755
@@ -27,7 +27,12 @@ git submodule update --init
 # don't necessarily have much control over how a submodule handles its
 # submodule dependencies, so we continue to handle these on a case-by-case
 # basis for now.
-(cd roms/edk2 && git submodule update --init)
+(cd roms/edk2 && \
+    git submodule update --init \
+        ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 \
+        BaseTools/Source/C/BrotliCompress/brotli \
+        CryptoPkg/Library/OpensslLib/openssl \
+        MdeModulePkg/Library/BrotliCustomDecompressLib/brotli)
 popd
 tar --exclude=.git -cjf ${destination}.tar.bz2 ${destination}
 rm -rf ${destination}
Signature · 1 line
2.31.1
#4 lore raw

Re: [PATCH 2/2] roms/edk2: Only initialize required submodules

Quoted 29 lines · Philippe Mathieu-Daudé

The EDK2 firmware images built to test QEMU do not require the following submodules:

- MdeModulePkg/Universal/RegularExpressionDxe/oniguruma
- UnitTestFrameworkPkg/Library/CmockaLib/cmocka

The only submodules required are:

- ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3
- BaseTools/Source/C/BrotliCompress/brotli
- CryptoPkg/Library/OpensslLib/openssl
- MdeModulePkg/Library/BrotliCustomDecompressLib/brotli

Adapt the buildsys machinery to only initialize the required submodules.

---
 .gitlab-ci.d/edk2.yml | 4 ++++
 roms/Makefile.edk2    | 7 ++++++-
 scripts/make-release  | 7 ++++++-
 3 files changed, 16 insertions(+), 2 deletions(-)

# See notes on the ".NOTPARALLEL" target and the "+" indicator in

scripts/make-release +0 -0
index a2a8cda33c0..a9ff933a4ca 100755

scripts/make-release git submodule update --init · line 31

Quoted 6 lines
scripts/make-release +2 -1
@@ -27,7 +27,12 @@ git submodule update --init
 # don't necessarily have much control over how a submodule handles its
 # submodule dependencies, so we continue to handle these on a case-by-case
 # basis for now.
-(cd roms/edk2 && git submodule update --init)
+(cd roms/edk2 && \
+    git submodule update --init \

Hmm I forgot the '--' separator here.

Quoted 8 lines
scripts/make-release +4 -0
+        ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3 \
+        BaseTools/Source/C/BrotliCompress/brotli \
+        CryptoPkg/Library/OpensslLib/openssl \
+        MdeModulePkg/Library/BrotliCustomDecompressLib/brotli)
 popd
 tar --exclude=.git -cjf ${destination}.tar.bz2 ${destination}
 rm -rf ${destination}
#5 lore raw

Re: [PATCH 2/2] roms/edk2: Only initialize required submodules

Cc'ing Michael, since the make-release script is not covered in any MAINTAINERS section.

Quoted 24 lines · Philippe Mathieu-Daudé
Quoted 22 lines · Philippe Mathieu-Daudé

The EDK2 firmware images built to test QEMU do not require the following submodules:

- MdeModulePkg/Universal/RegularExpressionDxe/oniguruma
- UnitTestFrameworkPkg/Library/CmockaLib/cmocka

The only submodules required are:

- ArmPkg/Library/ArmSoftFloatLib/berkeley-softfloat-3
- BaseTools/Source/C/BrotliCompress/brotli
- CryptoPkg/Library/OpensslLib/openssl
- MdeModulePkg/Library/BrotliCustomDecompressLib/brotli

Adapt the buildsys machinery to only initialize the required submodules.

---
 .gitlab-ci.d/edk2.yml | 4 ++++
 roms/Makefile.edk2    | 7 ++++++-
 scripts/make-release  | 7 ++++++-
 3 files changed, 16 insertions(+), 2 deletions(-)
Quoted 14 lines

scripts/make-release git submodule update --init · line 31

Quoted 12 lines

# See notes on the ".NOTPARALLEL" target and the "+" indicator in

scripts/make-release +2 -1
index a2a8cda33c0..a9ff933a4ca 100755
@@ -27,7 +27,12 @@ git submodule update --init
 # don't necessarily have much control over how a submodule handles its
 # submodule dependencies, so we continue to handle these on a case-by-case
 # basis for now.
-(cd roms/edk2 && git submodule update --init)
+(cd roms/edk2 && \
+    git submodule update --init \

Hmm I forgot the '--' separator here.

BTW Michael since commit 9d03f5abede ("travis.yml: Remove the "Release tarball" job") we don't test make-release anymore in our CI, you might want to add some GitLab equivalent job.

Regards,

Phil.

#6 lore raw
In reply to Philippe Mathieu-Daudé
Quoted 3 lines · Philippe Mathieu-Daudé

cmocka website SSL certificate expired, making CI pipelines fail [*]. However EDK2 images built to test QEMU don't need cmocka. Avoid cloning it.

Oh I forgot to mention we don't need oniguruma either, so this series also avoid cloning it.

Quoted 3 lines

Philippe Mathieu-Daudé (2):
roms/edk2: Only init brotli submodule to build BaseTools roms/edk2: Only initialize required submodules