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

Command to build an sdist #9025

Open
michaelpj opened this issue Jun 16, 2023 · 6 comments
Open

Command to build an sdist #9025

michaelpj opened this issue Jun 16, 2023 · 6 comments

Comments

@michaelpj
Copy link
Collaborator

At the moment it's not that easy to build a generated sdist. You can unpack it yourself and build it from there, but it would be nice to have a one-command way to do this.

This is useful to catch issues like missing extra-source-files, which seems to be quite common (and just bit me!).

I would be happy with:

  • cabal build <sdist path>, ideally working for any such cabal command, including haddock
  • cabal sdist --build

Related:

@jneira
Copy link
Member

jneira commented Jun 16, 2023

iirc you can install tarballs with cabal install path/to/package.tar.gz, is it not suitable for your workflow?

@michaelpj
Copy link
Collaborator Author

Discussed a bit on IRC, but I interpret cabal install as very side-effect-y, which is very much not what I want. I want to build it! And I might want to test it or haddock it also.

@andreabedini
Copy link
Collaborator

Note that the command line help says that you can do cabal build ./sdist.tgz but IIRC it does not work.

I'd also stay clear of cabal install.

Question: how do would you expect it to work? Should it be build like a local parkage? (Where is the build directory then?) or like a configured package (like extra-packages in cabal.project)?

@andreabedini
Copy link
Collaborator

I remembered but not quite correctly. #7328 talks about specifying a source directory not a source tarball.

@Mikolaj
Copy link
Member

Mikolaj commented Jun 17, 2023

Question: how do would you expect it to work? Should it be build like a local parkage? (Where is the build directory then?) or like a configured package (like extra-packages in cabal.project)?

IIRC, the idea would be to do what cabal install does, namely pretend it's a non-local package just like all the others involved in the build. No idea about ' configured package (like extra-packages in cabal.project)' vs what cabal install does.

@andreabedini
Copy link
Collaborator

I mean like a named package can be listed in extra-packages in cabal.project, this makes it a non-local package. Notice you can use package: ../path/to/sdist but that becomes a local package. TBH I haven't looked into CmdInstall.hs enough to know what it does :)

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