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

ci: make easier the debugging of the docker-alpine-musl-gcc job #23399

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/Dockerfile.ci_alpine_local
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#######################################################################################
## The goal of this file, is to provide an easy and reproducible way to check *locally*
## the CI job `docker-alpine-musl-gcc`
## Building the docker image:
## docker build -t ci_alpine_local - < .github/workflows/Dockerfile.ci_alpine_local
## Running the docker image, after building it:
## docker run --rm -it -v .:/opt/vlang -w /opt/vlang ci_alpine_local
## Once it is running, inside the container you can:
## make && v -e 'println(2+2)'
## ... then do whatever you need to reproduce the CI test failure.
## Note: after you are finished, and exit the container, run `make` again, otherwise
## you will be using V (and potentially V tools) that were compiled with musl.
#######################################################################################
FROM thevlang/vlang:alpine-build

LABEL maintainer="spytheman <[email protected]>"

WORKDIR /opt/vlang

ENV PATH /opt/vlang:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

## install development packages
RUN apk --no-cache add \
musl-dev libc-dev libc6-compat gcompat \
libunwind-dev libunwind-static \
gc gc-dev \
binutils diffutils elfutils \
strace gdb \
pcre bash fzf fzf-vim tmux less file colordiff \
vim vim-editorconfig \
nano nano-syntax \
micro

RUN git config --global --add safe.directory /opt/vlang &&\
Comment on lines +32 to +34
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

micro && \
git config --global --add safe.directory /opt/vlang &&\

git config --global --add safe.directory /opt/vlang/vc &&\
git config --global --add safe.directory /opt/vlang/thirdparty/tcc &&\
find /usr/share/nano/ -iname "*.nanorc" -exec echo include {} \; >> ~/.nanorc &&\
micro -plugin install detectindent &&\
micro -plugin install editorconfig &&\
micro -plugin install monokai-dark &&\
micro -plugin install quickfix &&\
micro -plugin install runit &&\
micro -plugin install cheat &&\
micro -plugin install jump &&\
true
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What does this accomplish?

I would finish with apk cache clean to reduce the size of the final image.


## setup runtime environment for v and bash:
ENV VTMP /tmp/v
ENV VMODULES /tmp/vmodules
ENV VFLAGS "-d dynamic_boehm"

CMD ["bash"]
6 changes: 3 additions & 3 deletions .github/workflows/docker_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ env:
V_CI_MUSL: 1

jobs:
alpine-docker-musl-gcc:
docker-alpine-musl-gcc:
runs-on: ubuntu-20.04
timeout-minutes: 241
container:
Expand All @@ -45,15 +45,15 @@ jobs:
echo "C Compiler:"
gcc --version
- name: Add dependencies
run: apk add libc6-compat
run: apk add libc6-compat gcompat gc gc-dev binutils diffutils elfutils
- name: Build V
run: CC=gcc make
- name: All code is formatted
run: VJOBS=1 ./v test-cleancode
- name: Run only essential tests
run: VTEST_JUST_ESSENTIAL=1 ./v test-self

ubuntu-docker-musl:
docker-ubuntu-musl:
runs-on: ubuntu-20.04
timeout-minutes: 121
container:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tools_ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ jobs:
if: ${{ matrix.cc == 'msvc' }}
run: ./v -W -cstrict test-self cmd

ubuntu-docker-musl:
tools-docker-ubuntu-musl:
runs-on: ubuntu-20.04
timeout-minutes: 121
container:
Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/modules/testing/common.v
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ pub fn new_test_session(_vargs string, will_compile bool) TestSession {
$if !macos {
skip_files << 'examples/macos_tray/tray.v'
}
if github_job == 'ubuntu-docker-musl' {
if github_job == 'docker-ubuntu-musl' {
skip_files << 'vlib/net/openssl/openssl_compiles_test.c.v'
skip_files << 'vlib/crypto/ecdsa/ecdsa_test.v'
skip_files << 'vlib/x/ttf/ttf_test.v'
Expand Down
2 changes: 1 addition & 1 deletion vlib/v/gen/golang/tests/golang_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const is_verbose = os.getenv('VTEST_SHOW_CMD') != ''
// TODO: some logic copy pasted from valgrind_test.v and compiler_test.v, move to a module
fn test_golang() {
// this was failing on ubuntu-docker-musl, skip it for now
if github_job == 'ubuntu-docker-musl' {
if github_job in ['docker-ubuntu-musl', 'tools-docker-ubuntu-musl'] {
eprintln('Skipping Go tests')
exit(0)
}
Expand Down
Loading