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

[NO-TICKET] Fix Ruby 2.3 system tests by using Debian 11 bullseye as a base #3541

Merged
merged 1 commit into from
Mar 20, 2024

Conversation

ivoanjo
Copy link
Member

@ivoanjo ivoanjo commented Mar 20, 2024

What does this PR do?

This PR changes our Ruby 2.3 docker image to use Debian 11 "bullseye" as a base instead of Debian 12 "buster".

In #3534 we updated this image but this broke system-tests
(https://github.com/DataDog/dd-trace-rb/actions/runs/8346827939/job/22845592152) because they use an old nokogiri version that fails to build on modern systems (sparklemotion/nokogiri#2105):

$ gem install nokogiri -v '= 1.10.10'

xml_document.c:495:14: error: conflicting types for 'canonicalize'; have 'VALUE(int,  VALUE *, VALUE)' {aka 'long unsigned int(int,  long unsigned int *, long unsigned int)'}
  495 | static VALUE canonicalize(int argc, VALUE* argv, VALUE self)
      |              ^~~~~~~~~~~~
In file included from /usr/include/features.h:489,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdlib.h:26,
                 from ./nokogiri.h:4,
                 from ./xml_document.h:4,
                 from xml_document.c:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:370:1: note: previous declaration of 'canonicalize' with type 'int(double *, const double *)'
  370 | __MATHDECL_1 (int, canonicalize,, (_Mdouble_ *__cx, const _Mdouble_ *__x));
      | ^~~~~~~~~~~~
make: *** [Makefile:240: xml_document.o] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/local/bundle/gems/nokogiri-1.10.10 for inspection.
Results logged to /usr/local/bundle/extensions/x86_64-linux/2.3.0/nokogiri-1.10.10/gem_make.out

Rather than fighting nokogiri or the system-tests app, let's instead gently step back from Debian 12 to 11, which should still buy us plenty of time until we deprecate Ruby 2.3.

Motivation:

Fix CI/system-tests for Ruby 2.3.

Additional Notes:

N/A

How to test the change?

I've locally built the image with

$ docker build . -f Dockerfile-2.3.8 -t some-testing-name

and confirmed that nokogiri successfully installs.

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles
    credentials of any kind, I've requested a review from @DataDog/security-design-and-guidance.
  • This PR doesn't touch any of that.

…a base

**What does this PR do?**

This PR changes our Ruby 2.3 docker image to use Debian 11 "bullseye"
as a base instead of Debian 12 "buster".

In #3534 we updated this
image but this broke system-tests
(https://github.com/DataDog/dd-trace-rb/actions/runs/8346827939/job/22845592152)
because they use an old nokogiri version that fails to build on
modern systems (sparklemotion/nokogiri#2105):

```
$ gem install nokogiri -v '= 1.10.10'

xml_document.c:495:14: error: conflicting types for 'canonicalize'; have 'VALUE(int,  VALUE *, VALUE)' {aka 'long unsigned int(int,  long unsigned int *, long unsigned int)'}
  495 | static VALUE canonicalize(int argc, VALUE* argv, VALUE self)
      |              ^~~~~~~~~~~~
In file included from /usr/include/features.h:489,
                 from /usr/include/x86_64-linux-gnu/bits/libc-header-start.h:33,
                 from /usr/include/stdlib.h:26,
                 from ./nokogiri.h:4,
                 from ./xml_document.h:4,
                 from xml_document.c:1:
/usr/include/x86_64-linux-gnu/bits/mathcalls.h:370:1: note: previous declaration of 'canonicalize' with type 'int(double *, const double *)'
  370 | __MATHDECL_1 (int, canonicalize,, (_Mdouble_ *__cx, const _Mdouble_ *__x));
      | ^~~~~~~~~~~~
make: *** [Makefile:240: xml_document.o] Error 1

make failed, exit code 2

Gem files will remain installed in /usr/local/bundle/gems/nokogiri-1.10.10 for inspection.
Results logged to /usr/local/bundle/extensions/x86_64-linux/2.3.0/nokogiri-1.10.10/gem_make.out
```

Rather than fighting nokogiri or the system-tests app, let's instead
gently step back from Debian 12 to 11, which should still buy us plenty
of time until we deprecate Ruby 2.3.

**Motivation:**

Fix CI/system-tests for Ruby 2.3.

**Additional Notes:**

N/A

**How to test the change?**

I've locally built the image with

```bash
$ docker build . -f Dockerfile-2.3.8 -t some-testing-name
```

and confirmed that nokogiri sucessfully installs.
@ivoanjo ivoanjo requested a review from a team as a code owner March 20, 2024 09:22
@github-actions github-actions bot added the dev/ci Involves CircleCI, GitHub Actions, or GitLab label Mar 20, 2024
@ivoanjo
Copy link
Member Author

ivoanjo commented Mar 20, 2024

Notes on this PR:

  1. System-tests will still fail since it won't pick up the new image until we publish it (https://github.com/DataDog/dd-trace-rb/actions/runs/8356497866/job/22873701994?pr=3541)

  2. CircleCI tests for 2.1/2.2/2.3 are failing with many different reasons (missing ffi, missing database driver). I believe the fix here is to bust the CircleCI caches -- they are probably caching gems from a different debian base image and they need to be rebuilt. We need to bust the cache on a later PR. I say a later PR because this is a) unrelated to this change in particular; b) we're going to need to bust the cache again after publishing this new image.

The key bit to look out is for https://github.com/DataDog/dd-trace-rb/actions/runs/8356497863/job/22873697379?pr=3541 -- the new image build do succeed.

@ivoanjo ivoanjo merged commit cab98b1 into master Mar 20, 2024
127 of 145 checks passed
@ivoanjo ivoanjo deleted the ivoanjo/switch-docker-2_3-image-debian-11 branch March 20, 2024 10:06
@github-actions github-actions bot added this to the 1.21.1 milestone Mar 20, 2024
@lloeki lloeki mentioned this pull request Mar 20, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dev/ci Involves CircleCI, GitHub Actions, or GitLab
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants