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

broken symlinks for configuration files are silently ignored #9937

Open
Flupp opened this issue Apr 25, 2024 · 0 comments
Open

broken symlinks for configuration files are silently ignored #9937

Flupp opened this issue Apr 25, 2024 · 0 comments

Comments

@Flupp
Copy link

Flupp commented Apr 25, 2024

When a configuration file like cabal.project, cabal.project.local, or cabal.project.freeze is a broken symlink, it is silently ignored.

For example:

cd "$(mktemp --directory)"
cabal init --exe --simple
ln -s I-do-not-exist cabal.project
cabal build

The last step succeeds unexpectedly.

I see that this behavior is consistent with shell command test -e cabal.project. However, with the current behavior, a subtly wrong symlink can easily be overlooked, especially in an automated build environment (which is actually where I stumbled over it). Hence, I suggest having an existence test more like test -e FILE || test -h FILE.

System information

  • Arch Linux
  • cabal-install version 3.10.3.0
    compiled using version 3.10.3.0 of the Cabal library
  • The Glorious Glasgow Haskell Compilation System, version 9.4.8
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

1 participant