Bug 264049

Summary: Mk/Uses/cabal.mk: 'make make-use-cabal-revs' fails: fetch: http://hackage.haskell.org/package/attoparsec-0.14.4-l-attoparsec-internal/revisions/: Not Found
Product: Ports & Packages Reporter: Yuri Victorovich <yuri>
Component: Ports FrameworkAssignee: Gleb Popov <arrowd>
Status: Closed FIXED    
Severity: Affects Only Me CC: arrowd
Priority: ---    
Version: Latest   
Hardware: Any   
OS: Any   

Description Yuri Victorovich freebsd_committer freebsd_triage 2022-05-17 18:42:59 UTC
I am trying to update security/hs-cryptol to 2.13.0.

I am using these instructions:
1. Define PORTNAME, PORTVERSION and USES=cabal
2. Run `make cabal-extract`. This will fetch the package using devel/hs-cabal-install
3. Run `make cabal-extract-deps`. This will fetch and build all package dependencies, including transitive ones.
4. Run make `make-use-cabal`. This will generate intial USE_CABAL string. Copy&paste it into the port.
5. Run make `make-use-cabal-revs`. This will check packages from current USE_CABAL for available revisions and generate new string. Copy&paste it into the port.
6. Run `make makesum && make clean` and try building the port the usual way.

'make make-use-cabal-revs' fails:
attoparsec-0.14.4_1 \
fetch: http://hackage.haskell.org/package/attoparsec-0.14.4-l-attoparsec-internal/revisions/: Not Found
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.8/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/local/lib/python3.8/json/__init__.py", line 357, in loads
    return _default_decoder.decode(s)
  File "/usr/local/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/local/lib/python3.8/json/decoder.py", line 355, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
*** Error code 1


This appears to be triggered by this item in USE_CABAL: attoparsec-0.14.4-l-attoparsec-internal
Comment 1 Gleb Popov freebsd_committer freebsd_triage 2022-05-17 18:49:21 UTC
Just remove "attoparsec-0.14.4-l-attoparsec-internal" from USE_CABAL, it is a known problem.

I have plans to reimplement make-use-cabal[-revs] targets, but it is just not there yet.

If you are updating Haskell ports, take a look at GHC 9.2.2 WIP branch [1]. It might be better to submit a PR against it.

[1] https://github.com/freebsd/freebsd-ports-haskell/tree/ghc922
Comment 2 Yuri Victorovich freebsd_committer freebsd_triage 2022-05-17 20:18:54 UTC
(In reply to Gleb Popov from comment #1)

Then the build fails (which might be an entirely different problem):

===>  Building for hs-cryptol-2.13.0
cd /disk-samsung/freebsd-ports/security/hs-cryptol/work/cryptol-2.13.0 &&  /usr/bin/env XDG_DATA_HOME=/disk-samsung/freebsd-ports/security/hs-cryptol/work  XDG_CONFIG_HOME=/disk-samsung/freebsd-ports/security/hs-cryptol/work  XDG_CACHE_HOME=/disk-samsung/freebsd-ports/security/hs-cryptol/work/.cache  HOME=/disk-samsung/freebsd-ports/security/hs-cryptol/work PATH=/disk-samsung/freebsd-ports/security/hs-cryptol/work/.bin:/home/yuri/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin NO_PIE=yes MK_DEBUG_FILES=no MK_KERNEL_SYMBOLS=no SHELL=/bin/sh NO_LINT=YES PREFIX=/usr/local  LOCALBASE=/usr/local  CC="cc" CFLAGS="-O2 -pipe -fno-omit-frame-pointer  -fstack-protector-strong -fno-strict-aliasing "  CPP="cpp" CPPFLAGS="-fno-omit-frame-pointer"  LDFLAGS=" -fstack-protector-strong " LIBS=""  CXX="c++" CXXFLAGS="-O2 -pipe -fno-omit-frame-pointer -fstack-protector-strong -fno-strict-aliasing -fno-omit-frame-pointer  "  MANPREFIX="/usr/local" BSD_INSTALL_PROGRAM="install  -s -m 555"  BSD_INSTALL_LIB="install  -s -m 0644"  BSD_INSTALL_SCRIPT="install  -m 555"  BSD_INSTALL_DATA="install  -m 0644"  BSD_INSTALL_MAN="install  -m 444" HOME=/disk-samsung/freebsd-ports/security/hs-cryptol/work/cabal-home cabal new-build --offline --disable-benchmarks --disable-tests --flags ""  exe:cryptol
Warning: No remote package servers have been specified. Usually you would have
one specified in the config file.
Resolving dependencies...
cabal: Could not resolve dependencies:
[__0] trying: cryptol-2.13.0 (user goal)
[__1] unknown package: optparse-applicative (dependency of cryptol)
[__1] fail (backjumping, conflict set: cryptol, optparse-applicative)
After searching the rest of the dependency tree exhaustively, these were the
goals I've had most trouble fulfilling: cryptol, optparse-applicative

*** Error code 1
Comment 3 Gleb Popov freebsd_committer freebsd_triage 2022-05-18 06:18:20 UTC
(In reply to Yuri Victorovich from comment #2)
Yes, this is a different problem. Did you somehow omit "optparse-applicative" too?

I will update this port myself during the GHC 9.2.2 upgrade, but if you wish to do the work, then please make it a PR against https://github.com/freebsd/freebsd-ports-haskell/tree/ghc922
Comment 4 Yuri Victorovich freebsd_committer freebsd_triage 2022-05-18 07:04:28 UTC
(In reply to Gleb Popov from comment #3)

> Did you somehow omit "optparse-applicative" too?

"optparse-applicative" isn't in instructions.


> I will update this port myself during the GHC 9.2.2 upgrade [...]

Please do. Thank you.
Comment 5 Gleb Popov freebsd_committer freebsd_triage 2022-07-31 19:26:19 UTC
This is now not a problem when using a new way to create/update Haskell packages. This new way isn't document yet in Porter Handbook, though.