dlang / dub

Package and build management system for D
MIT License
661 stars 227 forks source link

gdc: error: unrecognized command-line option ‘-preview=dip1000’; did you mean ‘-fpreview=dip1000’? #2937

Open mw66 opened 1 week ago

mw66 commented 1 week ago

System information

https://github.com/atilaneves/unit-threaded/issues/314

Bug Description

Hi, I'm trying to build unit-threaded/2.2.0, using gdc:

$ gdc --version
gdc (GCC) 14.1.0

got an error:

gdc: error: unrecognized command-line option ‘-preview=dip1000’; did you mean ‘-fpreview=dip1000’?

found this:

https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gdc.pdf

looks like GDC's flag called fpreview instead of preview.

Expected Behavior

I think instead of asking the programmer to specify:

dflags-dmd {...} dflags-ldc {...} dflags-gdc {...}

separately, dub can do such conversion to make life easier.

mw66 commented 1 week ago

https://github.com/atilaneves/dpp/issues/348

This is a related issue: in many dub packages from https://code.dlang.org/

the project dub.json it has flag "-dip25", however gdc does not recognize this:

gdc -dip25 ...

d21: warning: unrecognized gcc debugging option: i
d21: warning: unrecognized gcc debugging option: 2
d21: warning: unrecognized gcc debugging option: 5

Instead of asking each library owner update their dub.json file, I think it's better dub can translate this flag to gdc to -fpreview=dip25, so all the existing libraries can be build without change.