The issue was with pandoc-crossref.
Apparently, it doesnt suppor ghc 9.0 yet, per this issue: https://github.com/lierdakil/pandoc-crossref/issues/312

I am very sorry for reporting it here, I am used to install both programs together, since they are closely tied up, and only after guidance from cabal team I connected the dots.

Dne středa 16. června 2021 v 7:47:03 UTC+2 uživatel krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org napsal:
I am using cabal v. 3.4.0.0.

I have tested commands you provided.

```
cabal clean
cabal update
```

runs through OK, `cabal build` asks me for `cabal.project` file. I might have written misleading information -- I was using command:

```
cabal install pandoc pandoc-crossref
```

I was not compiling repo clone directly from source (thats how I would get the `cabal.project` file, correct?)
This `cabal install` command runs through with ghc 8.10.5, but fails with ghc 9.0.1. The reported error seems very strange to me, because if I understand correctly, cabal is for some reason trying to use very old version of `data-accessor` package ... ?
Let me know if I should move my question elsewhere (reddit, SO, cabal issues), this seems mostly like some hidden hickup in my setup ...

Addendum: Haskell setup

I am using `ghcup` to get haskell running. I have moved on it recently. Before then, I was using Manjaro stable repo to get pandoc and pandoc-crossref, but that becomes clunky when I want to make new projects with cabal (at least to me).

1. I removed pandoc, pandoc-crossref, ghc, ghc-static and cabal-install from my packages
2. I removed orphaned packages, mostly haskell libraries installed by Manjaro. I have no idea whether I have still some installed. If that might be the cause, please let me know. As system package, I was having installed ghc 8.10.5, but searching packages with pacman gives me no haskell-* packages, as they are named in Manjaro/Arch
3. I installed ghcup from here: https://www.haskell.org/ghcup/
4. I installed cabal (and stack) with ghcup
5. I installed pandoc and pandoc-crossref, all went OK, because ghcup seems to use ghc 8.10.5 as default for new installation
6. I noticed warning message from ghcup, that there is newer ghc version. I installed it with ghcup and set it as my new default
7. I deleteted `$HOME/.ghc` and `$HOME/.cabal` folders, since reportedly they cause issues after upgrading ghc or cabal
8. I ran `cabal update`
9. I repeated `cabal install pandoc pandoc-crossref` (with active ghc v. 9.0.1) but it throws error I posted in the beginning.
Dne středa 16. června 2021 v 0:17:13 UTC+2 uživatel John MacFarlane napsal:

We do CI with ghc 9.0.1, so the builds are confirmed to work.
Try

cabal clean
cabal update
cabal build

Are you using up-to-date cabal?

"krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org" <krulis....-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:

> As Manjaro (Arch derivative) user learning Haskell I am a little struggling
> to set up functional environment for working with Haskell. Currently, I
> have landed on using `ghcup` + `cabal` to manage everything haskell
> related. I have good experience with `rustup` + `cargo`, so I hope my
> experience with `ghcup` will be also "UP."
>
> With that, I am landing on compiling pandoc from source, not downloading
> binary package. Compilation with ghc v. 8.10.5 works as expected, but with
> ghc 9.0.1 (latest I believe) it fails with this output:
>
> ```
> Resolving dependencies...
> cabal: Could not resolve dependencies:
> [__0] trying: pandoc-2.14.0.2 (user goal)
> [__1] trying: unicode-collation-0.1.3 (dependency of pandoc)
> [__2] trying: template-haskell-2.17.0.0/installed-2.17.0.0 (dependency of
> unicode-collation)
> [__3] trying: skylighting-core-0.10.5.1 (dependency of pandoc)
> [__4] trying: transformers-0.5.6.2/installed-0.5.6.2 (dependency of
> skylighting-core)
> [__5] trying: containers-0.6.4.1/installed-0.6.4.1 (dependency of pandoc)
> [__6] trying: base-4.15.0.0/installed-4.15.0.0 (dependency of pandoc)
> [__7] trying: pandoc-crossref-0.3.11.0 (user goal)
> [__8] next goal: data-accessor-template (dependency of pandoc-crossref)
> [__8] rejecting: data-accessor-template-0.2.1.16 (conflict:
> template-haskell==2.17.0.0/installed-2.17.0.0, data-accessor-template =>
> template-haskell>=2.11 && <2.17)
> [__8] skipping: data-accessor-template-0.2.1.15,
> data-accessor-template-0.2.1.14, data-accessor-template-0.2.1.13,
> data-accessor-template-0.2.1.12, data-accessor-template-0.2.1.11,
> data-accessor-template-0.2.1.10, data-accessor-template-0.2.1.9,
> data-accessor-template-0.2.1.8, data-accessor-template-0.2.1.7,
> data-accessor-template-0.2.1.6, data-accessor-template-0.2.1.5,
> data-accessor-template-0.2.1.4, data-accessor-template-0.2.1.3,
> data-accessor-template-0.2.1.2, data-accessor-template-0.2.1.1,
> data-accessor-template-0.2.1, data-accessor-template-0.2,
> data-accessor-template-0.1.4, data-accessor-template-0.1.3,
> data-accessor-template-0.1.2, data-accessor-template-0.1.1 (has the same
> characteristics that caused the previous version to fail: excludes
> 'template-haskell' version 2.17.0.0)
> [__8] fail (backjumping, conflict set: data-accessor-template,
> pandoc-crossref, template-haskell)
> After searching the rest of the dependency tree exhaustively, these were the
> goals I've had most trouble fulfilling: pandoc, yaml, pandoc-crossref, base,
> template-haskell, data-accessor-template, transformers, skylighting-core,
> containers, unicode-collation
> Try running with --minimize-conflict-set to improve the error message.
> ```
>
> Is it known state of things, or is it some error on my side?
> Thanks in advance for any guidance in this, regards
> Tomas
>
> --
> You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discus...-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
> To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/649e1e26-1e08-4d95-a69f-8ee88d4643f7n%40googlegroups.com.

--
You received this message because you are subscribed to the Google Groups "pandoc-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pandoc-discuss+unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org.
To view this discussion on the web visit https://groups.google.com/d/msgid/pandoc-discuss/1479218a-3179-415c-9d80-058f66a72754n%40googlegroups.com.