focal-mainline-builder icon indicating copy to clipboard operation
focal-mainline-builder copied to clipboard

Jammy LTS Mainline Kernels amd64 not building

Open winstonma opened this issue 1 year ago • 14 comments

I just checked Jammy LTS Mainline Kernels and it has failure on recent builds. After checking the build log it seems rust is missing.

Not sure if rustup could help.

winstonma avatar Sep 20 '23 06:09 winstonma

Thanks for the report, it looks like the version of rust required has been bumped from 1.62 to 1.68, which isn't available in jammy yet. I'll try to fix it over the weekend.

Cheers

TuxInvader avatar Sep 22 '23 07:09 TuxInvader

See: https://bugs.launchpad.net/ubuntu/+source/rustc-1.68/+bug/2037051

TuxInvader avatar Sep 22 '23 07:09 TuxInvader

Hi @TuxInvader, I think it is worthwhile to try rustup and currently running rust 1.72.1 on Jammy.

I installed that on my Ubuntu Jammy and use build.sh (with multiple modification) and built kernel 6.5.4 with no problem.

EDIT: For the modification, I

  1. Replaced multiple hard-coded /home/source/ with "$ksrc"
  2. Also I think the comment on this line is incorrect but it has nothing to do with the overall build

winstonma avatar Sep 22 '23 07:09 winstonma

That comment sure does look wrong, thanks for pointing it out ;-)

Rustup is great for doing a binary build, I'll add it as an option to the container. But it's no good for the PPA, because the build environment is locked down and it wont be able to add the binaries to the path :-/

TuxInvader avatar Sep 22 '23 07:09 TuxInvader

Thanks for the info. I thought the PPA is a docker environment.

Also I would like this script not only work on Docker but could the build.sh could support native Jammy machine? I found that the script would delete the file in local git repo after the build. I guess that has something to do after this line because after commenting all those lines it works fine. So I guess the whole repo is removed during the cleaning process.

winstonma avatar Sep 22 '23 12:09 winstonma

clang-15 also appears to be a new build dependency as of v6.5.3? I'm working on a PR for rustup and ran into this snag.

$ git diff cod/mainline/v6.5.2..cod/mainline/v6.5.3 debian.master/control.stub.in
diff --git a/debian.master/control.stub.in b/debian.master/control.stub.in
index 589488cc9a22..83d5900b5d96 100644
--- a/debian.master/control.stub.in
+++ b/debian.master/control.stub.in
@@ -39,6 +39,12 @@ Build-Depends:
  curl <!stage1>,
  zstd <!stage1>,
  pahole [amd64 arm64 armhf ppc64el s390x riscv64] | dwarves (>= 1.21) [amd64 arm64 armhf ppc64el s390x riscv64] <!stage1>,
+ clang-15 [amd64],
+ libclang1-15 [amd64],
+ rustc-1.68 [amd64],
+ rust-1.68-src [amd64],
+ rustfmt-1.68 [amd64],
+ bindgen-0.56 [amd64],
  libstdc++-dev,
 Build-Depends-Indep:
  xmlto <!stage1>,

mwpastore avatar Sep 26 '23 05:09 mwpastore

This one seems to work

https://github.com/zabbly/linux/

akronym0 avatar Oct 17 '23 03:10 akronym0

From this line in the latest buildlog:

"The following packages have unmet dependencies: sbuild-build-depends-main-dummy : Depends: libclang1-17 but it is not installable"

It appears your build script tries to install clang1-17, but the latest available in jammy is 1-15

This ppa provides a newer version of llvm, v1-17:

https://launchpad.net/~savoury1/+archive/ubuntu/llvm-defaults-17

robin-paulson avatar Mar 08 '24 09:03 robin-paulson

Mainline v6.8 builds with the following caveats:

  • https://launchpad.net/~savoury1/+archive/ubuntu/llvm-defaults-17
  • https://launchpad.net/~savoury1/+archive/ubuntu/rust
  • Requirements updated to use bindgen-0.65.1

Also, a big thank you for the Focal Kernel LTS builds(my x220's battery is saved further degradation thanks to this).

samveen avatar Mar 14 '24 15:03 samveen

From this line in the latest buildlog:

"The following packages have unmet dependencies: sbuild-build-depends-main-dummy : Depends: libclang1-17 but it is not installable"

It appears your build script tries to install clang1-17, but the latest available in jammy is 1-15

This ppa provides a newer version of llvm, v1-17:

https://launchpad.net/~savoury1/+archive/ubuntu/llvm-defaults-17

I tried Zabbly kernel (instruction) and it didn't require to install llvm

winstonma avatar Mar 16 '24 00:03 winstonma

@winstonma Winston, this repo is specific to ubuntu mainline kernel building which apply a few patches on top of the upstream releases. For a reference you can see https://git.launchpad.net/~ubuntu-kernel-test/ubuntu/+source/linux/+git/mainline-crack/log/?h=cod/mainline/v6.8.1 for the list of patches applied on top of the v6.8.1 upstream release.

The requirements listed in this thread are specifically those applied by the Ubuntu kernel packaging team for building the kernel on the latest ubuntu release, back-ported to the older LTS releases , as the Ubuntu kernel release team supports the use of the mainline kernels only on the latest version of ubuntu.

More details at

  • https://wiki.ubuntu.com/Kernel/MainlineBuilds
  • https://launchpad.net/~canonical-kernel-team/+archive/ubuntu/unstable/+packages

P.S. I've been banging my head over trying to build a set of apt installable kernel packages of the 6.8 series for Ubuntu Focal, and I'm still only in the prep stage :cry:

samveen avatar Mar 16 '24 13:03 samveen

I tried Zabbly kernel (instruction) and it didn't require to install llvm

llvm is required for building, not installing.

robin-paulson avatar Mar 16 '24 19:03 robin-paulson

I tried Zabbly kernel (instruction) and it didn't require to install llvm

llvm is required for building, not installing.

I tried mainline kernel (not Jammy LTS Mainline kernel). It always said there are unmet dependencies libc6 > 2.38. I thought you are talking about the same issue.

winstonma avatar Mar 17 '24 11:03 winstonma

Mainline v6.8 builds with the following caveats:

* https://launchpad.net/~savoury1/+archive/ubuntu/llvm-defaults-17 
* https://launchpad.net/~savoury1/+archive/ubuntu/rust
* Requirements updated to use `bindgen-0.65.1`

Also, a big thank you for the Focal Kernel LTS builds(my x220's battery is saved further degradation thanks to this).

EDIT: Just found that this is already logged upstream by you: https://bugs.launchpad.net/ubuntu/+source/rustc-1.62/+bug/1993183/comments/16

Trying to replicate the debian packaging as done by the Ubuntu kernel team (ref: https://launchpad.net/~canonical-kernel-team/+archive/ubuntu/bootstrap/+build/27917183 ) fails at multiple places:

  • Additional requirements for gcc-13 for Focal - satisfied with via https://launchpad.net/~ubuntu-toolchain-r/+archive/ubuntu/test/
  • Distribution set to noble via debian.master/variants - fixed by sed s/2[24]\.04/20.04/g debian.master/variants
  • Config check after olddefconfig fails with the following differences (no solution yet):
python3 debian/scripts/misc/annotations --export --arch amd64 --flavour generic > /<<PKGBUILDDIR>>/debian/build/build-generic/.config

...

make ARCH=x86 CROSS_COMPILE=x86_64-linux-gnu- HOSTCC=x86_64-linux-gnu-gcc-13 CC=x86_64-linux-gnu-gcc-13 BINDGEN=bindgen-0.65 KERNELRELEASE=6.8.0-13-generic CONFIG_DEBUG_SECTION_MISMATCH=y KBUILD_BUILD_VERSION="13" CFLAGS_MODULE="-DPKG_ABI=13" PYTHON=python3 O=/<<PKGBUILDDIR>>/debian/build/build-generic -j4 olddefconfig
...
#
# configuration written to .config
#

...
make[1]: Leaving directory '/<<PKGBUILDDIR>>'
touch /<<PKGBUILDDIR>>/debian/stamps/stamp-prepare-tree-generic
Debug: config-prepare-check-generic
python3 debian/scripts/misc/annotations -f /<<PKGBUILDDIR>>/debian.master/config/annotations \
	--arch amd64 --flavour generic --check /<<PKGBUILDDIR>>/debian/build/build-generic/.config
check-config: loading annotations from /<<PKGBUILDDIR>>/debian.master/config/annotations
check-config: CONFIG_AX88796B_RUST_PHY changed from n to -: policy<{'amd64': 'n'}>)
check-config: CONFIG_CONSTRUCTORS changed from y to -: policy<{'amd64': 'y'}>)
check-config: CONFIG_DEBUG_INFO_COMPRESSED_ZSTD changed from n to -: policy<{'amd64': 'n', 'arm64': 'n', 'armhf': 'n', 'ppc64el': 'n', 'riscv64': 'n', 's390x': 'n'}>)
check-config: CONFIG_PAHOLE_HAS_LANG_EXCLUDE changed from y to -: policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'y', 'ppc64el': 'y', 'riscv64': 'y', 's390x': 'y'}>)
check-config: CONFIG_RUST changed from y to -: policy<{'amd64': 'y'}>)
check-config: CONFIG_RUST_BUILD_ASSERT_ALLOW changed from n to -: policy<{'amd64': 'n'}>)
check-config: CONFIG_RUST_DEBUG_ASSERTIONS changed from n to -: policy<{'amd64': 'n'}>)
check-config: CONFIG_RUST_OVERFLOW_CHECKS changed from y to -: policy<{'amd64': 'y'}>)
check-config: CONFIG_RUST_PHYLIB_ABSTRACTIONS changed from y to -: policy<{'amd64': 'y'}>)
check-config: CONFIG_SAMPLES_RUST changed from n to -: policy<{'amd64': 'n'}>)
check-config: CONFIG_TOOLS_SUPPORT_RELR changed from y to -: policy<{'amd64': 'y', 'ppc64el': 'y'}>)
check-config: 11 config options have changed
make: *** [debian/rules.d/4-checks.mk:15: config-prepare-check-generic] Error 1
...

This is frustrating to no end. It seems that the the expected kernel config is impossible as explained below:

Rust support (config RUST) gets disabled as below by config DEBUG_INFO_BTF set to y:

# grep "config RUST$" init/Kconfig -A10
config RUST
	bool "Rust support"
	depends on HAVE_RUST
	depends on RUST_IS_AVAILABLE
	depends on !GCC_PLUGINS
	depends on !RANDSTRUCT
	depends on !DEBUG_INFO_BTF || PAHOLE_HAS_LANG_EXCLUDE
	select CONSTRUCTORS
	help
	  Enables Rust support in the kernel.

However config DEBUG_INFO_BTF is expected to be y in the annotations:

# grep -E 'DEBUG_INFO_BTF\>\s*\<policy' debian.master/config/annotations 
CONFIG_DEBUG_INFO_BTF                           policy<{'amd64': 'y', 'arm64': 'y', 'armhf': 'n', 'ppc64el': 'y', 'riscv64': 'y', 's390x': 'y'}>

Also config RUST is expected to be y at the same time, which is impossible as shown in the Kconfig snippet for config RUST above:

# grep -E 'CONFIG_RUST\>\s*\<policy' debian.master/config/annotations 
CONFIG_RUST                                     policy<{'amd64': 'y'}>

What I don't understand is that how are the mainline kernels building despite the same config , as seen at https://launchpad.net/~canonical-kernel-team/+archive/ubuntu/bootstrap/+build/27917183/+files/buildlog_ubuntu-noble-amd64.linux_6.8.0-19.19_BUILDING.txt.gz (via https://launchpad.net/~canonical-kernel-team/+archive/ubuntu/bootstrap/+build/27917183)

samveen avatar Mar 19 '24 06:03 samveen