-
Notifications
You must be signed in to change notification settings - Fork 561
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
build: use clang for public build #2730
Conversation
The compilation error mentioned in the OP is:
possibly related to the above: scylladb/seastar#634 |
This pull request has been linked to Shortcut Story #5493: build: move public build to clang. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks pretty good, just a couple of comments.
Will this have the github workflow reenabled?
build.sh
Outdated
@@ -24,4 +24,4 @@ cmake -DCMAKE_BUILD_TYPE=Release \ | |||
-DDEPOT_TOOLS_DIR="$root/depot_tools" \ | |||
"$@" | |||
|
|||
(cd $root/build && ninja && ctest --output-on-failure -R _rpunit) | |||
(cd $root/build && ninja && LD_LIBRARY_PATH=$PWD/deps_install/lib ctest --output-on-failure -R _rpunit) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know why this is needed, the dependencies should be found by the RPATH.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, i'll double check that it's needed. i recall it was required when i was working with this earlier but then a bunch of changes went in and didn't check if removing it would still make it
build.sh
Outdated
@@ -24,7 +24,7 @@ cmake -DCMAKE_BUILD_TYPE=Release \ | |||
-GNinja \ | |||
-DCMAKE_C_COMPILER=$CC \ | |||
-DCMAKE_CXX_COMPILER=$CXX \ | |||
-DDEPOT_TOOLS_DIR="$root/depot_tools" \ | |||
-DDEPOT_TOOLS_DIR="/opt/depot_tools" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: Having the root configurable would allow building outside of a containerised env.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, i'll add a variable
d534cbf
to
2b3c743
Compare
2b3c743
to
731728b
Compare
731728b
to
4020671
Compare
Signed-off-by: Ivo Jimenez <[email protected]>
For public build, ignore errors coming from warnings for seastar compilation Signed-off-by: Ivo Jimenez <[email protected]>
Signed-off-by: Ivo Jimenez <[email protected]>
Signed-off-by: Ivo Jimenez <[email protected]>
Adds a Dockerfile of an image that has all compilation dependencies. This installs clang-12, libstdc++11.2.1 on fedora:34 Signed-off-by: Ivo Jimenez <[email protected]>
Signed-off-by: Ivo Jimenez <[email protected]>
31dc10d
to
878715c
Compare
@ivotron even if is just the |
all looks good, the only problem now is that the vm on github is not powerful enough for building in a reasonable amount of time, and also looks like there are some unit test errors popping up due to the same (all tests pass locally). so I've added the required tweaks to the workflow but haven't enabled it. I think we should merge and then add an issue for CI-ing the public build |
do you mean, just having the build work fine, even if this can't run fine in github actions? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking pretty good
key: ${{ matrix.container }}-ccache-${{ steps.prepare_cache_variables.outputs.timestamp }} | ||
restore-keys: ${{ matrix.container }}-ccache- | ||
path: /dev/shm/redpanda | ||
key: ccache-${{github.ref}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this fallback to dev
if this fails?
2021-11-01T01:22:13.6661837Z Cache not found for input keys: ccache-refs/pull/2730/merge, ccache
Maybe it's not necessary/there's no key for dev: https://docs.github.com/en/actions/advanced-guides/caching-dependencies-to-speed-up-workflows#matching-a-cache-key
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah, it'll check whether there's one for dev when an entry for the current pr's gitref is not present
install-dependencies.sh
Outdated
|
||
rm -rf $root/depot_tools | ||
mkdir -p /opt/ | ||
rm -rf /opt/depot_tools |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this file use $DEPOT_TOOLS_DIR
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh, right. gonna change
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
fi | ||
|
||
ccache -p # print the config | ||
ccache -s # print the stats before reusing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2021-11-01T01:22:14.2219376Z max cache size 200.0 MB
Is this sufficient?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i don't know tbh, i haven't profiled after the changes in this pr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I'm not convinced it's working properly, it seems quite small:
files in cache 732
cache size 29.7 MB
max cache size 5.0 GB
Add a DEPOT_TOOLS_DIR variable that contains the path to where it is placed and have it be `/opt/depot_tools` by default, to make it consistent with the way other dependencies are installed for the public build. Signed-off-by: Ivo Jimenez <[email protected]>
For the public build, change message shown when installing dependencies. Signed-off-by: Ivo Jimenez <[email protected]>
Public build assumes clang-12. Also adds a reference to instructions for using the pre-baked docker image with the frozen toolchain Signed-off-by: Ivo Jimenez <[email protected]>
Point to newest version on vectorizedio fork. Signed-off-by: Ivo Jimenez <[email protected]>
Make use of the container image introduced recently, which uses clang to build redpanda. Signed-off-by: Ivo Jimenez <[email protected]>
Use git ref as part of the key and remove timestamp. The current limit from Github is 5GB for all cached files across a repository. With this change, there is only one ccache file uploaded per branch, instead of one for each distinct build. This results in having one for the main branch, as well as one per PR. Signed-off-by: Ivo Jimenez <[email protected]>
Signed-off-by: Ivo Jimenez <[email protected]>
The host doesn't have ccache installed anymore Signed-off-by: Ivo Jimenez <[email protected]>
878715c
to
4534358
Compare
No. I agree with your assessment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to get a one-off run of this workflow?
some tests are failing when executed by the workflow: https://github.com/vectorizedio/redpanda/actions/runs/1406061645. i haven't looked deeper but it seems like the constrained environment might be the root cause |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, the build seems to do the correct thing.
Should the ducktape tests be run? |
@ivotron @dotnwat @BenPope is all this running successfully inside a docker container? I might be wrong, my perception is there are differences when running inside a docker container. For community support, I'm inclined to think a docker container is needed? To ensure a common point of reference for everyone? |
Yes, see the instructions: https://github.com/vectorizedio/redpanda/pull/2730/files#diff-5701757eb2f837a5f4ae8d1e1989a60593fa5d6b2b15580b704a641c5ad6a0c2 To test this PR: sudo sysctl -w fs.aio-max-nr=10485760
docker build \
-t vectorized/redpanda-toolchain \
-f tools/docker/Dockerfile \
.
docker run --ipc=host --rm -ti -v $PWD:$PWD:Z -w $PWD vectorized/redpanda-toolchain ./build.sh I'm not sure what changed when, and the current state of the builder image, but you might get away with:
|
yes, moving to buildkite or self-hosted github runner would help #2852 |
Tweaks the installed dependencies and cmake config of public build so that it uses clang. A Dockerfile is also included that defines a fedora:34 image with llvm-12 and libstdc++-11.2.1. This combination is known to work well for seastar (see scylladb/scylladb@3089558).
A PR on our avro fork is required in order to have Avro compiled correctly. There are still some compilation issues that need to be resolved related to
seastar/core/sstring.hh
used inv::random::generators
. Thus, this PR is marked as draft until these get resolved.fixes #1772