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

enable Debian 12 and bump llvm version to swift-5.6.3 #298

Merged
merged 4 commits into from
Jun 19, 2023

Conversation

v1v
Copy link
Member

@v1v v1v commented Jun 12, 2023

What

Does what it says in the tin.

Why

Debian 12 has been released early June 2023: https://www.debian.org/News/2023/20230610

Issues

Requires debuerreotype/docker-debian-artifacts#196

Implementation details

Debian 12 is needed to be added in some of the Dockerfile templates so the packages are installed for that particular version. For such, I looked for debian 11 and added the condition for debian 12

llvm for Debian 12 is also required, hence llvm-apple-mbp needs to be triggered too.

llvm for Debian 12 failed with some missing imports, see https://reviews.llvm.org/D89450 and #298 (comment), so it was required to bump the version for https://github.com/apple/llvm-project to swift-5.6.3-RELEASE.

Once llvm-apple-mpb@PR-298 is finished, we could manually re-tag those docker images for Debian 12 so it can be consumed accordingly.

Otherwise

$ make -C go -f Makefile.debian12 build
...
...
>> Building docker.elastic.co/beats-dev/golang-crossbuild:1.20.5-darwin-debian12
[+] Building 1.9s (5/5) FINISHED                                                                                                                                                                                                                              
 => [internal] load build definition from Dockerfile                                                                                                                                                                                                     0.0s
 => => transferring dockerfile: 2.22kB                                                                                                                                                                                                                   0.0s
 => [internal] load .dockerignore                                                                                                                                                                                                                        0.0s
 => => transferring context: 2B                                                                                                                                                                                                                          0.0s
 => ERROR [internal] load metadata for docker.elastic.co/beats-dev/golang-crossbuild:llvm-apple-debian12-amd64                                                                                                                                           1.8s
 => [internal] load metadata for docker.elastic.co/beats-dev/golang-crossbuild:1.20.5-base-debian12                                                                                                                                                      0.0s
 => [auth] beats-dev/golang-crossbuild:pull token for docker.elastic.co                                                                                                                                                                                  0.0s
------
 > [internal] load metadata for docker.elastic.co/beats-dev/golang-crossbuild:llvm-apple-debian12-amd64:
------
failed to solve with frontend dockerfile.v0: failed to create LLB definition: docker.elastic.co/beats-dev/golang-crossbuild:llvm-apple-debian12-amd64: not found
make[1]: *** [build] Error 1
make: *** [build] Error 1

Then

$ docker pull docker.elastic.co/observability-ci/golang-crossbuild:llvm-apple-debian12-amd64 
$ docker tag docker.elastic.co/observability-ci/golang-crossbuild:llvm-apple-debian12-amd64 docker.elastic.co/beats-dev/golang-crossbuild:llvm-apple-debian12-amd64
$ docker push docker.elastic.co/beats-dev/golang-crossbuild:llvm-apple-debian12-amd64
$ docker pull docker.elastic.co/observability-ci/golang-crossbuild:llvm-apple-debian12-arm64 
$ docker tag docker.elastic.co/observability-ci/golang-crossbuild:llvm-apple-debian12-arm64 docker.elastic.co/beats-dev/golang-crossbuild:llvm-apple-debian12-arm64
$ docker push docker.elastic.co/beats-dev/golang-crossbuild:llvm-apple-debian12-arm64

And I re-triggered the MBP build for this PR.

@v1v v1v self-assigned this Jun 12, 2023
@mergify
Copy link

mergify bot commented Jun 12, 2023

This pull request does not have a backport label. Could you fix it @v1v? 🙏
To fixup this pull request, you need to add the backport labels for the needed
branches, such as:

  • backport-v./d./d is the label to automatically backport to the 1./d branch. /d is the digit
    NOTE: backport-skip has been added to this pull request.

@v1v v1v added backport-v1.19 enhancement New feature or request and removed backport-skip labels Jun 12, 2023
@elasticmachine
Copy link

elasticmachine commented Jun 12, 2023

💚 Build Succeeded

the below badges are clickable and redirect to their specific view in the CI or DOCS
Pipeline View Test View Changes Artifacts preview preview

Expand to view the summary

Build stats

  • Start Time: 2023-06-14T08:16:07.178+0000

  • Duration: 49 min 57 sec

🤖 GitHub comments

Expand to view the GitHub comments

To re-run your PR in the CI, just comment with:

  • /test : Re-trigger the build.

@v1v
Copy link
Member Author

v1v commented Jun 13, 2023

There are some errors with the LLVM for Debian 12:

[2023-06-13T14:45:26.654Z] #9 13979.1 [100%] Linking CXX executable ../../bin/yaml2obj
[2023-06-13T14:45:26.955Z] #9 13979.5 [100%] Built target yaml2obj
[2023-06-13T14:45:27.056Z] #9 13979.5 [100%] Building CXX object utils/benchmark/src/CMakeFiles/benchmark.dir/benchmark.cc.o
[2023-06-13T14:45:29.867Z] #9 13982.5 [100%] Building CXX object utils/benchmark/src/CMakeFiles/benchmark.dir/benchmark_register.cc.o
[2023-06-13T14:45:30.469Z] #9 13983.0 In file included from /tmp/llvm-project/llvm/utils/benchmark/src/benchmark_register.cc:15:
[2023-06-13T14:45:30.469Z] #9 13983.0 /tmp/llvm-project/llvm/utils/benchmark/src/benchmark_register.h: In function 'void AddRange(std::vector<T>*, T, T, int)':
[2023-06-13T14:45:30.469Z] #9 13983.0 /tmp/llvm-project/llvm/utils/benchmark/src/benchmark_register.h:17:30: error: 'numeric_limits' is not a member of 'std'
[2023-06-13T14:45:30.469Z] #9 13983.0    17 |   static const T kmax = std::numeric_limits<T>::max();
[2023-06-13T14:45:30.469Z] #9 13983.0       |                              ^~~~~~~~~~~~~~
[2023-06-13T14:45:30.469Z] #9 13983.0 /tmp/llvm-project/llvm/utils/benchmark/src/benchmark_register.h:17:46: error: expected primary-expression before '>' token
[2023-06-13T14:45:30.469Z] #9 13983.0    17 |   static const T kmax = std::numeric_limits<T>::max();
[2023-06-13T14:45:30.469Z] #9 13983.0       |                                              ^
[2023-06-13T14:45:30.469Z] #9 13983.0 /tmp/llvm-project/llvm/utils/benchmark/src/benchmark_register.h:17:49: error: '::max' has not been declared; did you mean 'std::max'?
[2023-06-13T14:45:30.469Z] #9 13983.0    17 |   static const T kmax = std::numeric_limits<T>::max();
[2023-06-13T14:45:30.469Z] #9 13983.0       |                                                 ^~~
[2023-06-13T14:45:30.469Z] #9 13983.0       |                                                 std::max
[2023-06-13T14:45:30.469Z] #9 13983.0 In file included from /usr/include/c++/12/algorithm:61,
[2023-06-13T14:45:30.469Z] #9 13983.0                  from /tmp/llvm-project/llvm/utils/benchmark/include/benchmark/benchmark.h:175,
[2023-06-13T14:45:30.469Z] #9 13983.0                  from /tmp/llvm-project/llvm/utils/benchmark/src/internal_macros.h:4,
[2023-06-13T14:45:30.469Z] #9 13983.0                  from /tmp/llvm-project/llvm/utils/benchmark/src/check.h:8,
[2023-06-13T14:45:30.469Z] #9 13983.0                  from /tmp/llvm-project/llvm/utils/benchmark/src/benchmark_register.h:6:
[2023-06-13T14:45:30.469Z] #9 13983.0 /usr/include/c++/12/bits/stl_algo.h:5756:5: note: 'std::max' declared here
[2023-06-13T14:45:30.469Z] #9 13983.0  5756 |     max(initializer_list<_Tp> __l, _Compare __comp)
[2023-06-13T14:45:30.469Z] #9 13983.0       |     ^~~
[2023-06-13T14:45:31.573Z] #9 13984.1 gmake[2]: *** [utils/benchmark/src/CMakeFiles/benchmark.dir/build.make:90: utils/benchmark/src/CMakeFiles/benchmark.dir/benchmark_register.cc.o] Error 1
[2023-06-13T14:45:31.674Z] #9 13984.1 gmake[1]: *** [CMakeFiles/Makefile2:31910: utils/benchmark/src/CMakeFiles/benchmark.dir/all] Error 2
[2023-06-13T14:45:31.674Z] #9 13984.1 gmake: *** [Makefile:156: all] Error 2
[2023-06-13T14:45:31.875Z] #9 ERROR: process "/bin/sh -c mkdir -p /tmp/llvm-project && cd /tmp/llvm-project     && curl -sSL \"https://github.com/apple/llvm-project/archive/refs/tags/swift-5.4.1-RELEASE.tar.gz\"       | tar -C /tmp/llvm-project --strip=1 -xzf -     && mkdir build && cd build     && cmake -DLLVM_ENABLE_PROJECTS=\"clang\"       -DCMAKE_BUILD_TYPE=\"Release\"       -DLLVM_TARGETS_TO_BUILD=\"X86;AArch64\"       -DLLVM_INCLUDE_TESTS=OFF       -DLLVM_INCLUDE_EXAMPLES=Off       -DLLVM_ENABLE_BACKTRACES=Off       -DLLVM_BUILD_32_BITS=OFF       /tmp/llvm-project/llvm     && cmake --build .     && cmake --build . --target package     && tar -xzf LLVM-*-Linux.tar.gz --strip 1 -C /usr/local" did not complete successfully: exit code: 2
[2023-06-13T14:45:31.875Z] ------
[2023-06-13T14:45:31.875Z]  > [build_llvm_apple 3/6] RUN mkdir -p /tmp/llvm-project && cd /tmp/llvm-project     && curl -sSL "https://github.com/apple/llvm-project/archive/refs/tags/swift-5.4.1-RELEASE.tar.gz"       | tar -C /tmp/llvm-project --strip=1 -xzf -     && mkdir build && cd build     && cmake -DLLVM_ENABLE_PROJECTS="clang"       -DCMAKE_BUILD_TYPE="Release"       -DLLVM_TARGETS_TO_BUILD="X86;AArch64"       -DLLVM_INCLUDE_TESTS=OFF       -DLLVM_INCLUDE_EXAMPLES=Off       -DLLVM_ENABLE_BACKTRACES=Off       -DLLVM_BUILD_32_BITS=OFF       /tmp/llvm-project/llvm     && cmake --build .     && cmake --build . --target package     && tar -xzf LLVM-*-Linux.tar.gz --strip 1 -C /usr/local:
[2023-06-13T14:45:31.875Z] #9 13983.0                  from /tmp/llvm-project/llvm/utils/benchmark/include/benchmark/benchmark.h:175,
[2023-06-13T14:45:31.875Z] #9 13983.0                  from /tmp/llvm-project/llvm/utils/benchmark/src/internal_macros.h:4,
[2023-06-13T14:45:31.875Z] #9 13983.0                  from /tmp/llvm-project/llvm/utils/benchmark/src/check.h:8,
[2023-06-13T14:45:31.875Z] #9 13983.0                  from /tmp/llvm-project/llvm/utils/benchmark/src/benchmark_register.h:6:
[2023-06-13T14:45:31.875Z] #9 13983.0 /usr/include/c++/12/bits/stl_algo.h:5756:5: note: 'std::max' declared here
[2023-06-13T14:45:31.875Z] #9 13983.0  5756 |     max(initializer_list<_Tp> __l, _Compare __comp)
[2023-06-13T14:45:31.875Z] #9 13983.0       |     ^~~
[2023-06-13T14:45:31.875Z] #9 13984.1 gmake[2]: *** [utils/benchmark/src/CMakeFiles/benchmark.dir/build.make:90: utils/benchmark/src/CMakeFiles/benchmark.dir/benchmark_register.cc.o] Error 1
[2023-06-13T14:45:31.875Z] #9 13984.1 gmake[1]: *** [CMakeFiles/Makefile2:31910: utils/benchmark/src/CMakeFiles/benchmark.dir/all] Error 2
[2023-06-13T14:45:31.875Z] #9 13984.1 gmake: *** [Makefile:156: all] Error 2
[2023-06-13T14:45:31.875Z] ------
[2023-06-13T14:45:31.875Z] Dockerfile:32

https://root-forum.cern.ch/t/compiling-cling-error-numeric-limits-is-not-a-member-of-std/48812

swiftlang/llvm-project@5208ec5 contains the fix from https://github.com/apple/llvm-project/releases/tag/swift-5.6-RELEASE onwards.

@v1v
Copy link
Member Author

v1v commented Jun 14, 2023

/test

1 similar comment
@v1v
Copy link
Member Author

v1v commented Jun 14, 2023

/test

@v1v v1v changed the title enable debian 12 enable Debian 12 and bump llvm version to swift-5.6.3 Jun 14, 2023
@v1v v1v marked this pull request as ready for review June 14, 2023 13:35
@v1v v1v merged commit 1274d03 into elastic:main Jun 19, 2023
mergify bot pushed a commit that referenced this pull request Jun 19, 2023
v1v added a commit that referenced this pull request Jun 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-v1.19 enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants