cabal-extras icon indicating copy to clipboard operation
cabal-extras copied to clipboard

cabal-bundler doesn't work for self in openbsd and nix-single modes

Open blackgnezdo opened this issue 4 years ago • 0 comments

This is low severity, just documenting the corner case for other people.

I tried to extract a cabal-bundler recipe for OpenBSD ports with:

% git log -n1
commit 6580467e28204bb44021282f33acc999dd6d50f0 (HEAD -> master, origin/master, origin/HEAD)
Merge: 3f56fb2 bce8976
Author: Oleg Grenrus <[email protected]>
Date:   Thu Mar 11 18:26:40 2021 +0200

    Merge pull request #82 from hasufell/PR/maerwald/non-fatal-unit-missing
    
    Don't error on missing units
% pwd
/tmp/cabal-extras/cabal-bundler
% cabal v2-run -w /usr/local/bin/ghc exe:cabal-bundler -- cabal-bundler --openbsd --executable cabal-bundler -p ../dist-newstyle/cache/plan.json
Downloading https://oleg.fi/gentle-introduction-2021.2.tar.gz
Up to date
[   0.00001] cabal.hackage: Reading Hackage index metadata
[   0.70286] peu.exception: SomeException
UnknownPackageName (PackageName "gentle-introduction")

Same in --nix-single mode:

% cabal v2-run -w /usr/local/bin/ghc exe:cabal-bundler -- cabal-bundler --nix-single --executable cabal-bundler -p ../dist-newstyle/cache/plan.json
Downloading https://oleg.fi/gentle-introduction-2021.2.tar.gz
Up to date
[   0.00001] cabal.hackage: Reading Hackage index metadata
[   0.44828] peu.exception: SomeException
UnknownPackageName (PackageName "gentle-introduction")

Curiously, --curl works, but it doesn't include gentle-introduction-2021.2.tar.gz into the output:

% cabal v2-run -w /usr/local/bin/ghc exe:cabal-bundler -- cabal-bundler --curl --executable cabal-bundler -p ../dist-newstyle/cache/plan.json 2>&1 | tee /tmp/y
Downloading https://oleg.fi/gentle-introduction-2021.2.tar.gz
Up to date
[   0.00001] cabal.hackage: Reading Hackage index metadata
#!/bin/sh
# This file is generated with cabal-bundler
...

Since I needed to write a special case for the manual download anyway, I worked around the problem by extracting the gentle-introduction manually and updating cabal.project with:

-packages: https://oleg.fi/gentle-introduction-2021.2.tar.gz
--- packages: gentle-introduction-2021.1.tar.gz
+-- packages: https://oleg.fi/gentle-introduction-2021.2.tar.gz
+packages: gentle-introduction-2021.2

blackgnezdo avatar Mar 13 '21 21:03 blackgnezdo