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

Improve comment stripping errors #1675

Merged
merged 1 commit into from
Dec 2, 2024

Conversation

jonjohnsonjr
Copy link
Contributor

@jonjohnsonjr jonjohnsonjr commented Dec 2, 2024

Before, these looked like:

compiling main pipelines: compiling Pipeline[0]: stripping runs comments: 14:13: not a valid test operator: -m

Now, these look like:

compiling "hwloc" test pipelines: compiling Pipeline[0]: stripping runs comments: 14:13: not a valid test operator: -m:
> if [[ uname -m == 'x86_64']]; then
              ^

First big change is that we include the package name in the error. Without this, it was really challenging to find which package actually had a syntax error.

Second big change is that we use the nice structured error we get back from the shell parsing library to include the line that failed with a cursor pointing at the column that failed.

Before, these looked like:

compiling main pipelines: compiling Pipeline[0]: stripping runs comments: 14:13: not a valid test operator: -m

Now, these look like:

compiling "hwloc" test pipelines: compiling Pipeline[0]: stripping runs comments: 14:13: not a valid test operator: -m:
> if [[ uname -m == 'x86_64']]; then
              ^

First big change is that we include the package name in the error.
Without this, it was really challenging to find which package actually
had a syntax error.

Second big change is that we use the nice structured error we get back
from the shell parsing library to include the line that failed with a
cursor pointing at the column that failed.

Signed-off-by: Jon Johnson <[email protected]>
@k4leung4 k4leung4 merged commit c4d3be2 into chainguard-dev:main Dec 2, 2024
36 checks passed
@smoser
Copy link
Contributor

smoser commented Dec 13, 2024

best. change. ever.

2024/12/13 08:58:23 INFO evaluating pipelines for package requirements
2024/12/13 08:58:23 INFO ERROR: failed to test package. the test environment has been preserved:
2024/12/13 08:58:23 INFO   workspace dir: /home/user/tmp/melange-workspace-2064787666
2024/12/13 08:58:23 ERRO failed to test package: compiling python-as-wrapper.yaml tests: compiling subpackage "python-as-env" tests: compiling Pipeline[0]: stripping runs comments: 17:1: "for foo [in words]" must be followed by "do":
> for val in bogus-prog-name PYTHON_AS;
  ^

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.

4 participants