xaionaro / edk2-builder-docker

Docker container to build EDK2-based projects. Supports all EDK2 releases out of the box. And has examples of usage.
Creative Commons Zero v1.0 Universal
1 stars 1 forks source link

RefindPlus debug build fails #32

Open startergo opened 1 year ago

startergo commented 1 year ago

Failing at:

/home/edk2/edk2/RefindPlusPkg/Library/MemLogLib/BootLog.c:384:13: error: function declared 'ms_abi' here was previously declared without calling convention
VOID EFIAPI DebugLog (
            ^
/home/edk2/edk2/RefindPlusPkg/BootMaster/global.h:574:6: note: previous declaration is here
VOID DebugLog (
     ^
1 error generated.
make: *** [GNUmakefile:5138: /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlusPkg/RefindPlus/OUTPUT/Library/MemLogLib/BootLog.obj] Error 1

build.py...
 : error 7000: Failed to execute command
    make tbuild [/home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlusPkg/RefindPlus]

build.py...
 : error F002: Failed to build module
    /home/edk2/edk2/RefindPlusPkg/RefindPlus.inf [X64, CLANG38, DEBUG]

- Failed -
Build end time: 19:37:52, Dec.27 2022
Build total time: 00:00:23

It looks like changing VOID DebugLog to extern VOID EFIAPI DebugLog in global.h should patch for now

startergo commented 1 year ago

Also found out by testing that the Clang build through Docker does not work on my machine whereas the XCODE5 build of the same code works. Maybe we can try building with GCC5 instead?

startergo commented 1 year ago

GCC5 build fails:

In file included from /home/edk2/edk2/RefindPlusPkg/filesystems/fsw_btrfs_zstd.h:48,
                 from /home/edk2/edk2/RefindPlusPkg/filesystems/fsw_btrfs.c:1597:
At top level:
/home/edk2/edk2/RefindPlusPkg/filesystems/zstd/huf_decompress.c:607:21: warning: 'always_inline' function might not be inlinable [-Wattributes]
  607 | FORCE_INLINE size_t HUF_decodeStreamX4(BYTE *p, BIT_DStream_t *bitDPtr, BYTE *const pEnd, const HUF_DEltX4 *const dt, const U32 dtLog)
      |                     ^~~~~~~~~~~~~~~~~~
/home/edk2/edk2/RefindPlusPkg/filesystems/zstd/huf_decompress.c:168:21: warning: 'always_inline' function might not be inlinable [-Wattributes]
  168 | FORCE_INLINE size_t HUF_decodeStreamX2(BYTE *p, BIT_DStream_t *const bitDPtr, BYTE *const pEnd, const HUF_DEltX2 *const dt, const U32 dtLog)
      |                     ^~~~~~~~~~~~~~~~~~
In file included from /home/edk2/edk2/RefindPlusPkg/filesystems/fsw_btrfs_zstd.h:47,
                 from /home/edk2/edk2/RefindPlusPkg/filesystems/fsw_btrfs.c:1597:
/home/edk2/edk2/RefindPlusPkg/filesystems/zstd/fse_decompress.c:171:21: warning: 'always_inline' function might not be inlinable [-Wattributes]
  171 | FORCE_INLINE size_t FSE_decompress_usingDTable_generic(void *dst, size_t maxDstSize, const void *cSrc, size_t cSrcSize, const FSE_DTable *dt,
      |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /home/edk2/edk2/RefindPlusPkg/filesystems/fsw_btrfs_zstd.h:46,
                 from /home/edk2/edk2/RefindPlusPkg/filesystems/fsw_btrfs.c:1597:
/home/edk2/edk2/RefindPlusPkg/filesystems/zstd/zstd_decompress.c:1152:8: warning: 'always_inline' function might not be inlinable [-Wattributes]
 1152 | size_t ZSTD_execSequenceLong(BYTE *op, BYTE *const oend, seq_t sequence, const BYTE **litPtr, const BYTE *const litLimit, const BYTE *const base,
      |        ^~~~~~~~~~~~~~~~~~~~~
/home/edk2/edk2/RefindPlusPkg/filesystems/zstd/zstd_decompress.c:1034:20: warning: 'always_inline' function might not be inlinable [-Wattributes]
 1034 | FORCE_INLINE seq_t ZSTD_decodeSequenceLong_generic(seqState_t *seqState, int const longOffsets) {
      |                    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/edk2/edk2/RefindPlusPkg/filesystems/zstd/zstd_decompress.c:878:8: warning: 'always_inline' function might not be inlinable [-Wattributes]
  878 | size_t ZSTD_execSequence(BYTE *op, BYTE *const oend, seq_t sequence, const BYTE **litPtr, const BYTE *const litLimit, const BYTE *const base,
      |        ^~~~~~~~~~~~~~~~~
make: *** [GNUmakefile:487: /home/edk2/Build/RefindPlus/RELEASE_GCC5/X64/RefindPlusPkg/filesystems/btrfs/OUTPUT/fsw_btrfs.obj] Error 1
Waiting for thread ending...(9)

build.py...
 : error 7000: Failed to execute command
    make tbuild [/home/edk2/Build/RefindPlus/RELEASE_GCC5/X64/RefindPlusPkg/filesystems/btrfs]

build.py...
 : error 7000: Failed to execute command
    make tbuild [/home/edk2/Build/RefindPlus/RELEASE_GCC5/X64/RefindPlusPkg/RefindPlus]

build.py...
 : error F002: Failed to build module
    /home/edk2/edk2/RefindPlusPkg/filesystems/btrfs.inf [X64, GCC5, RELEASE]

- Failed -
Build end time: 09:50:19, Dec.28 2022
Build total time: 00:00:53

+ exit

I had similar error building rEFInd before, which I fixed here. Maybe something similar? https://github.com/startergo/docker-makepkg/blob/main/PKG/PKGBUILD#L150-L163

startergo commented 1 year ago

I removed the image from the RefindPlusPkg.dsc :

#!/bin/bash -xe

mkdir -pm 1777 out ||
    mkdir -p out

git clone --recursive https://github.com/startergo/RefindPlus RefindPlusPkg
docker pull xaionaro2/edk2-builder:RefindPlusUDK    

# hacky fix for duplication error of lodepng_malloc and lodepng_free
sed -e 's/void[*] lodepng_refit_malloc/void* _dup_lodepng_refit_malloc/' \
    -e 's/void lodepng_refit_free/void _dup_lodepng_refit_free/' \
    -i-orig RefindPlusPkg/libeg/lodepng_xtra.c

docker run --rm \
    -e CFLAGS=-Wno-error \
    -e TOOLCHAIN=GCC5 \
    -e BUILD_TARGET=RELEASE \
    -e DSC_PATH=RefindPlusPkg/RefindPlusPkg.dsc \
    -v "$PWD/RefindPlusPkg/:/home/edk2/edk2/RefindPlusPkg/" \
    -v "$PWD/out:/home/edk2/Build" \
    xaionaro2/edk2-builder:RefindPlusUDK

And this build works (GCC5 RELEASE version)

startergo commented 1 year ago

For the DEBUG there are errors with GCC5:

Error during build ``` Building ... /home/edk2/edk2/MdePkg/Library/BasePrintLib/BasePrintLib.inf [X64] In file included from /home/edk2/edk2/OpenCorePkg/Library/OcDevicePathLib/OcDevicePathLib.c:15: /home/edk2/edk2/OpenCorePkg/Library/OcDevicePathLib/../../../RefindPlusPkg/Library/OCRefitLib/OCRefitLib.h:60:5: error: unknown type name 'CHAR16' 60 | CHAR16 EFIAPI CharToUpper (IN CHAR16 Char); | ^~~~~~ /home/edk2/edk2/OpenCorePkg/Library/OcDevicePathLib/../../../RefindPlusPkg/Library/OCRefitLib/OCRefitLib.h:60:19: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'CharToUpper' 60 | CHAR16 EFIAPI CharToUpper (IN CHAR16 Char); | ^~~~~~~~~~~ Building ... /home/edk2/edk2/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf [X64] "gcc" -Wno-error -Os -DEFIX64 -D__MAKEWITH_TIANO -DREFIT_DEBUG=1 -Wno-error -c -o /home/edk2/Build/RefindPlus/DEBUG_GCC5/X64/OpenCorePkg/Library/OcGuardLib/OcGuardLib/OUTPUT/./Alignment.obj -I/home/edk2/edk2/OpenCorePkg/Library/OcGuardLib -I/home/edk2/Build/RefindPlus/DEBUG_GCC5/X64/OpenCorePkg/Library/OcGuardLib/OcGuardLib/DEBUG -I/home/edk2/edk2/MdePkg -I/home/edk2/edk2/MdePkg/Include -I/home/edk2/edk2/MdePkg/Include/X64 -I/home/edk2/edk2/OpenCorePkg -I/home/edk2/edk2/OpenCorePkg/Include/AMI -I/home/edk2/edk2/OpenCorePkg/Include/Acidanthera -I/home/edk2/edk2/OpenCorePkg/Include/Apple -I/home/edk2/edk2/OpenCorePkg/Include/Generic -I/home/edk2/edk2/OpenCorePkg/Include/Intel -I/home/edk2/edk2/OpenCorePkg/Include/Microsoft -I/home/edk2/edk2/OpenCorePkg/Include/VMware -I/home/edk2/edk2/OpenCorePkg/Include/Apple/X64 /home/edk2/edk2/OpenCorePkg/Library/OcGuardLib/Alignment.c Building ... /home/edk2/edk2/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf [X64] "gcc" -Wno-error -Os -DEFIX64 -D__MAKEWITH_TIANO -DREFIT_DEBUG=1 -Wno-error -c -o /home/edk2/Build/RefindPlus/DEBUG_GCC5/X64/MdePkg/Library/BasePcdLibNull/BasePcdLibNull/OUTPUT/./PcdLib.obj -I/home/edk2/edk2/MdePkg/Library/BasePcdLibNull -I/home/edk2/Build/RefindPlus/DEBUG_GCC5/X64/MdePkg/Library/BasePcdLibNull/BasePcdLibNull/DEBUG -I/home/edk2/edk2/MdePkg -I/home/edk2/edk2/MdePkg/Include -I/home/edk2/edk2/MdePkg/Include/X64 /home/edk2/edk2/MdePkg/Library/BasePcdLibNull/PcdLib.c Building ... /home/edk2/edk2/MdePkg/Library/BaseLib/BaseLib.inf [X64] "gcc" -Wno-error -Os -DEFIX64 -D__MAKEWITH_TIANO -DREFIT_DEBUG=1 -Wno-error -c -o /home/edk2/Build/RefindPlus/DEBUG_GCC5/X64/MdePkg/Library/BasePrintLib/BasePrintLib/OUTPUT/./PrintLibInternal.obj -I/home/edk2/edk2/MdePkg/Library/BasePrintLib -I/home/edk2/Build/RefindPlus/DEBUG_GCC5/X64/MdePkg/Library/BasePrintLib/BasePrintLib/DEBUG -I/home/edk2/edk2/MdePkg -I/home/edk2/edk2/MdePkg/Include -I/home/edk2/edk2/MdePkg/Include/X64 /home/edk2/edk2/MdePkg/Library/BasePrintLib/PrintLibInternal.c Building ... /home/edk2/edk2/MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf [X64] "gcc" -Wno-error -Os -DEFIX64 -D__MAKEWITH_TIANO -DREFIT_DEBUG=1 -Wno-error -c -o /home/edk2/Build/RefindPlus/DEBUG_GCC5/X64/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull/OUTPUT/./DebugLib.obj -I/home/edk2/edk2/MdePkg/Library/BaseDebugLibNull -I/home/edk2/Build/RefindPlus/DEBUG_GCC5/X64/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull/DEBUG -I/home/edk2/edk2/MdePkg -I/home/edk2/edk2/MdePkg/Include -I/home/edk2/edk2/MdePkg/Include/X64 /home/edk2/edk2/MdePkg/Library/BaseDebugLibNull/DebugLib.c "gcc" -Wno-error -Os -DEFIX64 -D__MAKEWITH_TIANO -DREFIT_DEBUG=1 -Wno-error -c -o /home/edk2/Build/RefindPlus/DEBUG_GCC5/X64/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib/OUTPUT/./DevicePathUtilities.obj -I/home/edk2/edk2/MdePkg/Library/UefiDevicePathLib -I/home/edk2/Build/RefindPlus/DEBUG_GCC5/X64/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib/DEBUG -I/home/edk2/edk2/MdePkg -I/home/edk2/edk2/MdePkg/Include -I/home/edk2/edk2/MdePkg/Include/X64 /home/edk2/edk2/MdePkg/Library/UefiDevicePathLib/DevicePathUtilities.c In file included from /home/edk2/edk2/MdePkg/Library/BasePrintLib/PrintLibInternal.h:22, from /home/edk2/edk2/MdePkg/Library/BasePrintLib/PrintLibInternal.c:15: /home/edk2/edk2/MdePkg/Library/BasePrintLib/PrintLibInternal.c: In function 'BasePrintLibConvertValueToStringS': /home/edk2/edk2/MdePkg/Include/Library/PcdLib.h:388:45: error: '_PCD_GET_MODE_32_PcdMaximumAsciiStringLength' undeclared (first use in this function) 388 | #define PcdGet32(TokenName) _PCD_GET_MODE_32_##TokenName | ^~~~~~~~~~~~~~~~~ /home/edk2/edk2/MdePkg/Library/BasePrintLib/PrintLibInternal.c:24:32: note: in expansion of macro 'PcdGet32' 24 | #define ASCII_RSIZE_MAX (PcdGet32 (PcdMaximumAsciiStringLength)) | ^~~~~~~~ /home/edk2/edk2/MdePkg/Library/BasePrintLib/PrintLibInternal.c:377:9: note: in expansion of macro 'ASCII_RSIZE_MAX' 377 | if (ASCII_RSIZE_MAX != 0) { | ^~~~~~~~~~~~~~~ /home/edk2/edk2/MdePkg/Include/Library/PcdLib.h:388:45: note: each undeclared identifier is reported only once for each function it appears in 388 | #define PcdGet32(TokenName) _PCD_GET_MODE_32_##TokenName | ^~~~~~~~~~~~~~~~~ /home/edk2/edk2/MdePkg/Library/BasePrintLib/PrintLibInternal.c:24:32: note: in expansion of macro 'PcdGet32' 24 | #define ASCII_RSIZE_MAX (PcdGet32 (PcdMaximumAsciiStringLength)) | ^~~~~~~~ /home/edk2/edk2/MdePkg/Library/BasePrintLib/PrintLibInternal.c:377:9: note: in expansion of macro 'ASCII_RSIZE_MAX' 377 | if (ASCII_RSIZE_MAX != 0) { | ^~~~~~~~~~~~~~~ /home/edk2/edk2/OpenCorePkg/Library/OcFileLib/FileProtocol.c: In function 'OcFindWritableFileSystem': /home/edk2/edk2/OpenCorePkg/Library/OcFileLib/FileProtocol.c:229:7: warning: passing argument 3 of 'OcSafeFileOpen' from incompatible pointer type [-Wincompatible-pointer-types] 229 | L"octest.fil", | ^~~~~~~~~~~~~ | | | int * In file included from /home/edk2/edk2/OpenCorePkg/Library/OcFileLib/FileProtocol.c:23: /home/edk2/edk2/OpenCorePkg/Include/Acidanthera/Library/OcFileLib.h:116:32: note: expected 'const CHAR16 *' {aka 'const short unsigned int *'} but argument is of type 'int *' 116 | IN CONST CHAR16 *FileName, /home/edk2/edk2/MdePkg/Include/Library/PcdLib.h:388:45: error: '_PCD_GET_MODE_32_PcdMaximumUnicodeStringLength' undeclared (first use in this function) 388 | #define PcdGet32(TokenName) _PCD_GET_MODE_32_##TokenName | ^~~~~~~~~~~~~~~~~ /home/edk2/edk2/MdePkg/Library/BasePrintLib/PrintLibInternal.c:23:32: note: in expansion of macro 'PcdGet32' 23 | #define RSIZE_MAX (PcdGet32 (PcdMaximumUnicodeStringLength)) | ^~~~~~~~ /home/edk2/edk2/MdePkg/Library/BasePrintLib/PrintLibInternal.c:384:9: note: in expansion of macro 'RSIZE_MAX' 384 | if (RSIZE_MAX != 0) { | ^~~~~~~~~ /home/edk2/edk2/OpenCorePkg/Library/OcDevicePathLib/OcDevicePathLib.c: In function 'InternalFileDevicePathsEqualWorker': /home/edk2/edk2/OpenCorePkg/Library/OcDevicePathLib/OcDevicePathLib.c:812:15: warning: implicit declaration of function 'CharToUpper' [-Wimplicit-function-declaration] 812 | Char1 = CharToUpper ((*FilePath1)->PathName[Clip1Index + Index]); | ^~~~~~~~~~~ /home/edk2/edk2/MdePkg/Library/BasePrintLib/PrintLibInternal.c: In function 'BasePrintLibSPrintMarker': /home/edk2/edk2/MdePkg/Include/Library/PcdLib.h:388:45: error: '_PCD_GET_MODE_32_PcdMaximumUnicodeStringLength' undeclared (first use in this function) 388 | #define PcdGet32(TokenName) _PCD_GET_MODE_32_##TokenName | ^~~~~~~~~~~~~~~~~ /home/edk2/edk2/MdePkg/Library/BasePrintLib/PrintLibInternal.c:23:32: note: in expansion of macro 'PcdGet32' 23 | #define RSIZE_MAX (PcdGet32 (PcdMaximumUnicodeStringLength)) | ^~~~~~~~ /home/edk2/edk2/MdePkg/Library/BasePrintLib/PrintLibInternal.c:594:9: note: in expansion of macro 'RSIZE_MAX' 594 | if (RSIZE_MAX != 0) { | ^~~~~~~~~ make: *** [GNUmakefile:350: /home/edk2/Build/RefindPlus/DEBUG_GCC5/X64/OpenCorePkg/Library/OcDevicePathLib/OcDevicePathLib/OUTPUT/OcDevicePathLib.obj] Error 1 "gcc" -Wno-error -Os -DEFIX64 -D__MAKEWITH_TIANO -DREFIT_DEBUG=1 -Wno-error -c -o /home/edk2/Build/RefindPlus/DEBUG_GCC5/X64/MdePkg/Library/BaseLib/BaseLib/OUTPUT/./CheckSum.obj -I/home/edk2/edk2/MdePkg/Library/BaseLib/X64 -I/home/edk2/edk2/MdePkg/Library/BaseLib -I/home/edk2/Build/RefindPlus/DEBUG_GCC5/X64/MdePkg/Library/BaseLib/BaseLib/DEBUG -I/home/edk2/edk2/MdePkg -I/home/edk2/edk2/MdePkg/Include -I/home/edk2/edk2/MdePkg/Include/X64 /home/edk2/edk2/MdePkg/Library/BaseLib/CheckSum.c /home/edk2/edk2/MdePkg/Include/Library/PcdLib.h:388:45: error: '_PCD_GET_MODE_32_PcdMaximumAsciiStringLength' undeclared (first use in this function) 388 | #define PcdGet32(TokenName) _PCD_GET_MODE_32_##TokenName | ^~~~~~~~~~~~~~~~~ /home/edk2/edk2/MdePkg/Library/BasePrintLib/PrintLibInternal.c:24:32: note: in expansion of macro 'PcdGet32' 24 | #define ASCII_RSIZE_MAX (PcdGet32 (PcdMaximumAsciiStringLength)) | ^~~~~~~~ /home/edk2/edk2/MdePkg/Library/BasePrintLib/PrintLibInternal.c:599:9: note: in expansion of macro 'ASCII_RSIZE_MAX' 599 | if (ASCII_RSIZE_MAX != 0) { | ^~~~~~~~~~~~~~~ build.py... : error 7000: Failed to execute command make tbuild [/home/edk2/Build/RefindPlus/DEBUG_GCC5/X64/OpenCorePkg/Library/OcDevicePathLib/OcDevicePathLib] build.py... : error 7000: Failed to execute command make tbuild [/home/edk2/Build/RefindPlus/DEBUG_GCC5/X64/MdePkg/Library/BasePrintLib/BasePrintLib] build.py... : error 7000: Failed to execute command make tbuild [/home/edk2/Build/RefindPlus/DEBUG_GCC5/X64/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib] build.py... : error 7000: Failed to execute command make tbuild [/home/edk2/Build/RefindPlus/DEBUG_GCC5/X64/OpenCorePkg/Library/OcGuardLib/OcGuardLib] build.py... : error 7000: Failed to execute command make tbuild [/home/edk2/Build/RefindPlus/DEBUG_GCC5/X64/OpenCorePkg/Library/OcFileLib/OcFileLib] build.py... : error 7000: Failed to execute command make tbuild [/home/edk2/Build/RefindPlus/DEBUG_GCC5/X64/MdePkg/Library/BaseLib/BaseLib] build.py... : error F002: Failed to build module /home/edk2/edk2/OpenCorePkg/Library/OcDevicePathLib/OcDevicePathLib.inf [X64, GCC5, DEBUG] - Failed - Build end time: 11:57:05, Dec.28 2022 Build total time: 00:00:09 ```
startergo commented 1 year ago

Have you considered running Github Actions with OSX VM? https://github.com/acidanthera/OpenCorePkg/actions/runs/3794949343/jobs/6453557125 https://github.com/actions/runner-images/blob/macOS-12/20221215.1/images/macos/macos-12-Readme.md Building with XCODE5 in OSX environment?

startergo commented 1 year ago

So now both CLANG38 DEBUG and RELEASE build without any patches, but the product does not work properly. It hangs on boot. Maybe try CLANG39 or later? GCC5 still hangs on btrfs driver build.

voltagex commented 3 months ago

@startergo did you ever get this working?

startergo commented 3 months ago

@startergo did you ever get this working?

I believe it is working now. Is it not working for you? go to

/edk2-builder-docker/examples/github.com-dakanji-RefindPlus/

and run the build.sh.

You might need to change BUILD_TARGET=RELEASE to BUILD_TARGET=DEBUG for the debug version.

voltagex commented 3 months ago

With docker run --rm -e CFLAGS=-Wno-error -e TOOLCHAIN=CLANG38 -e BUILD_TARGET=DEBUG -e DSC_PATH=RefindPlusPkg/RefindPlusPkg.dsc -v "$PWD/RefindPlusPkg/:/home/edk2/edk2/RefindPlusPkg/" -v "$PWD/out:/home/edk2/Build" xaionaro2/edk2-builder:RefindPlusUDK

I am getting

Architecture(s)  = X64
Build target     = DEBUG
Toolchain        = CLANG38

Active Platform          = /home/edk2/edk2/RefindPlusPkg/RefindPlusPkg.dsc

FLASH_DEFINITION =

Processing meta-data .                                                                                                                                                                                                                                                                  Library instances of module [/home/edk2/edk2/RefindPlusPkg/RefindPlus.inf] [X64]:
        UefiApplicationEntryPoint : /home/edk2/edk2/MdePkg/Library/UefiApplicationEntryPoint/UefiApplicationEntryPoint.inf
        UefiBootServicesTableLib : /home/edk2/edk2/MdePkg/Library/UefiBootServicesTableLib/UefiBootServicesTableLib.inf
        UefiLib : /home/edk2/edk2/MdePkg/Library/UefiLib/UefiLib.inf
        MemoryAllocationLib : /home/edk2/edk2/MdePkg/Library/UefiMemoryAllocationLib/UefiMemoryAllocationLib.inf                                                                                                                                                                                BaseMemoryLib : /home/edk2/edk2/MdePkg/Library/BaseMemoryLib/BaseMemoryLib.inf
        BaseLib : /home/edk2/edk2/MdePkg/Library/BaseLib/BaseLib.inf
        DevicePathLib : /home/edk2/edk2/MdePkg/Library/UefiDevicePathLib/UefiDevicePathLib.inf
        DebugLib : /home/edk2/edk2/MdePkg/Library/BaseDebugLibNull/BaseDebugLibNull.inf                                                                                                                                                                                                         DxeServicesLib : /home/edk2/edk2/MdePkg/Library/DxeServicesLib/DxeServicesLib.inf
        DxeServicesTableLib : /home/edk2/edk2/MdePkg/Library/DxeServicesTableLib/DxeServicesTableLib.inf
        HobLib : /home/edk2/edk2/MdePkg/Library/DxeHobLib/DxeHobLib.inf                                                                                                                                                                                                                         IoLib : /home/edk2/edk2/MdePkg/Library/BaseIoLibIntrinsic/BaseIoLibIntrinsic.inf
        PerformanceLib : /home/edk2/edk2/MdePkg/Library/BasePerformanceLibNull/BasePerformanceLibNull.inf
        MemLogLib : /home/edk2/edk2/RefindPlusPkg/Library/MemLogLib/MemLogLib.inf                                                                                                                                                                                                               OcConsoleLib : /home/edk2/edk2/OpenCorePkg/Library/OcConsoleLib/OcConsoleLib.inf
        OcMiscLib : /home/edk2/edk2/OpenCorePkg/Library/OcMiscLib/OcMiscLib.inf
        HandleParsingLib : /home/edk2/edk2/ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf                                                                                                                                                                                       RP_ApfsLib : /home/edk2/edk2/RefindPlusPkg/Library/RP_ApfsLib/RP_ApfsLib.inf
        NvmExpressLib : /home/edk2/edk2/RefindPlusPkg/Library/NvmExpressLib/NvmExpressLib.inf                                                                                                                                                                                                   OcUnicodeCollationEngGenericLib : /home/edk2/edk2/OpenCorePkg/Library/OcUnicodeCollationEngLib/OcUnicodeCollationEngGenericLib.inf
        UefiRuntimeServicesTableLib : /home/edk2/edk2/MdePkg/Library/UefiRuntimeServicesTableLib/UefiRuntimeServicesTableLib.inf                                                                                                                                                                PrintLib : /home/edk2/edk2/MdePkg/Library/BasePrintLib/BasePrintLib.inf
        ReportStatusCodeLib : /home/edk2/edk2/MdePkg/Library/BaseReportStatusCodeLibNull/BaseReportStatusCodeLibNull.inf
        PcdLib : /home/edk2/edk2/MdePkg/Library/BasePcdLibNull/BasePcdLibNull.inf
        OcDriverConnectionLib : /home/edk2/edk2/OpenCorePkg/Library/OcDriverConnectionLib/OcDriverConnectionLib.inf                                                                                                                                                                             OcGuardLib : /home/edk2/edk2/OpenCorePkg/Library/OcGuardLib/OcGuardLib.inf
        FileHandleLib : /home/edk2/edk2/MdePkg/Library/UefiFileHandleLib/UefiFileHandleLib.inf                                                                                                                                                                                                  HiiLib : /home/edk2/edk2/MdeModulePkg/Library/UefiHiiLib/UefiHiiLib.inf
        SortLib : /home/edk2/edk2/MdeModulePkg/Library/UefiSortLib/UefiSortLib.inf                                                                                                                                                                                                              PeCoffGetEntryPointLib : /home/edk2/edk2/MdePkg/Library/BasePeCoffGetEntryPointLib/BasePeCoffGetEntryPointLib.inf
        UefiHiiServicesLib : /home/edk2/edk2/MdeModulePkg/Library/UefiHiiServicesLib/UefiHiiServicesLib.inf
        OcFileLib : /home/edk2/edk2/OpenCorePkg/Library/OcFileLib/OcFileLib.inf
        OcStringLib : /home/edk2/edk2/OpenCorePkg/Library/OcStringLib/OcStringLib.inf
        OcDevicePathLib : /home/edk2/edk2/OpenCorePkg/Library/OcDevicePathLib/OcDevicePathLib.inf
        FrameBufferBltLib : /home/edk2/edk2/MdeModulePkg/Library/FrameBufferBltLib/FrameBufferBltLib.inf                                                                                                                                                                                        MtrrLib : /home/edk2/edk2/UefiCpuPkg/Library/MtrrLib/MtrrLib.inf
        CpuLib : /home/edk2/edk2/MdePkg/Library/BaseCpuLib/BaseCpuLib.inf
        PciLib : /home/edk2/edk2/MdePkg/Library/BasePciLibCf8/BasePciLibCf8.inf                                                                                                                                                                                                                 PciCf8Lib : /home/edk2/edk2/MdePkg/Library/BasePciCf8Lib/BasePciCf8Lib.inf

build.py...
 : error 0005: Could not create directory /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64

Which now I look at it is a different error to yours, so I'll open a new issue.

startergo commented 3 months ago

rEFInd builds with GCC5

#!/bin/bash -xe

mkdir -pm 1777 out ||
    mkdir -p out

[[ -d RefindPkg ]] || git clone --recursive https://git.code.sf.net/p/refind/code RefindPkg
docker pull xaionaro2/edk2-builder:vUDK2018

# building DEBUG
exec docker run --rm \
    -e CFLAGS=-Wno-error \
    -e TOOLCHAIN=GCC5 \
    -e BUILD_TARGET=DEBUG \
    -e DSC_PATH=RefindPkg/RefindPkg.dsc \
    -v "$PWD/RefindPkg/:/home/edk2/edk2/RefindPkg/" \
    -v "$PWD/out:/home/edk2/Build" \
    xaionaro2/edk2-builder:vUDK2018

# building RELEASE
exec docker run --rm \
    -e CFLAGS=-Wno-error \
    -e TOOLCHAIN=GCC5 \
    -e BUILD_TARGET=RELEASE \
    -e DSC_PATH=RefindPkg/RefindPkg.dsc \
    -v "$PWD/RefindPkg/:/home/edk2/edk2/RefindPkg/" \
    -v "$PWD/out:/home/edk2/Build" \
    xaionaro2/edk2-builder:vUDK2018
cp -f /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/refind.dll /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/refind.debug
objcopy --strip-unneeded -R .eh_frame /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/refind.dll
Waiting for thread ending...(1)
objcopy --add-gnu-debuglink=/home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/refind.debug /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/refind.dll
cp -f /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/refind.debug /home/edk2/Build/Refind/DEBUG_GCC5/X64/refind.debug
Waiting for thread ending...(1)
"GenFw" -e UEFI_APPLICATION -o /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/refind.efi /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/refind.dll
cp -f /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/refind.efi /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/OUTPUT
cp -f /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/refind.efi /home/edk2/Build/Refind/DEBUG_GCC5/X64/refind.efi
cp -f /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/DEBUG/*.map /home/edk2/Build/Refind/DEBUG_GCC5/X64/RefindPkg/refind/OUTPUT

- Done -
Build end time: 23:27:59, Aug.15 2024
Build total time: 00:00:50
startergo commented 3 months ago

For RefindPlus both RELEASE and DEBUG build fine:

#!/bin/bash -xe

mkdir -pm 1777 out ||
    mkdir -p out

git clone --recursive https://github.com/dakanji/RefindPlus RefindPlusPkg
docker pull xaionaro2/edk2-builder:RefindPlusUDK

# Release
exec docker run --rm \
    -e CFLAGS=-Wno-error \
    -e TOOLCHAIN=CLANG38 \
    -e BUILD_TARGET=RELEASE \
    -e DSC_PATH=RefindPlusPkg/RefindPlusPkg.dsc \
    -v "$PWD/RefindPlusPkg/:/home/edk2/edk2/RefindPlusPkg/" \
    -v "$PWD/out:/home/edk2/Build" \
    xaionaro2/edk2-builder:RefindPlusUDK

# Debug
exec docker run --rm \
    -e CFLAGS=-Wno-error \
    -e TOOLCHAIN=CLANG38 \
    -e BUILD_TARGET=DEBUG \
    -e DSC_PATH=RefindPlusPkg/RefindPlusPkg.dsc \
    -v "$PWD/RefindPlusPkg/:/home/edk2/edk2/RefindPlusPkg/" \
    -v "$PWD/out:/home/edk2/Build" \
    xaionaro2/edk2-builder:RefindPlusUDK
cp -f /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlusPkg/RefindPlus/DEBUG/RefindPlus.debug /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlus.debug
"GenFw" -e UEFI_APPLICATION -o /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlusPkg/RefindPlus/DEBUG/RefindPlus.efi /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlusPkg/RefindPlus/DEBUG/RefindPlus.dll
cp -f /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlusPkg/RefindPlus/DEBUG/RefindPlus.efi /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlusPkg/RefindPlus/OUTPUT
cp -f /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlusPkg/RefindPlus/DEBUG/RefindPlus.efi /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlus.efi
cp -f /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlusPkg/RefindPlus/DEBUG/*.map /home/edk2/Build/RefindPlus/DEBUG_CLANG38/X64/RefindPlusPkg/RefindPlus/OUTPUT