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

Better parsing for clang version #190

Merged
merged 2 commits into from
Mar 14, 2024
Merged

Better parsing for clang version #190

merged 2 commits into from
Mar 14, 2024

Conversation

leitao
Copy link
Contributor

@leitao leitao commented Mar 14, 2024

My development environment uses clang from git, and meson fails with the following error:

meson setup build --prefix ~
The Meson build system
Version: 1.4.0

<snip>


meson.build:44:44: ERROR: String '' cannot be converted to int

Fix this problem by expanding how get_clang_ver parses of clang version

In my dev enviroment, bpf_clang_ver is coming as NULL, since I am using
upstream Clang. Fails graceful in this case.

	#  /usr/local/bin/clang --version
	clang version 18.0.0git (https://github.com/llvm/llvm-project.git c458f928fad7bbcf08ab1da9949eb2969fc9f89c)
	Target: x86_64-unknown-linux-gnu
	Thread model: posix
	InstalledDir: /usr/local/bin

But the command below returns nothing
	/home/leit/Devel/scx/meson-scripts/get_clang_ver /usr/local/bin/clang

Signed-off-by: Breno Leitao <leitao@debian.org>
get_clang_ver fails if clang is built from scratch.

Teach get_clang_ver to recognize the clang version even for clang built
from git.

These are the tests I ran:

	# /usr/local/bin/clang --version
	clang version 18.0.0git (https://github.com/llvm/llvm-project.git c458f928fad7bbcf08ab1da9949eb2969fc9f89c)
	# meson-scripts/get_clang_ver /usr/local/bin/clang
	18.0.0

	# /usr/bin/clang --version
	clang version 17.0.6 (CentOS 17.0.6-5.el9)
	# meson-scripts/get_clang_ver /usr/bin/clang
	17.0.6

Signed-off-by: Breno Leitao <leitao@debian.org>
@htejun htejun merged commit e4dbc22 into sched-ext:main Mar 14, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants