Skip to content

Allow overriding defaultPackageDesc #630

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

Closed
bos opened this issue May 24, 2012 · 3 comments
Closed

Allow overriding defaultPackageDesc #630

bos opened this issue May 24, 2012 · 3 comments

Comments

@bos
Copy link
Contributor

bos commented May 24, 2012

(Imported from Trac #637, reported by guest on 2010-02-19)

I'm trying to keep the source of multiple packages in a single source repository. Unfortunately, I cannot maintain a .cabal file per package, because some commands invoke function defaultPackageDesc unconditionally.

I tried using defaultMainNoRead instead of defaultMain
and passing the desired package name through the environment. This solution doesn't work at all in 1.6.0.3. It works only partially in HEAD: Setup configure and Setup build work but Setup sdist does not because it ignores the readDesc field and invokes defaultPackageDesc unconditionally.

Would it be possible to add a field to UserHooks which would specify the .cabal filename to use? Then defaultPackageDesc should be always called through this field, never directly, and could thus be consistently overridden.

@sethfowler
Copy link

Chiming in here to add my support for this request. I recently got bit by the fact that sdist ignores readDesc, which is unfortunate, as it seems like the cleanest approach to programmatically populating fields like extra-source-files.

@ttuegel ttuegel added this to the _|_ milestone Apr 23, 2015
@thumphries
Copy link
Collaborator

This also bit me recently. I was also programmatically populating extra-source-files.

Any command ignoring the readDesc hook is out of line. Note that sdist now does the expected thing ( #3491 ) , though there are other issues such as #3552 to be ironed out.

Long run I would expect our use case to disappear in favour of globstar #3178 , so this issue will be doubly dealt with. I am unsure of the original author's use case, however, so I am hesitant to close this issue.

@jneira
Copy link
Member

jneira commented Jun 21, 2022

It seems to me that I'm trying to keep the source of multiple packages in a single source repository. is just what v2 build and cabal.project gives us. Otoh we are trying to reduce the use of custom setups .
The extra-source-filesuse case is also covered as noted above so i am gonna close this.
Feel free to reopen if this is still needed for an use case not took in account

@jneira jneira closed this as completed Jun 21, 2022
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

5 participants