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 new-copy or call postCopy hook from new-install #5933

Open
arrowd opened this issue Mar 11, 2019 · 3 comments
Open

Cabal new-copy or call postCopy hook from new-install #5933

arrowd opened this issue Mar 11, 2019 · 3 comments

Comments

@arrowd
Copy link
Collaborator

arrowd commented Mar 11, 2019

I'm using cabal new-build to build and install git-annex package. The package has Custom build type and have postCopy hooks to generate documentation and create .desktop file.

Building with new-build works fine, but postCopy hooks aren't called during cabal new-install, it simply says Up to date. There is also no new-copy command to make them run.

Is there any way to run these hooks from cabal-install?

@phadej
Copy link
Collaborator

phadej commented Mar 11, 2019

My POV is: if you can live without custom Setup.hs you should.
I'm looking at http://hackage.haskell.org/package/git-annex-7.20190219/src/Setup.hs


Writing outside package locations (e.g. to users' directory) is very bad practice, please don't. Make a subcommand or utility to perform post installation to create .desktop.


Links creation for git-annex-shell works by accident, if it works. Note: the #5870, --install-method=copy wouldn't work as expected, AFAICS.


For man pages, wouldn't it be easier for everyone if man pages are pre-processed and included in thesdist git-annex-version.tar.gz?


See however agda/agda#3563 for similar problem, it's somewhat acceptable as there one requires the built agda executable to type-check built-ins.

There

  • buildHook builds interface files (typechecks builtin modules)
  • copy and install hooks expand the package description to include newly generated data files

Yet, even there, I'd rather manually type-check those modules in the distribution specific packaging script (say which makes agda.deb for Ubuntu), than rely on Setup.sh black magic. The problem one tries to solve that, if agda is installed as root globally in root-only writeable place, then builtins have to type-checked by the root. For local installs, the whole exercise is not required.

@arrowd
Copy link
Collaborator Author

arrowd commented Mar 12, 2019

I don't quite get what Setup.sh you are talking about. If it is a plain old shell script, how would it work on Windows? Would another Setup.bat be needed, then?

I'm expecting from a build system to provide me way to do such simple (from my POV, of course) things.

Anyways, I'm not git-annex developer, so I just relay your comments upstream.

@23Skidoo
Copy link
Member

23Skidoo commented Mar 12, 2019

I don't quite get what Setup.sh you are talking about.

It was a typo, @phadej meant Setup.hs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants