Skip to content

Create noindex.cache if missing - #10730

Merged
mergify[bot] merged 1 commit into
haskell:masterfrom
jasagredo:js/create-noindex.cache
Mar 24, 2025
Merged

mergify[bot] merged 1 commit into
haskell:masterfrom
jasagredo:js/create-noindex.cache

Conversation

@jasagredo

@jasagredo jasagredo commented Jan 9, 2025 •

Copy link
Copy Markdown
Collaborator

Fixes #9891 by creating the file if it is missing.

Depends on #10728

QA

This will work on Linux:

cabal init -m -n --simple --lib
mkdir repo
echo "packages: ." > cabal.project
echo "repository local" >> cabal.project
echo "  url: file+noindex://$(pwd)/repo" >> cabal.project
cabal build

For Windows, the path has to be un-cygwinize and prepended by //./ as described in #10728.


Template Α: This PR modifies behaviour or interface

Include the following checklist in your PR:

@jasagredo
jasagredo force-pushed the js/create-noindex.cache branch 2 times, most recently from bf56870 to 7a81f34 Compare January 9, 2025 10:09
@jasagredo
jasagredo marked this pull request as ready for review January 9, 2025 11:44
@jasagredo
jasagredo force-pushed the js/create-noindex.cache branch 6 times, most recently from 30b8320 to 833cc77 Compare January 14, 2025 00:39
@jasagredo
jasagredo force-pushed the js/create-noindex.cache branch from 833cc77 to 41ff289 Compare January 20, 2025 22:46
@jasagredo
jasagredo force-pushed the js/create-noindex.cache branch 2 times, most recently from 34cd537 to e354659 Compare February 11, 2025 00:07
@Kleidukos
Kleidukos self-requested a review February 27, 2025 18:35

@Mikolaj Mikolaj left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thank you!

@ffaf1 ffaf1 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Very good. Would there be an easy way to add tests?

@ulysses4ever

Copy link
Copy Markdown
Collaborator

CI fails with what seems to be a simple compilation error:

[100 of 143] Compiling Distribution.Client.IndexUtils ( src/Distribution/Client/IndexUtils.hs, /home/runner/work/cabal/cabal/dist-newstyle-validate-ghc-8.8.4/build/x86_64-linux/ghc-8.8.4/cabal-install-3.15.0.0/build/Distribution/Client/IndexUtils.o )

src/Distribution/Client/IndexUtils.hs:1206:57: error:
Error:     • Couldn't match expected type ‘IO (Either String NoIndexCache)’
                  with actual type ‘Index -> IO (Either String NoIndexCache)’
    • Probable cause: ‘readNoIndexCache'’ is applied to too few arguments
      In the second argument of ‘(>>)’, namely ‘readNoIndexCache' index’
      In the expression:
        updatePackageIndexCacheFile verbosity index
          >> readNoIndexCache' index
      In a stmt of a 'do' block:
        if exists then
            structuredDecodeFileOrFail (cacheFile index)
        else
            updatePackageIndexCacheFile verbosity index
              >> readNoIndexCache' index
     |
1206 |     else updatePackageIndexCacheFile verbosity index >> readNoIndexCache' index
     |                                                         ^^^^^^^^^^^^^^^^^^^^^^^

src/Distribution/Client/IndexUtils.hs:1206:75: error:
Error:     • Couldn't match expected type ‘Verbosity’ with actual type ‘Index’
    • In the first argument of ‘readNoIndexCache'’, namely ‘index’
      In the second argument of ‘(>>)’, namely ‘readNoIndexCache' index’
      In the expression:
        updatePackageIndexCacheFile verbosity index
          >> readNoIndexCache' index
     |
1206 |     else updatePackageIndexCacheFile verbosity index >> readNoIndexCache' index
     |                                                                           ^^^^^

Is @jasagredo available to fix it or should we find a volunteer? I optimistically mark it as desirable for the next 3.14 release.

@Mikolaj

Mikolaj commented Mar 19, 2025

Copy link
Copy Markdown
Member

@jasagredo may surprise us in a pleasant way, but I know he's busy, so let's find a volunteer. Anybody?

@Mikolaj Mikolaj added the attention: needs-help Help wanted with this issue/PR label Mar 19, 2025
@jasagredo
jasagredo force-pushed the js/create-noindex.cache branch from e354659 to ca1ed94 Compare March 20, 2025 10:02
@jasagredo jasagredo added merge me Tell Mergify Bot to merge and removed attention: needs-help Help wanted with this issue/PR labels Mar 20, 2025
@mergify mergify Bot added ready and waiting Mergify is waiting out the cooldown period merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days labels Mar 20, 2025
@mergify

mergify Bot commented Mar 22, 2025

Copy link
Copy Markdown
Contributor

This pull request has been removed from the queue for the following reason: pull request branch update failed.

The pull request can't be updated

You should update or rebase your pull request manually.

If you want to requeue this pull request, you can post a @mergifyio requeue comment.

@jasagredo
jasagredo force-pushed the js/create-noindex.cache branch from ca1ed94 to 2528f73 Compare March 24, 2025 12:15
@mergify
mergify Bot merged commit e38a514 into haskell:master Mar 24, 2025
@Mikolaj

Mikolaj commented Mar 28, 2025

Copy link
Copy Markdown
Member

@mergify backport 3.14

@mergify

mergify Bot commented Mar 28, 2025 •

Copy link
Copy Markdown
Contributor

backport 3.14

✅ Backports have been created

Details

@mergify mergify Bot mentioned this pull request Mar 28, 2025
6 tasks done
mergify Bot added a commit that referenced this pull request Mar 28, 2025
Backport #10730: Create `noindex.cache` if missing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge delay passed Applied (usually by Mergify) when PR approved and received no updates for 2 days merge me Tell Mergify Bot to merge ready and waiting Mergify is waiting out the cooldown period

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Regression: local repository file+noindex ignores noindex part

4 participants