Skip to content

Makefile.coq.local: reduce long line warnings in alectryon build #1836

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

Merged
merged 2 commits into from
Feb 12, 2024

Conversation

jdchristensen
Copy link
Collaborator

It's not that important, but the alectryon builds spew out long line warnings because of our conventions on not having line breaks in comments, and I think this will get rid of them. Let's see what happens when the CI runs.

@jdchristensen
Copy link
Collaborator Author

No, alectryon didn't recognize the --long-line-threshold argument. It appears in the source code here:

https://github.com/cpitclaudel/alectryon/blob/11e8cdc8395d66858baa7371b6cf8e827ca38f4a/alectryon/cli.py#L840

Do we need to update to a newer alectryon? @JasonGross ?

@jdchristensen jdchristensen marked this pull request as draft February 6, 2024 21:22
@jdchristensen
Copy link
Collaborator Author

@Alizter Is it easy to update alectryon? Should we do it? If it's not easy and/or risks breaking things, I'll just close this.

@Alizter
Copy link
Collaborator

Alizter commented Feb 7, 2024

@jdchristensen I'll see what I can do.

@Alizter
Copy link
Collaborator

Alizter commented Feb 9, 2024

I had a look and we are using Jason's patches on top of an older version of alectryon in a submodule. The issue that these patches fix is a naming collision with the html files which we appear to be susceptible to. I tried to rebase the patches on a newer version of alectryon but I have no idea what I am doing basically so it didn't work. Our only hope is for @JasonGross to update his fork.

Also FTR the patches are sitting in a PR upstream for alectryon but the discussion seems to have diverged and it didn't end up getting integrated. I haven't been able to understand the full story and what exactly alectryon is missing for us however.

@jdchristensen
Copy link
Collaborator Author

It would be nice if upstream alectryon could be adapted to accommodate our set-up, so we don't need to be stuck with an out-of-date version.

@jdchristensen
Copy link
Collaborator Author

The alectryon PR that @Alizter mentioned is cpitclaudel/alectryon#25

@Alizter
Copy link
Collaborator

Alizter commented Feb 12, 2024

@jdchristensen Try rebasing this PR now that we've updated alectryon.

@jdchristensen jdchristensen marked this pull request as ready for review February 12, 2024 22:37
@jdchristensen
Copy link
Collaborator Author

It looks like it is working. I only see two long-line warnings so far, for lines that are > 999 characters long. I could increase 999 to 9999, or we could leave those, as they don't clutter the output that much.

@Alizter
Copy link
Collaborator

Alizter commented Feb 12, 2024

@jdchristensen Let's just make it 99 999.

@Alizter Alizter merged commit ac87d8a into HoTT:master Feb 12, 2024
@jdchristensen
Copy link
Collaborator Author

@JasonGross Now that the long-line warnings are gone, another repeated warning is visible:

/github/workspace/etc/alectryon/alectryon/pygments.py:251: UserWarning: !! Warning: Unexpected token during syntax-highlighting: '₀'
!! Alectryon's lexer isn't perfect: please send us an example.
!! Context:
        (tensor ₀ (a, tensor ₀ (I, b)))%object -->
        (tensor ₀ (tensor ₀

Should we try to get rid of this warning some how?

@jdchristensen jdchristensen deleted the long-lines branch February 12, 2024 23:42
@Alizter
Copy link
Collaborator

Alizter commented Feb 12, 2024

It seems the unicode is causing the lexer to choke. Perhaps @cpitclaudel can say more.

cpitclaudel added a commit to cpitclaudel/alectryon that referenced this pull request Mar 3, 2024
cpitclaudel added a commit to cpitclaudel/alectryon that referenced this pull request Mar 3, 2024
@cpitclaudel
Copy link

Oh, sorry folks. My Coq notifications filter was too aggressive and I missed this message.

Two things:

  • You can use --long-line-threshold=-1 to turn the warning off. I just pushed a commit to document that.

  • The other warning comes from the syntax highlighter. I can't wait to get rid of that custom highlighter and replace it with something built into Coq, but until that exists: the problem comes from the fact that is an "identifier part" in Coq (not a "symmbol" nor an "identifier start"). I couldn't find the exact rules used for symbols in notations, but allowing identifier parts at the beginning of symbols solves the issue, so I've done that.

The fix should be live on Alectryon's master branch. Do you need me to cut a release or do you track master?

@Alizter
Copy link
Collaborator

Alizter commented Mar 4, 2024

@cpitclaudel We can track master as we use a submodule for alectryon. We currently follow cpitclaudel/alectryon#25 which Jason recently rebased. If you merge that in some form then it will make our lives easier and we can just continue tracking master.

@cpitclaudel
Copy link

If you merge that in some form then it will make our lives easier and we can just continue tracking master.

Right, I'm working on this.

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.

3 participants