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

workflow: Fix error outputs for compile-check #287

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

MonsterDruide1
Copy link
Owner

@MonsterDruide1 MonsterDruide1 commented Jan 19, 2025

Fixes #60

So far, the compile-check workflow did not output its error messages, because tools/check failed with a non-zero exit code in these circumstances, so the remainder of the step would not be executed. By adding || true to it, failing return codes are ignored. Additionally, by piping the error to a file and reading it back with cat, newlines are preserved. Rust shows its stack trace by default when using bail! to exit a program, so we're also cutting that and the remainder of the (multiline) message away using sed. \f (form feed symbol) is used as a temporary replacement for \n here, to allow multi-line replacements in sed without fancy commands.


This change is Reviewable

@MonsterDruide1 MonsterDruide1 self-assigned this Jan 19, 2025
Copy link

@Werechang Werechang left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @MonsterDruide1)


.github/workflows/compile-check.yml line 70 at r1 (raw file):

        else
          cat errfile | tr '\n' '\f' | sed 's/Stack backtrace:.*//' | tr '\f' '\n'
          exit 2

exit 2 can now be changed back to exit 1 since we know where the issue was.

Copy link
Owner Author

@MonsterDruide1 MonsterDruide1 left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 files reviewed, 1 unresolved discussion (waiting on @Werechang)


.github/workflows/compile-check.yml line 70 at r1 (raw file):

Previously, Werechang (Cookieso) wrote…

exit 2 can now be changed back to exit 1 since we know where the issue was.

Good catch - done.

Copy link

@Werechang Werechang left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 1 of 1 files at r2.
Reviewable status: all files reviewed (commit messages unreviewed), 1 unresolved discussion (waiting on @MonsterDruide1)

Copy link

@Werechang Werechang left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @MonsterDruide1)

Copy link

@Werechang Werechang left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @MonsterDruide1)

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.

CI (compile-verify): Output doesn't show up in log of GitHub action
2 participants