Skip to content

Create noindex.cache if missing #10730

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 1 commit into from
Mar 24, 2025

Conversation

jasagredo
Copy link
Collaborator

@jasagredo jasagredo commented Jan 9, 2025

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
Copy link
Member

@Mikolaj Mikolaj left a comment

Choose a reason for hiding this comment

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

Thank you!

Copy link
Collaborator

@ffaf1 ffaf1 left a comment

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
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
Copy link
Member

Mikolaj commented Mar 19, 2025

@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
Copy link
Contributor

mergify bot commented Mar 22, 2025

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
46 checks passed
@Mikolaj
Copy link
Member

Mikolaj commented Mar 28, 2025

@mergify backport 3.14

Copy link
Contributor

mergify bot commented Mar 28, 2025

backport 3.14

✅ Backports have been created

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