Skip to content

v2-install does not apply flags to build #6472

Open

Description

@Rufflewind

Describe the bug

v2-install does not apply flags (-fXXX) to the build.

To Reproduce
Steps to reproduce the behavior:

$ cabal v2-install -fwith_xft xmobar
...
$ ~/.cabal/bin/xmobar                                          
Warning: Xmobar must be built with the with_xft flag to support font 'xft:Oxygen Mono:size=10,DejaVu Sans Mono:size=10.' Falling back on default.

My xmobar config is: https://github.com/Rufflewind/config/blob/0e071d057236e7e839a44c86ffed6068b28927de/home/.config/xmobar/xmobarrc

Expected behavior

xmobar should be built with_xft enabled, so the warning isn't supposed to appear.

System information

  • Operating system: Linux 5.4.6-arch3-1 #1 SMP PREEMPT Tue, 24 Dec 2019 04:36:53 +0000 x86_64 GNU/Linux
  • cabal-install version 2.4.0.0, compiled using version 2.4.0.1 of the Cabal library
  • ghc 8.6.5

Activity

  1. anka-213 commented on Feb 1, 2026

    @anka-213

    Is there any known workaround to this issue? I would like to install an application that refuses to build on my machine without some flags. I guess I could clone down the application and modify the .cabal.local-file, but is there an easier way?

    Edit: Yes, there was, at least for my issue! The answer was --constraint="packageName +flagName" as the documentation for --flags says.

    I guess -f should at least warn that you need to use --constraints instead if you try to apply it to cabal v2-install

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions