dub compiler flags bleeding into other packages
Anonymouse
zorael at gmail.com
Mon Feb 3 11:35:02 UTC 2025
I'm trying to compile my project under gdc, and at some point
`-Wall` and `-Werror` are introduced as compiler flags.
I depend on the `requests` package, which in turn depends on the
`automem` package, which throws a deprecation warning during
compilation and `-Werror` kicks in, erroring out.
```d
name "hello"
targetType "executable"
dependency "requests" version="~>2.1.3"
```
```
$ dub build --compiler=gdc
Warning Configuration [application] of package hello
contains no source files. Please add {"targetType": "none"} to
its package description to avoid building it.
Starting Performing "debug" build using gdc for x86_64.
Building automem 0.6.10: building configuration [library]
/home/zorael/.dub/packages/automem/0.6.10/automem/source/automem/vector.d-mixin-211:211:7: error: cannot throw object of qualified type ‘immutable(BoundsException)’ [-Werror=deprecated]
/home/zorael/.dub/packages/automem/0.6.10/automem/source/automem/vector.d-mixin-211:211:7: error: cannot throw object of qualified type ‘immutable(BoundsException)’ [-Werror=deprecated]
d21: all warnings being treated as errors
Error gdc failed with exit code 1.
```
How do I work around this?
Declaring `dflags "-Wno-deprecated" platform="gdc"` in dub.sdl
does not work.
Setting the `DFLAGS` environment variable with
`DFLAGS="-Wno-deprecated" dub build --compiler=gdc` technically
does compile, but the build becomes a `$DFLAGS`-type build and my
configurations break.
What else can I do?
More information about the Digitalmars-d-learn
mailing list