Skip to content

Make native debugger tests more stable in the CI - #13485

Merged
shindere merged 4 commits into
ocaml:trunkfrom
tmcgilchrist:native-headache
Oct 4, 2024
Merged

Make native debugger tests more stable in the CI#13485
shindere merged 4 commits into
ocaml:trunkfrom
tmcgilchrist:native-headache

Conversation

@tmcgilchrist

@tmcgilchrist tmcgilchrist commented Sep 27, 2024

Copy link
Copy Markdown
Contributor

Improvement upon #13477

First change is #13484 plus various fixes to make the tests more stable across CI.
Superseded by #13488.

@ghost ghost mentioned this pull request Sep 27, 2024

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Looking good, should work much better in the long term.
Thanks for these fixes!

@kayceesrk

Copy link
Copy Markdown
Contributor

Native headache

Can you use a more descriptive title please? We'd like our PR titles to be a very short summary of the work. How about

Make native debugger tests more stable in the CI

@tmcgilchrist tmcgilchrist changed the title Native headache Make native debugger tests more stable in the CI Sep 27, 2024
- id: normal
name: normal
dependencies: texlive-latex-extra texlive-fonts-recommended hevea sass
dependencies: texlive-latex-extra texlive-fonts-recommended hevea sass gdb lldb python3-lldb-14

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is the -14 necessary? Does python3-lldb work? (it would simplify updating when gha moves to a newer Ubuntu)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This should become just gdb lldb when we start using Ubuntu 24.04.

run: |
sudo apt-get update -y && sudo apt-get install -y ${{ matrix.dependencies }}
# Work around lldb on Ubuntu 22.04 issue https://github.com/llvm/llvm-project/issues/55575
sudo ln -s /usr/lib/llvm-14/lib/python3.10/dist-packages/lldb/* /usr/lib/python3/dist-packages/lldb/

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Is there any way you could avoid hard-coding llvm-14 and python-3.10 and retrieve the LLVM and Python versions from the system instead?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

unless we expect this bug to be fixed for upcoming llvm/python3 releases and using this work-around would actually become a problem on its own

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

The bug is fixed in 24.04 LTS so this is a temporary work around until we update CI to use that version. Based on actions/runner-images#10636 that will be between now and the October 30 2024. At which point this will break and we can remove it.


# Replace line numbers in runtime files - one rule for lldb, one for gdb
# (it would be better to only match on runtime/*.c, but gsub does not
# handle ERE)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

out of curiosity, what's ERE?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Extended Regular Expressions.

I wanted to use something like (runtime/.*.c):[0-9]+ and replace with \1:XX so that only runtime files match.

Miod Vallat and others added 3 commits September 30, 2024 09:59
Let this work with the one true awk used on macOS
OCaml will name mangle symbols with an extra underscore plus a number
that is not reproducable or stable across builds. Trimming this avoids
issues with symbol names inadvertently changing.
@tmcgilchrist

Copy link
Copy Markdown
Contributor Author

I would like @shindere to review this.

As a meta comment, moving the testing logic into Python provides a better experience and allows more customisation than using the CLI for either debugger.

@shindere

shindere commented Oct 3, 2024 via email

Copy link
Copy Markdown
Contributor

@tmcgilchrist

Copy link
Copy Markdown
Contributor Author

@shindere Installing python3-lldb-14 vs python3-lldbmisses the explicitness of the second step where we need to run ln -s to fix the underlying packaging issue in llvm for Ubuntu 22.04. It is more obvious if this breaks installing a very specific package vs the more confusing ModuleNotFoundError: No module named 'lldb.embedded_interpreter' error when the Python scripting is broken.

This is a temporary work around until CI updates to Ubuntu 24.04 LTS, which based on actions/runner-images#10636 that will be between now and the October 30 2024. At which point this will break installing that package and we can remove this work around.

@shindere

shindere commented Oct 4, 2024 via email

Copy link
Copy Markdown
Contributor

@shindere
shindere merged commit 8b52157 into ocaml:trunk Oct 4, 2024
@tmcgilchrist
tmcgilchrist deleted the native-headache branch October 10, 2024 03:47
@shym

shym commented Dec 9, 2024

Copy link
Copy Markdown
Contributor

I’m now seeing 24.04 being rolled out, which makes the CI test fail. Unfortunately, they seem to be doing this progressively from now to mid January: actions/runner-images#10636. Maybe we should force ubuntu-24.04 until this is stable?

@shym

shym commented Dec 9, 2024

Copy link
Copy Markdown
Contributor

Maybe I missed something: I tried to apply the changes as mentioned here for when 24.04 would be rolled out.
See shym#19
But unfortunately it seems that the output of the test native-debugger/linux-lldb-amd64.ml is not stable across versions:
https://github.com/shym/ocaml/actions/runs/12241917245/job/34148404424#step:5:738

@tmcgilchrist

Copy link
Copy Markdown
Contributor Author

#13665 upgrades Ubuntu to 24.04, I had a workaround for a packaging issue with lldb in Ubuntu 22.04 which is now unnecessary. Moving more of the tests into python scripting should be more stable across lldb versions. I'm currently working on other things but hope to get back to this next year.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants