Description of problem ====================== Cli tool `hakyll-init` fails to create example site, as explained in Building the example site[1] (upstream documentation). [1] https://jaspervdj.be/hakyll/tutorials/01-installation.html Version-Release number of selected component ============================================ ``` # rpm -qa | grep hakyll ghc-hakyll-4.13.4.0-3.fc33.x86_64 ghc-hakyll-doc-4.13.4.0-3.fc33.noarch ghc-hakyll-devel-4.13.4.0-3.fc33.x86_64 ``` How reproducible ================ 100% Steps to Reproduce ================== 1. mkdir my-example 2. hakyll-init my-example 3. ls my-example Actual results ============== The tool doesn't create an example site, it only creates a cabal file: ``` $ hakyll-init my-example Creating my-example/my-example.cabal $ ls my-example/ my-example.cabal ``` Expected results ================ All files for the hakyll example site are present in the my-example dir. See eg. files created by hakyll-init when installed via stack: ``` $ stack exec hakyll-init -- -f . Creating ./about.rst Creating ./templates/default.html Creating ./templates/post-list.html Creating ./templates/post.html Creating ./templates/archive.html Creating ./contact.markdown Creating ./css/default.css Creating ./images/haskell-logo.png Creating ./site.hs Creating ./index.html Creating ./posts/2015-11-28-carpe-diem.markdown Creating ./posts/2015-12-07-tu-quoque.markdown Creating ./posts/2015-08-12-spqr.markdown Creating ./posts/2015-10-07-rosa-rosa-rosam.markdown Creating ./hakyll-tutorial.cabal ``` Additional info =============== I'm not sure if hakyll-init is expected to work in the rpm package. Related problem is that hakyll-init fails to create my-example directory if such directory doesn't exist: ``` $ hakyll-init my-example Creating my-example/my-example.cabal hakyll-init: my-example/my-example.cabal: openFile: does not exist (No such file or directory) ```
The example is actually packaged though: ``` $ ls -l /usr/share/doc/ghc-hakyll-devel/example total 32 -rw-r--r--. 1 root root 724 Dec 19 2015 about.rst -rw-r--r--. 1 root root 129 Dec 19 2015 contact.markdown drwxr-xr-x. 2 root root 4096 Jan 9 17:57 css drwxr-xr-x. 2 root root 4096 Jan 9 17:57 images -rw-r--r--. 1 root root 352 Dec 19 2015 index.html drwxr-xr-x. 2 root root 4096 Jan 9 17:57 posts -rw-r--r--. 1 root root 2202 Feb 26 2020 site.hs drwxr-xr-x. 2 root root 4096 Jan 9 17:57 templates $ rpm -qf /usr/share/doc/ghc-hakyll-devel/example ghc-hakyll-devel-4.13.4.0-3.fc33.x86_64 ```
Looking at output of `strace hakyll-init .`, I see that hakyll-init looks for the example file in /usr/share/hakyll-4.13.4.0/example directory: ``` rt_sigprocmask(SIG_SETMASK, [], NULL, 8) = 0 stat("/usr/share/hakyll-4.13.4.0/example", 0x4200106a70) = -1 ENOENT (No such file or directory) getcwd("/home/martin/tvorba/hakyll-tutorial", 4096) = 36 ``` And indeed if I symlink the example directory there: ``` # ls -l /usr/share/hakyll-4.13.4.0/example lrwxrwxrwx. 1 root root 39 Mar 24 23:58 /usr/share/hakyll-4.13.4.0/example -> /usr/share/doc/ghc-hakyll-devel/example ``` hakyll-init starts to work: ``` $ hakyll-init . Creating ./templates/post-list.html Creating ./templates/post.html Creating ./templates/default.html Creating ./templates/archive.html Creating ./index.html Creating ./images/haskell-logo.png Creating ./site.hs Creating ./contact.markdown Creating ./css/default.css Creating ./about.rst Creating ./posts/2015-10-07-rosa-rosa-rosam.markdown Creating ./posts/2015-08-12-spqr.markdown Creating ./posts/2015-11-28-carpe-diem.markdown Creating ./posts/2015-12-07-tu-quoque.markdown Creating ./hakyll-tutorial.cabal ``` So this bug could be solved either by packaging the example into expected location, or patching hakyll to look for the example files in the %doc dir instead. The 1st option would be bit easier to do, the latter would requite bit tweaking, as hakyll-init searches for location of the example directory via cabal function getDataFileName.
Thank you for reporting this. I don't actually use hakyll myself - so it is helpful feedback.
FEDORA-2021-fb5b8cf6f2 has been submitted as an update to Fedora 34. https://bodhi.fedoraproject.org/updates/FEDORA-2021-fb5b8cf6f2
FEDORA-2021-dc750b96a0 has been submitted as an update to Fedora 33. https://bodhi.fedoraproject.org/updates/FEDORA-2021-dc750b96a0
FEDORA-2021-e76664b72d has been submitted as an update to Fedora 32. https://bodhi.fedoraproject.org/updates/FEDORA-2021-e76664b72d
Thanks for the quick fix.
FEDORA-2021-e76664b72d has been pushed to the Fedora 32 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-e76664b72d` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-e76664b72d See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-dc750b96a0 has been pushed to the Fedora 33 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-dc750b96a0` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-dc750b96a0 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
(In reply to Martin B. from comment #7) > Thanks for the quick fix. Thank you for testing
FEDORA-2021-fb5b8cf6f2 has been pushed to the Fedora 34 testing repository. Soon you'll be able to install the update with the following command: `sudo dnf upgrade --enablerepo=updates-testing --advisory=FEDORA-2021-fb5b8cf6f2` You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2021-fb5b8cf6f2 See also https://fedoraproject.org/wiki/QA:Updates_Testing for more information on how to test updates.
FEDORA-2021-fb5b8cf6f2 has been pushed to the Fedora 34 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2021-dc750b96a0 has been pushed to the Fedora 33 stable repository. If problem still persists, please make note of it in this bug report.
FEDORA-2021-e76664b72d has been pushed to the Fedora 32 stable repository. If problem still persists, please make note of it in this bug report.