Skip to content

Fix project packages glob parsing - #12172

Open
philderbeast wants to merge 8 commits into
haskell:masterfrom
cabalism:test/parse-packages-glob
Open

Fix project packages glob parsing#12172
philderbeast wants to merge 8 commits into
haskell:masterfrom
cabalism:test/parse-packages-glob

Conversation

@philderbeast

@philderbeast philderbeast commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

The failing test for #12171 and its fix.

$ cabal test cabal-install:parser-tests
...
Build profile: -w ghc-9.10.3 -O1
...
Running 1 test suites...
Test suite parser-tests: RUNNING...
project files parsec tests                                                                                                                                                                                                                            
  read packages:                                    OK
  read packages glob:                               FAIL
    Exception: Error: [Cabal-7167]
    Error parsing project file cabal.glob.project:
    
    cabal.glob.project:3:28: error:
      unexpected ','
      expecting white space, string, identifier or end of input
          3 | packages: */*.cabal ../{foo,bar}/
            |                            ^    
    
    Use -p '/read packages glob/' to rerun this test only.

I'll squash commits before applying the merge label if this pull request is approved.


@philderbeast philderbeast changed the title Add packages glob parser test Fix packages glob parsing Jul 28, 2026
@philderbeast philderbeast changed the title Fix packages glob parsing Fix project packages glob parsing Jul 28, 2026
@philderbeast
philderbeast force-pushed the test/parse-packages-glob branch from 86f5fcc to 6fb47bd Compare July 28, 2026 19:45
Comment thread cabal-install/src/Distribution/Client/ProjectConfig/FieldGrammar.hs
@philderbeast
philderbeast force-pushed the test/parse-packages-glob branch 2 times, most recently from 5048f32 to 6b3a2e2 Compare August 2, 2026 01:03
@Mikolaj

Mikolaj commented Aug 6, 2026

Copy link
Copy Markdown
Member

Where are the globs handled in the code? I only see the curly braces syntax, which is only the half of the example in the issue.

@philderbeast
philderbeast force-pushed the test/parse-packages-glob branch from 6b3a2e2 to f3c26eb Compare August 11, 2026 14:13
@philderbeast
philderbeast marked this pull request as draft August 13, 2026 17:11
@philderbeast
philderbeast force-pushed the test/parse-packages-glob branch 2 times, most recently from 2851518 to f01b796 Compare August 13, 2026 17:22
@philderbeast
philderbeast marked this pull request as ready for review August 13, 2026 17:22
Comment on lines +69 to +70
-- >>> getPackageLocationTokens <$> (simpleParsec "*/*.cabal ../{foo,bar}/" :: Maybe PackageLocationTokens)
-- Just ["*/*.cabal","../{foo,bar}/"]

@philderbeast philderbeast Aug 13, 2026

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Where are the globs handled in the code? I only see the curly braces syntax, which is only the half of the example in the issue.

@Mikolaj as well as the parser tests, I've added a doctest example here, same as the one in the users guide.

@philderbeast
philderbeast force-pushed the test/parse-packages-glob branch from f01b796 to 0a1d051 Compare August 13, 2026 19:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants