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

SAW compilation failure with GHC 9.2.7 #1854

Closed
ramsdell opened this issue Apr 13, 2023 · 2 comments · Fixed by #1855
Closed

SAW compilation failure with GHC 9.2.7 #1854

ramsdell opened this issue Apr 13, 2023 · 2 comments · Fixed by #1855
Assignees
Labels
type: bug Issues reporting bugs or unexpected/unwanted behavior

Comments

@ramsdell
Copy link

On the master branch, SAW fails to compile using GHC 9.2.7. The only error I can find is:

/Users/ramsdell/rep/saw-script/dist-newstyle/build/x86_64-osx/ghc-9.2.7/saw-core-0.1/build/Verifier/SAW/Lexer.hs:503:19: error: [-Werror]
    accepting non-standard pattern guards (use PatternGuards to suppress this message)
        (tagToEnum# (offset >=# 0#)),
        check <- alexIndexInt16OffAddr alex_check offset,
        (tagToEnum# (check ==# ord_c))
    |
503 |                   | GTE(offset,ILIT(0))
    |                   ^^^^^^^^^^^^^^^^^^^^^...

all.txt

@RyanGlScott RyanGlScott added type: bug Issues reporting bugs or unexpected/unwanted behavior tooling: build system Issues involving SAW's build system and removed tooling: build system Issues involving SAW's build system labels Apr 13, 2023
@RyanGlScott RyanGlScott self-assigned this Apr 13, 2023
@RyanGlScott
Copy link
Contributor

RyanGlScott commented Apr 13, 2023

I can reproduce this. I'm guessing that you are using the recently-released alex-3.2.7.2, which imposes a PatternGuards requirement that wasn't present in previous versions of alex. (See haskell/alex#223 (comment).) Thankfully, this shouldn't be difficult to fix. I'll prepare a patch.

RyanGlScott added a commit that referenced this issue Apr 13, 2023
`alex-3.2.7.2` generates code that uses `PatternGuards`, but because `saw-core`
does not specify a `default-language` in its `.cabal` file, it defaults to
`Haskell98`, which does not include `PatternGuards`. Arguably, we should make
`saw-core`'s `default-language` be `Haskell2010` (which _does_ include
`PatternGuards`), but that would be a somewhat larger change. For the sake of
restoring the build, this applies the simplest possible fix of enabling
`PatternGuards` in the affected file.

Fixes #1854.
@RyanGlScott
Copy link
Contributor

See #1855 with a fix. That patch is a one-line change, so you can apply it locally if you want to get unstuck in the meantime.

@mergify mergify bot closed this as completed in #1855 Apr 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Issues reporting bugs or unexpected/unwanted behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants