You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
cabal sdist --project-file doesn't respect the option #7241
I'm finding this to be the case with cabal-install-3.8 too.
> cabal sdist --help
Generate a source distribution file (.tar.gz).
Usage: cabal sdist [FLAGS] [PACKAGES]
Generates tarballs of project packages suitable for upload to Hackage.
Flags for sdist:
--project-file=FILE Set the name of the cabal.project file to
search for in parent directories
-z, --ignore-project Ignore local project configuration
This PR is 3.8.0.20220526, as see in release-notes/cabal-install-3.8.0.20220526.md, so I wouldn't count on master branch compiled from source doing any better. However, you could then run relevant tests and see if they behave any different than your use case and, e.g., add a new failing test to include in a new ticket [edit: or this ticket], with a better understanding what the failing scenario is.
I'm on branch cabal-install-v3.8.1.0-rc1. Before I attempt a reproduction I'd like to make sure I understand the help.
> cabal --version
cabal-install version 3.8.0.20220526
compiled using version 3.8.0.20220526 of the Cabal library
> cabal sdist --help
Generate a source distribution file (.tar.gz).
Usage: cabal sdist [FLAGS] [PACKAGES]
Generates tarballs of project packages suitable for upload to Hackage.
Flags for sdist:
-h, --help Show this help text
--project-file=FILE Set the name of the cabal.project file to
search for in parent directories
-z, --ignore-project Ignore local project configuration
-v, --verbose[=n] Control verbosity (n is 0--3, default
verbosity level is 1)
--builddir=DIR The directory where Cabal puts generated build
files (default dist)
-l, --list-only Just list the sources, do not make a tarball
--null-sep Separate the source files with NUL bytes
rather than newlines.
-o, --output-directory=PATH Choose the output directory of this command.
'-' sends all output to stdout
--project-file=FILE
Set the name of the cabal.project file to search for in parent directories
Can I use this to refer to a project file in the current directory?
If I set --project-file=foo.project then is the default cabal.project now ignored?
What are the relative relationships allowed between *.project and *.cabal files? Does a *.project have to be a sibling or parent of all *.cabal files it includes?
If I set both --project-file=foo.project and --ignore-project then is foo.project ignored. What about cabal.project? If I have one of those too, is that ignored as well?
.. option:: --ignore-project
Ignores the local ``cabal.project`` file and uses the default
configuration with the local ``foo.cabal`` file. Note that
if this flag is set while the ``--project-file`` flag is also
set then this flag will be ignored.
(note that one needs to run cabal clean between sdist calls to properly test the behavior with different project file flags, as there's some caching of the configuration -- that's probably a separate thing we want to fix)
I think it focused on --ignore-project and also testing --project-file was hard due to it being set by the testing harness IIUC, so only the standard project files name was tested IIRC.
@Mikolaj, I was able to use withProjectFile for this:
Activity
philderbeast commentedon Jun 11, 2022
I'm finding this to be the case with
cabal-install-3.8too.gbaz commentedon Jun 11, 2022
I would have thought this would be resolved by #8109 ?
philderbeast commentedon Jun 11, 2022
Still a problem with cabal I installed with ghcup.
I'll install from source and try that too.
Mikolaj commentedon Jun 13, 2022
This PR is 3.8.0.20220526, as see in release-notes/cabal-install-3.8.0.20220526.md, so I wouldn't count on master branch compiled from source doing any better. However, you could then run relevant tests and see if they behave any different than your use case and, e.g., add a new failing test to include in a new ticket [edit: or this ticket], with a better understanding what the failing scenario is.
philderbeast commentedon Jun 15, 2022
Looking now, which of these branches should I try?
Mikolaj commentedon Jun 15, 2022
We haven't broken master branch yet, I trust. But you can also use https://github.com/haskell/cabal/tree/cabal-install-v3.8.1.0-rc1 for extra safety.
philderbeast commentedon Jun 16, 2022
I'm on branch
cabal-install-v3.8.1.0-rc1. Before I attempt a reproduction I'd like to make sure I understand the help.Can I use this to refer to a project file in the current directory?
If I set
--project-file=foo.projectthen is the defaultcabal.projectnow ignored?What are the relative relationships allowed between
*.projectand*.cabalfiles? Does a*.projecthave to be a sibling or parent of all*.cabalfiles it includes?If I set both
--project-file=foo.projectand--ignore-projectthen isfoo.projectignored. What aboutcabal.project? If I have one of those too, is that ignored as well?philderbeast commentedon Jun 16, 2022
I find the rendered command line
cabal sdist --helpunclear but the haddocks are better.cabal/cabal-install/src/Distribution/Client/ProjectFlags.hs
Lines 19 to 27 in 42da820
philderbeast commentedon Jun 16, 2022
This is very brief. It is explained more in source comments that don't get surfaced to
cabal sdist --helpor the haddocks.cabal/cabal-install/src/Distribution/Client/ProjectFlags.hs
Lines 48 to 52 in 42da820
philderbeast commentedon Jun 16, 2022
Here's the latest from the user's guide.
Add test cases that reproduce haskell#7241.
5 remaining items
gbaz commentedon Sep 29, 2022
I tested this on HEAD and it and --ignore-project appear to work. The patch didn't make it into 3.8.1.0 I guess?
I'll optimistically close on that basis.
gbaz commentedon Sep 29, 2022
(note that one needs to run
cabal cleanbetweensdistcalls to properly test the behavior with different project file flags, as there's some caching of the configuration -- that's probably a separate thing we want to fix)Add test cases that reproduce haskell#7241.
Add test cases that reproduce haskell#7241.
philderbeast commentedon Dec 15, 2023
@Mikolaj, I was able to use
withProjectFilefor this:cabal/cabal-testsuite/src/Test/Cabal/Prelude.hs
Lines 344 to 346 in 7478066
Mikolaj commentedon Dec 15, 2023
In #8226? Good to know, thanks.
philderbeast commentedon Dec 15, 2023
Yes, added today in #8226.
Add test cases that reproduce haskell#7241.
Add test cases that reproduce haskell#7241.
Add test cases that reproduce haskell#7241.
Add test cases that reproduce haskell#7241.
Add test cases that reproduce haskell#7241.
Add test cases that reproduce haskell#7241.
Add test cases that reproduce haskell#7241.