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

haddock-project fixes (backport #8919) #9088

Closed
wants to merge 5 commits into from
Closed

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented Jul 5, 2023

This is an automatic backport of pull request #8919 done by Mergify.
Cherry-pick of 1840bca has failed:

On branch mergify/bp/3.10/pr-8919
Your branch is up to date with 'origin/3.10'.

You are currently cherry-picking commit 1840bca4b.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   cabal-install/src/Distribution/Client/CmdHaddockProject.hs

no changes added to commit (use "git add" and/or "git commit -a")

Cherry-pick of 1b89c1b has failed:

On branch mergify/bp/3.10/pr-8919
Your branch is ahead of 'origin/3.10' by 1 commit.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 1b89c1bf5.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   .gitignore
	modified:   cabal-install/tests/IntegrationTests2.hs
	new file:   cabal-install/tests/IntegrationTests2/haddock-project/dependencies/a.cabal
	new file:   cabal-install/tests/IntegrationTests2/haddock-project/dependencies/cabal.project
	new file:   cabal-install/tests/IntegrationTests2/haddock-project/dependencies/src/MyLib.hs
	new file:   cabal-testsuite/PackageTests/HaddockProject/a.cabal
	new file:   cabal-testsuite/PackageTests/HaddockProject/cabal.project
	new file:   cabal-testsuite/PackageTests/HaddockProject/haddock-project.out
	new file:   cabal-testsuite/PackageTests/HaddockProject/haddock-project.test.hs
	new file:   cabal-testsuite/PackageTests/HaddockProject/repo/async-2.2.4/Control/Concurrent/Async.hs
	new file:   cabal-testsuite/PackageTests/HaddockProject/repo/async-2.2.4/LICENSE
	new file:   cabal-testsuite/PackageTests/HaddockProject/repo/async-2.2.4/Setup.hs
	new file:   cabal-testsuite/PackageTests/HaddockProject/repo/async-2.2.4/async.cabal
	new file:   cabal-testsuite/PackageTests/HaddockProject/src/MyLib.hs
	modified:   cabal-testsuite/src/Test/Cabal/Prelude.hs
	new file:   changelog.d/issue-8843
	modified:   doc/cabal-commands.rst

Unmerged paths:
  (use "git add/rm <file>..." as appropriate to mark resolution)
	both modified:   Cabal/src/Distribution/Simple/Haddock.hs
	deleted by us:   Cabal/src/Distribution/Simple/Setup/Haddock.hs
	both modified:   cabal-install/src/Distribution/Client/CmdHaddockProject.hs
	both modified:   cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.cabal.out
	both modified:   cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.out
	both modified:   cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.out
	both modified:   cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-explicit.out
	both modified:   cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.cabal.out
	both modified:   cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.out
	both modified:   cabal-testsuite/PackageTests/Backpack/Reexport1/setup.cabal.out
	both modified:   cabal-testsuite/PackageTests/Backpack/Reexport1/setup.out
	both modified:   cabal-testsuite/PackageTests/Haddock/setup.cabal.out
	both modified:   cabal-testsuite/PackageTests/Haddock/setup.out
	both modified:   cabal-testsuite/PackageTests/HaddockArgs/quickjump.out
	both modified:   cabal-testsuite/PackageTests/HaddockNewline/setup.cabal.out
	both modified:   cabal-testsuite/PackageTests/HaddockNewline/setup.out
	both modified:   cabal-testsuite/PackageTests/InternalLibraries/Haddock/haddock.cabal.out
	both modified:   cabal-testsuite/PackageTests/InternalLibraries/Haddock/haddock.out
	both modified:   cabal-testsuite/PackageTests/NewHaddock/DisableDoc/cabal.out
	deleted by us:   cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputCmd/cabal.out
	deleted by us:   cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputConfig/cabal.out
	both modified:   cabal-testsuite/PackageTests/NewHaddock/ImplyDependencies/cabal.out

Cherry-pick of 2c597e8 has failed:

On branch mergify/bp/3.10/pr-8919
Your branch is ahead of 'origin/3.10' by 2 commits.
  (use "git push" to publish your local commits)

You are currently cherry-picking commit 2c597e8c9.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   cabal-install/src/Distribution/Client/CmdHaddockProject.hs

no changes added to commit (use "git add" and/or "git commit -a")

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

coot added 3 commits July 5, 2023 21:07
This patch fixes a bug where a sublibrary overwrites a library
directory.  This leads to overwriting `*.haddock` files, which results
in missing entries in various indexes (e.g. the html index,
quicksearch).

(cherry picked from commit 1840bca)

# Conflicts:
#	cabal-install/src/Distribution/Client/CmdHaddockProject.hs
This patch makes `haddock-project` use `--local` option by default.
Since its the default, it is removed. Also `--gen-index`,
`--gen-contents`, `--hyperlinked-source` and `--quickjump` are removed
since they are always turned on.

Added a haddock-project test.

(cherry picked from commit 1b89c1b)

# Conflicts:
#	Cabal/src/Distribution/Simple/Haddock.hs
#	Cabal/src/Distribution/Simple/Setup/Haddock.hs
#	cabal-install/src/Distribution/Client/CmdHaddockProject.hs
#	cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.cabal.out
#	cabal-testsuite/PackageTests/Backpack/Includes2/setup-external.out
#	cabal-testsuite/PackageTests/Backpack/Includes2/setup-per-component.out
#	cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-explicit.out
#	cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.cabal.out
#	cabal-testsuite/PackageTests/Backpack/Includes3/setup-external-ok.out
#	cabal-testsuite/PackageTests/Backpack/Reexport1/setup.cabal.out
#	cabal-testsuite/PackageTests/Backpack/Reexport1/setup.out
#	cabal-testsuite/PackageTests/Haddock/setup.cabal.out
#	cabal-testsuite/PackageTests/Haddock/setup.out
#	cabal-testsuite/PackageTests/HaddockArgs/quickjump.out
#	cabal-testsuite/PackageTests/HaddockNewline/setup.cabal.out
#	cabal-testsuite/PackageTests/HaddockNewline/setup.out
#	cabal-testsuite/PackageTests/InternalLibraries/Haddock/haddock.cabal.out
#	cabal-testsuite/PackageTests/InternalLibraries/Haddock/haddock.out
#	cabal-testsuite/PackageTests/NewHaddock/DisableDoc/cabal.out
#	cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputCmd/cabal.out
#	cabal-testsuite/PackageTests/NewHaddock/HaddockOutput/HaddockOutputConfig/cabal.out
#	cabal-testsuite/PackageTests/NewHaddock/ImplyDependencies/cabal.out
`haddock-project` command need to build the project so that haddocks of
the dependencies are available in the store.

Fixes #8958.

(cherry picked from commit 2c597e8)

# Conflicts:
#	cabal-install/src/Distribution/Client/CmdHaddockProject.hs
@mergify mergify bot added the conflicts label Jul 5, 2023
@mergify mergify bot mentioned this pull request Jul 5, 2023
4 tasks
@mergify mergify bot added the backport label Jul 5, 2023
@ulysses4ever ulysses4ever added attention: needs-help Help wanted with this issue/PR attention: needs-rebase and removed attention: needs-help Help wanted with this issue/PR labels Jul 9, 2023
@ulysses4ever
Copy link
Collaborator

Needs manual rebase because of reformatting I assume. Cc @Kleidukos

@Kleidukos
Copy link
Member

hmm, so it seems, thank you.

@Kleidukos Kleidukos self-assigned this Aug 3, 2023
@Kleidukos Kleidukos force-pushed the mergify/bp/3.10/pr-8919 branch 8 times, most recently from cfffb5a to 8672c6e Compare August 8, 2023 16:15
@geekosaur
Copy link
Collaborator

I'm getting a validate error that seems like it should be unrelated? Probably someone else should try this since I'm flying blind.

PackageTests/Get/OnlyDescription/cabal.test.hs                                                                    FAIL (0.25s)
$ /home/allbery/.local/share/ghcup/ghc/9.6.2/bin/runghc-9.6.2 -- '--ghc-arg=-i' '--ghc-arg=-no-user-package-db' '--ghc-arg=-package-db' '--ghc-arg=/home/allbery/.local/state/cabal/store/ghc-9.6.2/package.db' '--ghc-arg=-package-db' '--ghc-arg=/home/allbery/Sources/cabal/dist-newstyle/packagedb/ghc-9.6.2' '--ghc-arg=-package-id' '--ghc-arg=Cabal-3.11.0.0-inplace' '--ghc-arg=-package-id' '--ghc-arg=Cabal-syntax-3.11.0.0-inplace' '--ghc-arg=-package-id' '--ghc-arg=async-2.2.4-7a2d647e2fc4665920a450f519e14e1577522d0384d2ab20641bc6d04fd1b62d' '--ghc-arg=-package-id' '--ghc-arg=base-4.18.0.0' '--ghc-arg=-package-id' '--ghc-arg=cabal-testsuite-3-inplace' '--ghc-arg=-package-id' '--ghc-arg=clock-0.8.4-4faceb736193c59834ecdeea1311018e03f8c666706c3be6e2af59ff1cb32f39' '--ghc-arg=-package-id' '--ghc-arg=exceptions-0.10.7' '--ghc-arg=-package-id' '--ghc-arg=filepath-1.4.100.1' '--ghc-arg=-package-id' '--ghc-arg=optparse-applicative-0.16.1.0-fd1c2c1dca104cc0722f1df4820eedb42f27a5bb6f9729d35a66e9b7e306f979' '--ghc-arg=-package-id' '--ghc-arg=process-1.6.17.0' '--ghc-arg=-package-id' '--ghc-arg=transformers-0.6.1.0' PackageTests/Get/OnlyDescription/cabal.test.hs --builddir /home/allbery/Sources/cabal/dist-newstyle/build/x86_64-linux/ghc-9.6.2/cabal-testsuite-3 PackageTests/Get/OnlyDescription/cabal.test.hs --with-cabal /home/allbery/Sources/cabal/dist-newstyle/build/x86_64-linux/ghc-9.6.2/cabal-install-3.11.0.0/x/cabal/build/cabal/cabal
stdout:
+ /usr/bin/tar -czf /home/allbery/Sources/cabal/cabal-testsuite/PackageTests/Get/OnlyDescription/cabal.dist/repo/criterion-1.1.4.0.tar.gz -C /home/allbery/Sources/cabal/cabal-testsuite/PackageTests/Get/OnlyDescription/./repo/ criterion-1.1.4.0
"/home/allbery/Sources/cabal/cabal-testsuite/PackageTests/Get/OnlyDescription/cabal.dist/home/.cabal/config"
"with-compiler: /home/allbery/.local/bin/ghc\nrepository test-local-repo\n  url: file+noindex:///home/allbery/Sources/cabal/cabal-testsuite/PackageTests/Get/OnlyDescription/cabal.dist/repo\nremote-repo-cache: /home/allbery/Sources/cabal/cabal-testsuite/PackageTests/Get/OnlyDescription/cabal.dist/home/.cabal/packages\n"
# cabal v2-update
+ /home/allbery/Sources/cabal/dist-newstyle/build/x86_64-linux/ghc-9.6.2/cabal-install-3.11.0.0/x/cabal/build/cabal/cabal v2-update '-vverbose +markoutput +nowrap' --builddir /home/allbery/Sources/cabal/cabal-testsuite/PackageTests/Get/OnlyDescription/cabal.dist/work/./dist --project-file cabal.project -j1 -z
Warning: this is a debug build of cabal-install with assertions enabled.
Project settings changed, reconfiguring...
creating /home/allbery/Sources/cabal/cabal-testsuite/PackageTests/Get/OnlyDescription/cabal.dist/work/dist
creating /home/allbery/Sources/cabal/cabal-testsuite/PackageTests/Get/OnlyDescription/cabal.dist/work
creating /home/allbery/Sources/cabal/cabal-testsuite/PackageTests/Get/OnlyDescription/cabal.dist/work/dist
creating /home/allbery/Sources/cabal/cabal-testsuite/PackageTests/Get/OnlyDescription/cabal.dist/work/dist/cache
The package description file cabal-install/cabal-install.cabal has warnings: cabal-install/cabal-install.cabal:253:4: Inconsistent indentation. Indentation jumps at lines 253
this build was affected by the following (project) config files:
- /home/allbery/Sources/cabal/cabal.project
-----BEGIN CABAL OUTPUT-----
Downloading the latest package list from test-local-repo
-----END CABAL OUTPUT-----
Updating index cache file /home/allbery/Sources/cabal/cabal-testsuite/PackageTests/Get/OnlyDescription/cabal.dist/repo/noindex.cache ...
Entries in file+noindex repository test-local-repo
- criterion-1.1.4.0
creating /home/allbery/Sources/cabal/cabal-testsuite/PackageTests/Get/OnlyDescription/cabal.dist/repo
Index cache updated
# cabal update
+ /home/allbery/Sources/cabal/dist-newstyle/build/x86_64-linux/ghc-9.6.2/cabal-install-3.11.0.0/x/cabal/build/cabal/cabal update '-vverbose +markoutput +nowrap' --builddir /home/allbery/Sources/cabal/cabal-testsuite/PackageTests/Get/OnlyDescription/cabal.dist/work/./dist
Warning: this is a debug build of cabal-install with assertions enabled.
this build was affected by the following (project) config files:
- /home/allbery/Sources/cabal/cabal.project
-----BEGIN CABAL OUTPUT-----
Downloading the latest package list from test-local-repo
-----END CABAL OUTPUT-----
Updating index cache file /home/allbery/Sources/cabal/cabal-testsuite/PackageTests/Get/OnlyDescription/cabal.dist/repo/noindex.cache ...
Entries in file+noindex repository test-local-repo
- criterion-1.1.4.0
creating /home/allbery/Sources/cabal/cabal-testsuite/PackageTests/Get/OnlyDescription/cabal.dist/repo
Index cache updated
# cabal get
+ /home/allbery/Sources/cabal/dist-newstyle/build/x86_64-linux/ghc-9.6.2/cabal-install-3.11.0.0/x/cabal/build/cabal/cabal get '-vverbose +markoutput +nowrap' criterion --only-package-description
Warning: this is a debug build of cabal-install with assertions enabled.
Reading available packages of test-local-repo...
Using most recent state (could not read timestamp file)
index-state(test-local-repo) = 
CallStack (from HasCallStack):
  withMetadata, called at src/Distribution/Simple/Utils.hs:410:12 in Cabal-3.11.0.0-inplace:Distribution.Simple.Utils
-----BEGIN CABAL OUTPUT-----
Error: cabal: The file "criterion-1.1.4.0.cabal" already exists, not overwriting.
-----END CABAL OUTPUT-----


stderr:
*** Exception: Command /home/allbery/Sources/cabal/dist-newstyle/build/x86_64-linux/ghc-9.6.2/cabal-install-3.11.0.0/x/cabal/build/cabal/cabal get '-vverbose +markoutput +nowrap' criterion --only-package-description failed.
Output:
Warning: this is a debug build of cabal-install with assertions enabled.
Reading available packages of test-local-repo...
Using most recent state (could not read timestamp file)
index-state(test-local-repo) = 
CallStack (from HasCallStack):
  withMetadata, called at src/Distribution/Simple/Utils.hs:410:12 in Cabal-3.11.0.0-inplace:Distribution.Simple.Utils
-----BEGIN CABAL OUTPUT-----
Error: cabal: The file "criterion-1.1.4.0.cabal" already exists, not overwriting.
-----END CABAL OUTPUT-----




*** unexpected failure for PackageTests/Get/OnlyDescription/cabal.test.hs

@ffaf1
Copy link
Collaborator

ffaf1 commented Aug 11, 2023

I switched to mergify/bp/3.10/pr-8919 and there are numerous unresolved conflicts, is this normal?
edit: ok I am stupid, of course this is a backport.

@Mikolaj
Copy link
Member

Mikolaj commented Aug 17, 2023

Any (partial) progress here? Any experiments that failed?

@Kleidukos
Copy link
Member

cc @coot as you can see it's apparently more complex than what we thought

@Mikolaj
Copy link
Member

Mikolaj commented Sep 1, 2023

Shall this be closed due to #9213 being merged?

@Kleidukos
Copy link
Member

yes

@Kleidukos Kleidukos closed this Sep 1, 2023
@mergify mergify bot deleted the mergify/bp/3.10/pr-8919 branch September 1, 2023 12:41
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.

6 participants