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

remove added LLVM apt PPA repo #265

Open
2bndy5 opened this issue Sep 16, 2024 · 0 comments · May be fixed by #278
Open

remove added LLVM apt PPA repo #265

2bndy5 opened this issue Sep 16, 2024 · 0 comments · May be fixed by #278
Labels
bug Something isn't working

Comments

@2bndy5
Copy link
Collaborator

2bndy5 commented Sep 16, 2024

Is your idea related to an existing feature?

version

Describe the behavior you would like

I noticed that the LLVM install script (for Debian Linux OS) cannot be used more than once in a single workflow run. This means users will have an error if

runs-on: ubuntu-latest
steps:
  - uses: cpp-linter/cpp-linter-action@v2
    with:
      version: 16
  # re-run action in same workflow with different clang version
  - uses: cpp-linter/cpp-linter-action@v2
    with:
      # ERROR: the LLVM PPA repo is already set to use v16 from previous step
      version: 19

The error would look something like:

E: The repository 'http://apt.llvm.org/jammy llvm-toolchain-jammy-16 Release' does not have a Release file.

I solved this problem (in experiments) by removing the LLVM PPA repo after we install clang-tidy and clang-format from it:

sudo rm /etc/apt/sources.list.d/*llvm*.list || true

Describe alternatives you have considered

I did consider adding the LLVM apt PPA repo manually. However, the install script takes care of a lot of other cross-distribution problems, namely determining which derivative/flavor of Debian is used. Using the install script still relieves some tech debt as it is well maintained by the LLVM project.

Additional context

The updated source of the LLVM install script can be examined from https://apt.llvm.org/llvm.sh.

The scenario in which cpp-linter-action might be used more than once in a single workflow depends on the project being analyzed. As an example, a user might want to examine different sources using different compilation databases. Ultimately, the cpp-linter python package is not well suited for multiple uses in a single CI event, but that is an issue (or multitude of issues) for another time.

In the case where a user's workflow might expect the LLVM apt PPA repo to still be employed (after running cpp-linter-action), it might be a good idea to have a new input option to prevent the removal of the LLVM apt PPA repo. I suspect this to be a rare use case though.

@2bndy5 2bndy5 added the bug Something isn't working label Sep 16, 2024
@2bndy5 2bndy5 changed the title remove added LLVM apt PPA remove added LLVM apt PPA repo Sep 16, 2024
2bndy5 added a commit that referenced this issue Oct 18, 2024
resolves #265

Users that expect the PPA to be present _after_ running cpp-linter-action can set the environment variable `KEEP_DEBIAN_LLVM_PPA` to `true`, `on`, or `1`. By default, the PPA is removed.
@2bndy5 2bndy5 linked a pull request Oct 18, 2024 that will close this issue
@2bndy5 2bndy5 linked a pull request Oct 18, 2024 that will close this issue
2bndy5 added a commit that referenced this issue Oct 18, 2024
resolves #265

Users that expect the PPA to be present _after_ running cpp-linter-action can set the environment variable `KEEP_DEBIAN_LLVM_PPA` to `true`, `on`, or `1`. By default, the PPA is removed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant