heads icon indicating copy to clipboard operation
heads copied to clipboard

CircleCi on ubuntu 2104

Open tlaurion opened this issue 4 years ago • 24 comments
trafficstars

CircleCI was stuck to debian 10 for a while. Thanks @bluecmd and @itworksfinebro for individual proposed fixes, that merged together in this PR, should permit building of older boards on newer OSes.

This PR:

  • Attempts inclusion of #1035
  • Automates manual fix proposed by @itworksfinebro #983 (comment) in form of coreboot 4.8.1 and 4.11 patches
  • Removes manual https to http patch that was pushed in emergency when upstream mirrors were not upgrading their certs while I was doing build tests back in time.

Should fix : #983 #1036

Close #1035

Waiting for the result of the build here. My CircleCI is rate limiting threads since i'm overusing my instance. Pushing it as PR should use @osresearch's and give faster result.

tlaurion avatar Oct 11 '21 20:10 tlaurion

At the current stage, it is impossible to build older boards based on either 4.8.1 nor 4.11.

Building locally with debian-11/on CircleCI with Ubuntu 21.04

make CPUS=2 BOARD=x230-hotp-maximized V=1

make[2]: Entering directory '/home/user/heads/build/coreboot-4.8.1'
toolchain.inc:186: The coreboot toolchain version of iasl '20210105' was not found
toolchain.inc:212: 
toolchain.inc:213: To build the entire coreboot toolchain: run 'make crossgcc'
toolchain.inc:215: To build just IASL: run 'make iasl'
toolchain.inc:217: For more toolchain build targets: run 'make help_toolchain'
toolchain.inc:218: 
toolchain.inc:220: To try to use any toolchain in your path, run 'make menuconfig', then select
toolchain.inc:222: the config option: 'General setup', and 'Allow building with any toolchain'
toolchain.inc:224: Note that this is NOT supported. Using it means you're on your own.
toolchain.inc:226: 
toolchain.inc:228: *** Halting the build.  Stop.
make[2]: Leaving directory '/home/user/heads/build/coreboot-4.8.1'
make[1]: *** [Makefile:455: /home/user/heads/build/coreboot-4.8.1/x230-hotp-maximized/.build] Error 1
make[1]: Leaving directory '/home/user/heads'
make: *** [Makefile:668: all] Error 2

At this point, I am not sure what additional patch to apply to be able to continue to have coreboot 4.8.1/coreboot 4.11 being built alongside of newer versions of coreboot based boards on newer OSes.

The problem is known for a while.

  • debian-10 docker image can build older and newer systems because of the way Heads is built.
    • host build tools build make and gawk, then coreboot crossgcc, then musl-cross-make for all other modules to be built against musl-cross-make buildstack, not against host system build tools.

Replacing debian-10 to newer OSes breaks builds of older boards. Solutions:

  • Help fixing 4.8.1 boards
  • Migrate all 4.8.1 boards to 4.13+ (works as shown here over CircleCI removing kgpe-d16 boards and using https://github.com/osresearch/heads/pull/1015

But as you all may know, CircleCI is the only way we can tell right away if a board breaks by a new commit (let it be changing a module version making it too big to fit in older boards)

@paulmenzel ? @MrChromebox @osresearch ? @bluecmd ? @Tonux599 ? @Thrilleratplay ?

  • Should we remove kgpe-d16 (coreboot 4.11 based) from CircleCI and not fix coreboot 4.11 to be built on newer OSes?
  • Should we then merge https://github.com/osresearch/heads/pull/1015 more savagely so that no coreboot 4.13 boards are built by CI?
  • Should we then merge #1035 so that make 4.2.1 can be built on newer systems?
  • Should we then change CircleCI docker to be based on Debian 21.04 as this PR proposes?

The best solution would obviously to have proper patches so that coreboot 4.8.1 and 4.11 could still be built on newer OSes as this PR tries to do, but I do not know how to fix further this PR without external advises. This is where you guys can jump in. The community would definitely appreciate.

tlaurion avatar Oct 13 '21 17:10 tlaurion

@MrChromebox kgpe-d16 and librem_l1um1828 would be removed from CircleCI because builds of coreboot 4.11 just won't work currently without additional fixes/love.

tlaurion avatar Oct 13 '21 18:10 tlaurion

The IASL error is created in https://github.com/coreboot/coreboot/blob/4.8.1/toolchain.inc#L190 The relevant test for that can be found at https://github.com/coreboot/coreboot/blob/4.8.1/toolchain.inc#L186-L188

So: iasl needs to exist, and it needs to have "coreboot toolchain" as part of its version string. All crossgcc-built iasls since https://github.com/coreboot/coreboot/commit/6f656138a63dbc4fe508eec19dc2f17d01e8d155 (coreboot 4.3 or so) provide that.

pgeorgi avatar Oct 13 '21 18:10 pgeorgi

@tlaurion at least until Qubes 4.1 is released, or unless a fix is found, the Librem 13/15 boards need to stay on coreboot 4.81 as anything newer fails to boot Qubes 4.0.x. The Librem L1UM is stuck on 4.11 as the platform was dropped in 4.12.

So we really need to get older coreboot (toolchain) versions building under current distros

MrChromebox avatar Oct 13 '21 18:10 MrChromebox

@pgeorgi the patch to build newer version of iasl (for it to be successfully built) is at https://github.com/osresearch/heads/pull/1038/files#diff-9AC962054E169E329F1B549352BD127D

I don't quite understand why the version string is not in. Any advice?

Edit: got it.... Forgot to add patch for bumped acpica-unix similar to but for matching version.... Doh! https://github.com/coreboot/coreboot/blob/master/util/crossgcc/patches/acpica-unix2-20210331_iasl.patch

Will add tomorrow...

tlaurion avatar Oct 14 '21 01:10 tlaurion

@MrChromebox coreboot 4.11 cannot be built corrently on ubuntu 21.04. Stopper (as of now, I expect other problems to be found) is shown at https://app.circleci.com/pipelines/github/tlaurion/heads/797/workflows/1348840f-1945-488b-957d-2386498b1e6a/jobs/1828 when trying to build librem_l1um.

General error:

Building IASL v20190703 for host ... failed. Check 'build-IASL/build.log'.
make[3]: *** [Makefile:36: build_iasl] Error 1
make[2]: *** [util/crossgcc/Makefile.inc:54: iasl] Error 2
make[2]: Leaving directory '/root/project/build/coreboot-4.11'
make[1]: *** [modules/coreboot:83: "/root/project/build/coreboot-4.11/util/crossgcc/xgcc/bin/iasl"] Error 2
make[1]: Leaving directory '/root/project'
make: *** [Makefile:668: all] Error 2

CircleCI received exit code 0

Details (exerpts):


-  bison        obj/aslcompiler.y
/root/project/build/coreboot-4.11/util/crossgcc/acpica-unix2-20190703/generate/unix/iasl/obj/aslcompiler.y:103.1-7: warning: POSIX Yacc does not support %expect [-Wyacc]
  103 | %expect 124
-  bison        obj/aslcompiler.y
/root/project/build/coreboot-4.11/util/crossgcc/acpica-unix2-20190703/generate/unix/iasl/obj/aslcompiler.y:103.1-7: warning: POSIX Yacc does not support %expect [-Wyacc]
  103 | %expect 124

Consequently:

- Link obj/iasl
/usr/bin/ld: obj/aslcompilerparse.o:(.bss+0x8): multiple definition of `AslCompilerlval'; obj/aslcompilerlex.o:(.bss+0x0): first defined here
/usr/bin/ld: obj/prparserlex.o:(.bss+0x0): multiple definition of `LexBuffer'; obj/dtparserlex.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [../Makefile.rules:15: obj/iasl] Error 1
make[1]: Leaving directory '/root/project/build/coreboot-4.11/util/crossgcc/acpica-unix2-20190703/generate/unix/iasl'
make: *** [Makefile.common:7: iasl] Error 2
cp: cannot stat 'bin/iasl': No such file or directory
cp: cannot stat 'bin/acpiexec': No such file or directory

@MrChromebox @pgeorgi : insights/fixes to propose for coreboot 4.11? Continuing progress on 4.8.1 on my side, while there won't be any need for community boards once #1015 is merged. But 4.11 would still be needed for both kgpe-d16 and librem_l1um boards compilation.

@MrChromebox : Btw, CircleCI never built anything for Purism 4.8.1 boards here. Qubes 4.1 rc1 being out, you still have the same behavior on coreboot 4.13+? What kind of problems are you facing?

tlaurion avatar Oct 14 '21 15:10 tlaurion

@tlaurion why are we not bumping iasl for coreboot 4.11 the same as we are for 4.81?

On the Librem 13/15 with Heads built using coreboot 4.9+, Qubes 4.0.x freezes right after kexec with no useful output. I'll retest with coreboot 4.14 and Qubes 4.1 RC and report back

MrChromebox avatar Oct 14 '21 20:10 MrChromebox

Coreboot 4.8.1 builds now fails with referred past issue https://github.com/osresearch/heads/issues/853#issuecomment-943704117 on Ubuntu 21.04..... Ideas?

tlaurion avatar Oct 14 '21 20:10 tlaurion

@tlaurion why are we not bumping iasl for coreboot 4.11 the same as we are for 4.81?

Could definitely give it a try for 4.11.... But for the moment, I have no clue on how to make 4.8.1 support forward. Could swap boards builds on CI so that a 4.11 board is built first bumping IASL. Patches welcome.

tlaurion avatar Oct 14 '21 22:10 tlaurion

@tlaurion so Qubes 4.1 installer boots/runs successfully on Kabylake-based Librem 13v4/15v4 with coreboot 4.14+Heads, but has graphical glitches and/or hangs on the Skylake-based 13v2/15v3. These are literally the exact same boards with a different SoC dropped on. And no issue with coreboot 4.14+SeaBIOS, so this is Heads-specific =/

MrChromebox avatar Oct 15 '21 14:10 MrChromebox

@tlaurion so Qubes 4.1 installer boots/runs successfully on Kabylake-based Librem 13v4/15v4 with coreboot 4.14+Heads, but has graphical glitches and/or hangs on the Skylake-based 13v2/15v3. These are literally the exact same boards with a different SoC dropped on. And no issue with coreboot 4.14+SeaBIOS

@MrChromebox: seabios deals with graphical initialization itself, including inclusion of VBIOS is I recall well. Coreboot now has VBT support which resolved the issue that was present with i915 and wrong default graphical display being used in my past tests. For sandy/ivy, VBT is now included as part of #1015, while graphic initialization per see was deactivated inside of coreboot and left for the kernel driver to initialize. VBT + linux kernel were then able to deal correctly with graphical initialization and resolved the glitches and video memory corruption/initialization that were present.

so this is Heads-specific =/

Which means coreboot + linux + kexec specific =/

tlaurion avatar Oct 15 '21 15:10 tlaurion

@MrChromebox coreboot 4.11 cannot be built corrently on ubuntu 21.04. Stopper (as of now, I expect other problems to be found) is shown at https://app.circleci.com/pipelines/github/tlaurion/heads/797/workflows/1348840f-1945-488b-957d-2386498b1e6a/jobs/1828 when trying to build librem_l1um.

General error:

Building IASL v20190703 for host ... failed. Check 'build-IASL/build.log'.
make[3]: *** [Makefile:36: build_iasl] Error 1
make[2]: *** [util/crossgcc/Makefile.inc:54: iasl] Error 2
make[2]: Leaving directory '/root/project/build/coreboot-4.11'
make[1]: *** [modules/coreboot:83: "/root/project/build/coreboot-4.11/util/crossgcc/xgcc/bin/iasl"] Error 2
make[1]: Leaving directory '/root/project'
make: *** [Makefile:668: all] Error 2

CircleCI received exit code 0

Details (exerpts):


-  bison        obj/aslcompiler.y
/root/project/build/coreboot-4.11/util/crossgcc/acpica-unix2-20190703/generate/unix/iasl/obj/aslcompiler.y:103.1-7: warning: POSIX Yacc does not support %expect [-Wyacc]
  103 | %expect 124
-  bison        obj/aslcompiler.y
/root/project/build/coreboot-4.11/util/crossgcc/acpica-unix2-20190703/generate/unix/iasl/obj/aslcompiler.y:103.1-7: warning: POSIX Yacc does not support %expect [-Wyacc]
  103 | %expect 124

Consequently:

- Link obj/iasl
/usr/bin/ld: obj/aslcompilerparse.o:(.bss+0x8): multiple definition of `AslCompilerlval'; obj/aslcompilerlex.o:(.bss+0x0): first defined here
/usr/bin/ld: obj/prparserlex.o:(.bss+0x0): multiple definition of `LexBuffer'; obj/dtparserlex.o:(.bss+0x0): first defined here
collect2: error: ld returned 1 exit status
make[1]: *** [../Makefile.rules:15: obj/iasl] Error 1
make[1]: Leaving directory '/root/project/build/coreboot-4.11/util/crossgcc/acpica-unix2-20190703/generate/unix/iasl'
make: *** [Makefile.common:7: iasl] Error 2
cp: cannot stat 'bin/iasl': No such file or directory
cp: cannot stat 'bin/acpiexec': No such file or directory

@MrChromebox @pgeorgi : insights/fixes to propose for coreboot 4.11? Continuing progress on 4.8.1 on my side, while there won't be any need for community boards once #1015 is merged. But 4.11 would still be needed for both kgpe-d16 and librem_l1um boards compilation.

@MrChromebox : Btw, CircleCI never built anything for Purism 4.8.1 boards here. Qubes 4.1 rc1 being out, you still have the same behavior on coreboot 4.13+? What kind of problems are you facing?

The same error happens after upgrading IASL here: POSIX Yacc does not support %expect [-Wyacc] Which results in

-  Intermediate obj/aslcompilerlex.c
- Link obj/iasl
- Copy obj/iasl to ../bin/iasl
make[1]: Leaving directory '/root/project/build/coreboot-4.11/util/crossgcc/acpica-unix-20210105/generate/unix/iasl'

cp: cannot stat 'bin/acpinames': No such file or directory
cp: cannot stat 'bin/acpisrc': No such file or directory
cp: cannot stat 'bin/acpixtract': No such file or directory

Exited with code exit status 1

CircleCI received exit code 1

As can be seen here

The IASL version was upgraded as part of https://github.com/osresearch/heads/pull/1038/commits/e6cf1fdd1adc914cfd649303418b5b259411856a, but would have bugged later on on iasl not reporting itself as part of coreboot crossgcc environment.

So at this point:

  • coreboot 4.8.1 board builds fail at this point https://github.com/osresearch/heads/issues/853#issuecomment-943704117
  • coreboot 4.11 board builds fail at this point https://github.com/osresearch/heads/pull/1038#issuecomment-943465900

tlaurion avatar Oct 15 '21 15:10 tlaurion

@MrChromebox: seabios deals with graphical initialization itself, including inclusion of VBIOS is I recall well.

Not on Purism's devices - we use coreboot libgfxinit, and load the VBT into the ACPI opregion for i915. SeaBIOS simply uses the framebuffer coreboot sets up for it (via SeaVGABIOS).

Coreboot now has VBT support which resolved the issue that was present with i915 and wrong default graphical display being used in my past tests. For sandy/ivy, VBT is now included as part of #1015, while graphic initialization per see was deactivated inside of coreboot and left for the kernel driver to initialize. VBT + linux kernel were then able to deal correctly with graphical initialization and resolved the glitches and video memory corruption/initialization that were present.

with Heads, Purism boards use libgfxinit in coreboot and then i915 reinits the panel. I'll retry with coreboot display init disabled (but VBT loaded). Very odd that SKL has an issue and KBL doesn't, given the SoC/CPU/GPU is nearly identical

MrChromebox avatar Oct 15 '21 16:10 MrChromebox

acpinames

Update for coreboot 4.11: acpinames was an unexisting make target, %expect warning really just being a warning which I thought was dealt as an error... Patched buildgcc... Continuing local build.

tlaurion avatar Oct 15 '21 17:10 tlaurion

@tlaurion the IASL bump in coreboot 4.11 causes a build failure for the librem_l1um, for which I have a 1-line patch ready. With the patch, builds properly :)

MrChromebox avatar Oct 15 '21 18:10 MrChromebox

Before merge:

  • [x] CI boards that are 4.8.1 needs to be upgraded to 4.13+

  • [x] 4.11 kgpe-16 CiecleCI artifact needs to be tested. @Tonux599 does a6b2795 make sense?

tlaurion avatar Oct 16 '21 21:10 tlaurion

@Tonux599 confirmed that https://1949-103208611-gh.circle-artifacts.com/0/build/kgpe-d16_workstation/heads-kgpe-d16_workstation-v5.0.1-53-ga57e41b.rom (a57e41b) boots and is fully functional.

@MrChromebox have your confirmed https://1959-103208611-gh.circle-artifacts.com/0/build/librem_l1um/heads-librem_l1um-v5.0.1-53-ga57e41b.rom works as expected too?

Seems like we will have coreboot 4.11 and 4.13+ CI that is similar to what users builds with again.

Question now is if additional patches need to be added to 4.8.1 coreboot attempt here. Or if I split it. Putting back to draft.

tlaurion avatar Oct 20 '21 21:10 tlaurion

Next steps:

  • [ ] Merge #1015
  • [ ] Put fixes pertaining to 4.8.1 in another PR (@MrChromebox ?)
  • [ ] Merge this cleaned PR.

tlaurion avatar Oct 20 '21 21:10 tlaurion

Should fix

  • #983
  • #1036

tlaurion avatar Oct 21 '21 16:10 tlaurion

@MrChromebox have your confirmed https://1959-103208611-gh.circle-artifacts.com/0/build/librem_l1um/heads-librem_l1um-v5.0.1-53-ga57e41b.rom works as expected too?

yes, tested working

MrChromebox avatar Oct 21 '21 23:10 MrChromebox

[ ] Put fixes pertaining to 4.8.1 in another PR (@MrChromebox ?)

this isn't ready yet I'm guessing?

MrChromebox avatar Oct 21 '21 23:10 MrChromebox

@MrChromebox 4.8.1 coreboot builds on newer OSes is stuck here with current patchset https://github.com/osresearch/heads/pull/1038#issuecomment-943721373

tlaurion avatar Oct 22 '21 00:10 tlaurion

Where subsequent step was outlined https://github.com/osresearch/heads/issues/853#issuecomment-944109419

tlaurion avatar Oct 22 '21 00:10 tlaurion

Next

tlaurion avatar Dec 04 '21 21:12 tlaurion

Was fixed a while ago, circleci being based on debian-11 and the only supported path as of now.

tlaurion avatar Sep 07 '22 14:09 tlaurion