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

datapath/linux: Fix clang version regex check #14742

Merged

Conversation

christarazi
Copy link
Member

This fixes the following error when the machine has clang 11.0.1
installed:

level=info msg="Cilium 1.9.90 0bffe8b39 2021-01-26T11:16:34+01:00 go version go1.15.7 linux/amd64" subsys=daemon
level=info msg="Envoy version check disabled" subsys=daemon
level=fatal msg="clang: NOT OK" error="Invalid character(s) found in patch number \"1\\nTarget:\"" subsys=linux-datapath

The issue was that the regex pattern was matching only against " " and
not any other kind of whitespace, especially newlines. Changing the
regex to match against all whitespace, including newlines, the pattern
is able to stop the match at the correct spot. The output it was trying
to match against was:

clang version 11.0.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

Signed-off-by: Chris Tarazi chris@isovalent.com

This fixes the following error when the machine has clang 11.0.1
installed:

```
level=info msg="Cilium 1.9.90 0bffe8b 2021-01-26T11:16:34+01:00 go version go1.15.7 linux/amd64" subsys=daemon
level=info msg="Envoy version check disabled" subsys=daemon
level=fatal msg="clang: NOT OK" error="Invalid character(s) found in patch number \"1\\nTarget:\"" subsys=linux-datapath
```

The issue was that the regex pattern was matching only against " " and
not any other kind of whitespace, especially newlines. Changing the
regex to match against all whitespace, including newlines, the pattern
is able to stop the match at the correct spot. The output it was trying
to match against was:

```
clang version 11.0.1
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin
```

Signed-off-by: Chris Tarazi <chris@isovalent.com>
@christarazi christarazi requested a review from a team January 26, 2021 22:21
@maintainer-s-little-helper maintainer-s-little-helper bot added the dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. label Jan 26, 2021
@maintainer-s-little-helper maintainer-s-little-helper bot added this to In progress in 1.10.0 Jan 26, 2021
@christarazi christarazi requested a review from jibi January 26, 2021 22:21
@christarazi christarazi added area/misc Impacts miscellaneous areas of the code not otherwise owned by another area. kind/bug This is a bug in the Cilium logic. release-note/misc This PR makes changes that have no direct user impact. sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages. and removed dont-merge/needs-release-note-label The author needs to describe the release impact of these changes. labels Jan 26, 2021
@christarazi
Copy link
Member Author

test-me-please

@tklauser
Copy link
Member

tklauser commented Jan 27, 2021

@christarazi christarazi added the ready-to-merge This PR has passed all tests and received consensus from code owners to merge. label Jan 27, 2021
@aanm aanm merged commit 57a4831 into cilium:master Jan 28, 2021
@christarazi christarazi deleted the pr/christarazi/fix-clang-version-check branch January 28, 2021 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/misc Impacts miscellaneous areas of the code not otherwise owned by another area. kind/bug This is a bug in the Cilium logic. ready-to-merge This PR has passed all tests and received consensus from code owners to merge. release-note/misc This PR makes changes that have no direct user impact. sig/datapath Impacts bpf/ or low-level forwarding details, including map management and monitor messages.
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

5 participants