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

Collect logs on failure #26

Open
jdoubleu opened this issue Apr 6, 2024 · 2 comments
Open

Collect logs on failure #26

jdoubleu opened this issue Apr 6, 2024 · 2 comments

Comments

@jdoubleu
Copy link

jdoubleu commented Apr 6, 2024

This GitHub action is really helpful to me. I have a suggestion for a Quality-of-Life feature, that could really be helpful for debugging.

I often have to deal with failing builds of dependencies due to various reasons. When a dependency fails to build, vcpkg creates multiple log files somewhere in the buildtrees folder. I have to manually cat these in a separate step.

It would be nice, if this action adds a step which automatically collects all (error) logs and makes them available to the user somehow. I'm not too familiar with GitHub actions, but if you cannot upload the logs, you may simply cat them?

I'm not sure to always include this additional step, but constraint it to failing builds, or including it only when debug logging is active (i.e. when manually re-running the job).

My current, manual approach is to add the following step immediately after the action:

      - name: cat logs
        if: failure()
        run: cat /path/to/project/vcpkg/buildtrees/dependency/build-x64-linux-err.log
@johnwason
Copy link
Owner

johnwason commented Apr 8, 2024

Hi @jdoubleu

I find it is better to capture the logs using upload-artifact rather than trying to dump them to the console and decipher them.

Something like this should work, although I haven't tested this exact example:

- uses: actions/upload-artifact@v4
  if: always()
  with:
    name: vcpkg-logs
    path: vcpkg/**/*.log

@jdoubleu
Copy link
Author

jdoubleu commented Apr 8, 2024

Okay, thanks. I think this would work well.

How do you feel about adding an option (e.g. collect_logs: 'on-failure' // 'always', 'on-success', 'on-failure'), which automatically adds such a step?

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

No branches or pull requests

2 participants