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

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

Open
blackgnezdo opened this issue Mar 13, 2021 · 0 comments
Open

Comments

@blackgnezdo
Copy link
Contributor

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 <oleg.grenrus@iki.fi>
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant