haskell / haskell/hackage-security

hackage-repo-tool bootstrap fails in a mysterious way if there are no tarballs

Open
#174 3 comments 0 reactions 0 assignees View on GitHub
bug
Dominant language
Haskell
Stars
63
Forks
56
PR merge metrics
No merged PRs in 30d

Description

Steps to reproduce:

1. Run hackage-repo-tool bootstrap on a directory that doesn't exist. Get:
```
ezyang@sabre:~/Dev/labs/localrepo$ /srv/code/hackage-security/dist-newstyle/build/x86_64-linux/ghc-7.10.3/hackage-repo-tool-0.1.1/c/hackage-repo-tool/build/hackage-repo-tool/hackage-repo-tool bootstrap --keys keys --repo repo
/srv/code/labs/localrepo/repo: getDirectoryContents: does not exist (No such file or directory)
```

2. Create the directory and try again.
```
ezyang@sabre:~/Dev/labs/localrepo$ /srv/code/hackage-security/dist-newstyle/build/x86_64-linux/ghc-7.10.3/hackage-repo-tool-0.1.1/c/hackage-repo-tool/build/hackage-repo-tool/hackage-repo-tool bootstrap --keys keys --repo repo
/srv/code/labs/localrepo/repo/index: getDirectoryContents: does not exist (No such file or directory)
```

3. Create the directory and try again
```
ezyang@sabre:~/Dev/labs/localrepo$ /srv/code/hackage-security/dist-newstyle/build/x86_64-linux/ghc-7.10.3/hackage-repo-tool-0.1.1/c/hackage-repo-tool/build/hackage-repo-tool/hackage-repo-tool bootstrap --keys keys --repo repo
/srv/code/labs/localrepo/repo/01-index.tar: openBinaryFile: does not exist (No such file or directory)
```

That last error is incredibly oblique. You can solve it by adding a tarball to the `package` subdir. Totally non-obvious.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce the failure by running hackage-repo-tool bootstrap with an empty repository, creating the repo and repo/index directories as described. Trace the bootstrap path that handles the package directory and missing 01-index.tar. Done means an empty repository produces a clear, actionable result instead of the oblique missing-tarball error.

Written by the indexing model from the issue text.

Assessment

Tech stack
haskell
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.