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

Fix regression in local+noindex repository handling #10095

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

andreabedini
Copy link
Collaborator

@andreabedini andreabedini commented Jun 10, 2024

Template B: This PR does not modify behaviour or interface

This fixes #9891, introduced in #8944, where the index cache is checked even for local+noindex repositories.

Include the following checklist in your PR:

  • Patches conform to the coding conventions.
  • Is this a PR that fixes CI? If so, it will need to be backported to older cabal release branches (ask maintainers for directions).

@ulysses4ever
Copy link
Collaborator

Rebasing on latest master for a CI fix.

@geekosaur
Copy link
Collaborator

Sorry for the noise, testing a bot to track review requests

@andreabedini andreabedini marked this pull request as ready for review June 20, 2024 15:39
@andreabedini
Copy link
Collaborator Author

I am actually not sure why I had marked this as a draft. Maybe because it's missing a test 🤔

@andreabedini andreabedini added the merge me Tell Mergify Bot to merge label Jun 21, 2024
@Mikolaj
Copy link
Member

Mikolaj commented Jun 25, 2024

Should that be backported for release 3.12.2.0? The PR that introduced the problem is old, so it's surely on the 3.12 branch.

@jasagredo
Copy link
Collaborator

This doesn't solve the regression, at least on Windows.

The cabal file

➜ cat cabal.project
packages: .
repository local
  url: file+noindex://C:/Users/Javier/code/aa/repo

3.10.2.1

➜ ls repo

➜ cabal build
Resolving dependencies...
Build profile: -w ghc-9.6.5 -O1
In order, the following will be built (use -v for more details):
 - aa-0.1.0.0 (lib) (cannot read state cache)
Configuring library for aa-0.1.0.0..
Preprocessing library for aa-0.1.0.0..
Building library for aa-0.1.0.0..
[1 of 1] Compiling MyLib            ( src\MyLib.hs, C:\Users\Javier\code\aa\dist-newstyle\build\x86_64-windows\ghc-9.6.5\aa-0.1.0.0\build\MyLib.o ) [Flags changed]

➜ ls repo
noindex.cache

surprisingly enough, it prints the paths in verbose mode as missing the C:/ drive letter, but it still creates the file 🧩 :

➜ cabal build -v3 | grep -v environment
...
Reading available packages of local...
Using most recent state (could not read timestamp file)
Updating index cache file /Users/Javier/code/aa/repo\noindex.cache ...
Entries in file+noindex repository local
creating \Users\Javier\code\aa\repo
Index cache updated
index-state(local) =
...

With this branch's cabal

➜ ls repo

➜ $CABAL build
Warning: this is a debug build of cabal-install with assertions enabled.
Warning: Error during construction of local+noindex local repository index:
/Users/Javier/code/aa/repo\noindex.cache: openBinaryFile: does not exist (No
such file or directory)
Resolving dependencies...
Build profile: -w ghc-9.6.5 -O1
In order, the following will be built (use -v for more details):
 - aa-0.1.0.0 (lib) (cannot read state cache)
Warning: this is a debug build of cabal-install with assertions enabled.
Configuring library for aa-0.1.0.0...
Warning: this is a debug build of cabal-install with assertions enabled.
Preprocessing library for aa-0.1.0.0...
Building library for aa-0.1.0.0...
[1 of 1] Compiling MyLib            ( src\MyLib.hs, dist-newstyle\build\x86_64-windows\ghc-9.6.5\aa-0.1.0.0\build\MyLib.o ) [Flags changed]
Warning: this is a debug build of cabal-install with assertions enabled.

➜ ls repo

This one says:

➜ $CABAL build -v3 | grep -v environment
...
Warning: Error during construction of local+noindex local repository index:
/Users/Javier/code/aa/repo\noindex.cache: openBinaryFile: does not exist (No
such file or directory)
index-state(hackage.haskell.org) = 2024-06-20T22:19:34Z
Reading available packages of local...
index-state(local) = Unknown or invalid timestamp
...

@andreabedini andreabedini removed the merge me Tell Mergify Bot to merge label Jun 25, 2024
@andreabedini
Copy link
Collaborator Author

andreabedini commented Jun 25, 2024

Thanks @jasagredo. (if only I had written a test 😂)

@ulysses4ever
Copy link
Collaborator

@andreabedini any energy to get back to this? It may be good to manage it before 3.14 release since people start noticing: #9891 (comment)

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.

Regression: local repository file+noindex ignores noindex part
5 participants