Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Detecting Linux Kernel version in CI test container #93273

Closed
2 tasks done
XuehaiPan opened this issue Jan 17, 2022 · 4 comments
Closed
2 tasks done

Detecting Linux Kernel version in CI test container #93273

XuehaiPan opened this issue Jan 17, 2022 · 4 comments
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age

Comments

@XuehaiPan
Copy link
Contributor

XuehaiPan commented Jan 17, 2022

brew gist-logs <formula> link OR brew config AND brew doctor output

linuxbrew@ubuntu:~$ brew config
HOMEBREW_VERSION: 3.3.10
ORIGIN: https://github.com/Homebrew/brew
HEAD: 385892f3d27dcab0f5a1cb47c3927d9d65ed007c
Last commit: 6 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 616d606702e9cbe9135fee3a5cacbe9e4e7425e5
Core tap last commit: 6 days ago
Core tap branch: master
HOMEBREW_PREFIX: /home/linuxbrew/.linuxbrew
HOMEBREW_CASK_OPTS: []
HOMEBREW_CORE_GIT_REMOTE: https://github.com/Homebrew/homebrew-core
HOMEBREW_MAKE_JOBS: 12
Homebrew Ruby: 2.6.8 => /home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/vendor/portable-ruby/2.6.8/bin/ruby
CPU: dodeca-core 64-bit skylake
Clang: N/A
Git: 2.34.1 => /usr/bin/git
Curl: 7.47.0 => /usr/bin/curl
Kernel: Linux 5.11.0-46-generic x86_64 GNU/Linux
OS: Ubuntu 16.04.7 LTS (xenial)
Host glibc: 2.23
/usr/bin/gcc: 5.4.0
/usr/bin/ruby: N/A
glibc: N/A
gcc@5: N/A
xorg: N/A
linuxbrew@ubuntu:~$ brew doctor
Your system is ready to brew.

Verification

  • I ran brew update and am still able to reproduce my issue.
  • I have resolved all warnings from brew doctor and that did not fix my problem.

What were you trying to do (and why)?

Detect Linux Kernel version in CI test container (install requires a minimal kernel header version requirement (Linux kernel header version >= 4.6)).

The Linux CI test container is based on Ubuntu 16.04, the kernel header version is 4.4.

What happened (include all command output)?

linuxbrew@ubuntu:~$ cat /etc/*-release
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.7 LTS"
NAME="Ubuntu"
VERSION="16.04.7 LTS (Xenial Xerus)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 16.04.7 LTS"
VERSION_ID="16.04"
HOME_URL="http://www.ubuntu.com/"
SUPPORT_URL="http://help.ubuntu.com/"
BUG_REPORT_URL="http://bugs.launchpad.net/ubuntu/"
VERSION_CODENAME=xenial
UBUNTU_CODENAME=xenial

linuxbrew@ubuntu:~$ dpkg -l | grep linux
ii  libselinux1:amd64           2.4-3build2                           amd64        SELinux runtime shared libraries
ii  linux-libc-dev:amd64        4.4.0-210.242                         amd64        Linux Kernel Headers for development
ii  util-linux                  2.27.1-6ubuntu3.10                    amd64        miscellaneous system utilities

linuxbrew@ubuntu:~$ brew irb
Warning: irb is a developer command, so
Homebrew's developer mode has been automatically turned on.
To turn developer mode off, run brew developer off

==> Interactive Homebrew Shell
Example commands available with: `brew irb --examples`
irb(main):001:0> OS.kernel_version
=> #<Version:0x0000000003274e78 @version="5.11.0-46-generic", @detected_from_url=false>
irb(main):002:0> OS.kernel_version >= '4.6'
=> true
irb(main):003:0> 

What did you expect to happen?

linuxbrew@ubuntu:~$ brew irb
Warning: irb is a developer command, so
Homebrew's developer mode has been automatically turned on.
To turn developer mode off, run brew developer off

==> Interactive Homebrew Shell
Example commands available with: `brew irb --examples`
irb(main):002:0> OS.kernel_version >= '4.6'
=> false
irb(main):003:0> 

Step-by-step reproduction instructions (by running brew commands)

docker run -it --rm -h ubuntu --pull always ghcr.io/homebrew/ubuntu16.04:latest
brew irb
OS.kernel_version >= '4.6'
@XuehaiPan XuehaiPan added the bug Reproducible Homebrew/homebrew-core bug label Jan 17, 2022
@XuehaiPan
Copy link
Contributor Author

NOTE: docker containers do not have a kernel, the container uses the host system's kernel.

@SMillerDev
Copy link
Member

SMillerDev commented Jan 17, 2022

I don't see how this is a bug. Other than dropping support for older Linux kernels there's nothing we can do right?

@XuehaiPan
Copy link
Contributor Author

XuehaiPan commented Jan 17, 2022

I don't see how this is a bug. Other than dropping support for older Linux kernels there's nothing we can do right?

@SMillerDev I see. I'm trying to disable some features that require a new Linux kernel when the requirements are not satisfied (e.g., let CI test pass and build bottles in our Ubuntu 16.04 container). But also allows users who want to try out the new features when building from source on their own machine. (#90921 (comment))

Is there a general policy for runtime requirements when Homebrew cannot be self-contained (e.g., Linux Kernel requirements)?

  1. Ship bottles with some features disabled but allow users to build from source themself.
  2. Disable the feature all the time (the user needs to brew edit <formula> to hack the install recipe).

@SMillerDev
Copy link
Member

Building from source is not supported (people should use bottles) so this isn't really a supported usecase. If people want to use different features they can edit the formula.

@github-actions github-actions bot added the outdated PR was locked due to age label Feb 17, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 17, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Reproducible Homebrew/homebrew-core bug outdated PR was locked due to age
Projects
None yet
Development

No branches or pull requests

2 participants