[PATCH for-4.15] automation: Fix the Alpine clang builds to use clang

Andrew Cooper posted 1 patch 3 years, 1 month ago
Test gitlab-ci passed
Patches applied successfully (tree, apply log)
git fetch https://gitlab.com/xen-project/patchew/xen tags/patchew/20210226110233.27991-1-andrew.cooper3@citrix.com
automation/gitlab-ci/build.yaml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH for-4.15] automation: Fix the Alpine clang builds to use clang
Posted by Andrew Cooper 3 years, 1 month ago
Looks like a copy&paste error.

Fixes: f6e1d8515d7 ("automation: add alpine linux x86 build jobs")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Doug Goldstein <cardoe@cardoe.com>
CC: Ian Jackson <iwj@xenproject.org>
CC: Stefano Stabellini <sstabellini@kernel.org>
---
 automation/gitlab-ci/build.yaml | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
index d00b8a5123..23ab81d892 100644
--- a/automation/gitlab-ci/build.yaml
+++ b/automation/gitlab-ci/build.yaml
@@ -443,13 +443,13 @@ alpine-3.12-gcc-debug:
   allow_failure: true
 
 alpine-3.12-clang:
-  extends: .gcc-x86-64-build
+  extends: .clang-x86-64-build
   variables:
     CONTAINER: alpine:3.12
   allow_failure: true
 
 alpine-3.12-clang-debug:
-  extends: .gcc-x86-64-build-debug
+  extends: .clang-x86-64-build-debug
   variables:
     CONTAINER: alpine:3.12
   allow_failure: true
-- 
2.11.0


Re: [PATCH for-4.15] automation: Fix the Alpine clang builds to use clang
Posted by Stefano Stabellini 3 years, 1 month ago
On Fri, 26 Feb 2021, Andrew Cooper wrote:
> Looks like a copy&paste error.
> 
> Fixes: f6e1d8515d7 ("automation: add alpine linux x86 build jobs")
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Thanks for the patch and of course it is correct

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


However unfortunately it breaks the Alpine Linux gitlab-ci again :-(
I created a branch with Roger's patches plus this patch. The two clang
Alpine Linux build jobs fail:

https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/1059686530
https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/1059686532


The error is the following:

<built-in>:3:10: fatal error: 'cstring' file not found
#include "cstring"
         ^~~~~~~~~
1 error generated.
make[10]: *** [Makefile:120: headers++.chk] Error 1
make[10]: *** Waiting for unfinished jobs....







> ---
> CC: Doug Goldstein <cardoe@cardoe.com>
> CC: Ian Jackson <iwj@xenproject.org>
> CC: Stefano Stabellini <sstabellini@kernel.org>
> ---
>  automation/gitlab-ci/build.yaml | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/automation/gitlab-ci/build.yaml b/automation/gitlab-ci/build.yaml
> index d00b8a5123..23ab81d892 100644
> --- a/automation/gitlab-ci/build.yaml
> +++ b/automation/gitlab-ci/build.yaml
> @@ -443,13 +443,13 @@ alpine-3.12-gcc-debug:
>    allow_failure: true
>  
>  alpine-3.12-clang:
> -  extends: .gcc-x86-64-build
> +  extends: .clang-x86-64-build
>    variables:
>      CONTAINER: alpine:3.12
>    allow_failure: true
>  
>  alpine-3.12-clang-debug:
> -  extends: .gcc-x86-64-build-debug
> +  extends: .clang-x86-64-build-debug
>    variables:
>      CONTAINER: alpine:3.12
>    allow_failure: true
> -- 
> 2.11.0
> 

Re: [PATCH for-4.15] automation: Fix the Alpine clang builds to use clang
Posted by Jan Beulich 3 years ago
On 26.02.2021 23:48, Stefano Stabellini wrote:
> On Fri, 26 Feb 2021, Andrew Cooper wrote:
>> Looks like a copy&paste error.
>>
>> Fixes: f6e1d8515d7 ("automation: add alpine linux x86 build jobs")
>> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> 
> Thanks for the patch and of course it is correct
> 
> Acked-by: Stefano Stabellini <sstabellini@kernel.org>
> 
> 
> However unfortunately it breaks the Alpine Linux gitlab-ci again :-(
> I created a branch with Roger's patches plus this patch. The two clang
> Alpine Linux build jobs fail:
> 
> https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/1059686530
> https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/1059686532
> 
> 
> The error is the following:
> 
> <built-in>:3:10: fatal error: 'cstring' file not found
> #include "cstring"
>          ^~~~~~~~~
> 1 error generated.
> make[10]: *** [Makefile:120: headers++.chk] Error 1
> make[10]: *** Waiting for unfinished jobs....

Doesn't this suggest there's a C++ compiler installed without
the headers also being available? The headers++.chk rule
requires neither or both to be present.

Jan

Re: [PATCH for-4.15] automation: Fix the Alpine clang builds to use clang
Posted by Roger Pau Monné 3 years ago
On Mon, Mar 01, 2021 at 09:58:48AM +0100, Jan Beulich wrote:
> On 26.02.2021 23:48, Stefano Stabellini wrote:
> > On Fri, 26 Feb 2021, Andrew Cooper wrote:
> >> Looks like a copy&paste error.
> >>
> >> Fixes: f6e1d8515d7 ("automation: add alpine linux x86 build jobs")
> >> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> > 
> > Thanks for the patch and of course it is correct
> > 
> > Acked-by: Stefano Stabellini <sstabellini@kernel.org>
> > 
> > 
> > However unfortunately it breaks the Alpine Linux gitlab-ci again :-(
> > I created a branch with Roger's patches plus this patch. The two clang
> > Alpine Linux build jobs fail:
> > 
> > https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/1059686530
> > https://gitlab.com/xen-project/people/sstabellini/xen/-/jobs/1059686532
> > 
> > 
> > The error is the following:
> > 
> > <built-in>:3:10: fatal error: 'cstring' file not found
> > #include "cstring"
> >          ^~~~~~~~~
> > 1 error generated.
> > make[10]: *** [Makefile:120: headers++.chk] Error 1
> > make[10]: *** Waiting for unfinished jobs....
> 
> Doesn't this suggest there's a C++ compiler installed without
> the headers also being available? The headers++.chk rule
> requires neither or both to be present.

Right, that's because the include path for clang++ seems to rely on
the gcc c++ headers:

#include <...> search starts here:
 /usr/bin/../lib/gcc/x86_64-alpine-linux-musl/10.2.1/../../../../include/c++/10.2.1
 /usr/bin/../lib/gcc/x86_64-alpine-linux-musl/10.2.1/../../../../include/c++/10.2.1/x86_64-alpine-linux-musl
 /usr/bin/../lib/gcc/x86_64-alpine-linux-musl/10.2.1/../../../../include/c++/10.2.1/backward
 /usr/include
 /usr/lib/clang/10.0.1/include

It's solved by installing g++, I will prepare a patch against the
docker file. I've got no idea why clang doesn't install the required
c++ headers (or simply pull in g++ if that's required).

It's unrelated to the -ffreestanding issue.

Roger.