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 init --libandexe should add the library to the build-depends of the executable #7256
bnfc --version || cabal install BNFC
mkdir -p myparser
cd myparser
echo "Foo. Bar ::= Integer" > Foo.cf
bnfc -o src -d -m Foo.cf
make -C src
mv src/Foo/Test.hs Main.hs
cabal v2-init --libandexe --application-dir=.
cabal v2-build all
cat myparser.cabal
The cabal build fails with errors like
Main.hs:9:1: error:
Could not load module ‘Foo.Lex’
It is a member of the hidden package ‘myparser-0.1.0.0’.
Perhaps you need to add ‘myparser’ to the build-depends in your .cabal file.
Manually adding myparser to the build-depends of the executable stanza fixes the problem.
Except for the warning now emitted by cabal which is obviously a lie:
Warning: The package has an extraneous version range for a dependency on an
internal library: myparser >=0 && ==0.1.0.0. This version range includes the
current package but isn't needed as the current package's library will always
be used.
Activity
emilypi commentedon Jan 28, 2021
It's almost never the case that I wouldn't want this. 👍 on the idea.