dlang / dub

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

silently accepts bad syntax (using sdl) #1382

Open timotheecour opened 6 years ago

timotheecour commented 6 years ago

originally posted in https://github.com/Abscissa/SDLang-D/issues/57 but seems like a dub issue:

edit dub:dub.sdl
add buildRequirements: allowWarnings2 at the end (which is incorrect)
run dub build
it compiles even though correct syntax should be: buildRequirements "allowWarnings"
Abscissa commented 6 years ago

Just to help clarify to the dub folk:

The dub behaviour in question here is how dub should treat tags unrecognized by dub (The example given is valid SDLang syntax, ~I'm 90% certain. I need to double-check whether the space is supposed to be allowed, but IIRC, I think it is.~ Yes, it IS valid syntax). So, in the example of buildRequirements: allowWarnings2, SDLang-D treats this as a tag named "allowWarnings2" from the namespace "buildRequirements". Naturally, "allowWarnings2" isn't a tag recognized by dub.

Since this deals with SDLang-D, and SDLang-D is my thing, and the decision of how to handle unrecognized tags is not part of SDLang's charter, please consider me a neutral third party here. But, if it is deemed intentional that dub ignore unrecognized tags, I'd like to point out a possible compromise: Dub could reserve one or two namespaces for possible future expansion, and disallow any other namespaces being used. Another possibility is to disallow using dub-recognized tag names being used as a namespace on the assumption that such use is likely accidental.