{"action":"created","issue":{"url":"https://api.github.com/repos/dlang/tools/issues/343","repository_url":"https://api.github.com/repos/dlang/tools","labels_url":"https://api.github.com/repos/dlang/tools/issues/343/labels{/name}","comments_url":"https://api.github.com/repos/dlang/tools/issues/343/comments","events_url":"https://api.github.com/repos/dlang/tools/issues/343/events","html_url":"https://github.com/dlang/tools/pull/343","id":309168145,"number":343,"title":"Fix Issue 18433 - rdmd doesn't respect DFLAGS for its cache hash","user":{"login":"wilzbach","id":4370550,"avatar_url":"https://avatars3.githubusercontent.com/u/4370550?v=4","gravatar_id":"","url":"https://api.github.com/users/wilzbach","html_url":"https://github.com/wilzbach","followers_url":"https://api.github.com/users/wilzbach/followers","following_url":"https://api.github.com/users/wilzbach/following{/other_user}","gists_url":"https://api.github.com/users/wilzbach/gists{/gist_id}","starred_url":"https://api.github.com/users/wilzbach/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wilzbach/subscriptions","organizations_url":"https://api.github.com/users/wilzbach/orgs","repos_url":"https://api.github.com/users/wilzbach/repos","events_url":"https://api.github.com/users/wilzbach/events{/privacy}","received_events_url":"https://api.github.com/users/wilzbach/received_events","type":"User","site_admin":false},"labels":[{"id":548182088,"url":"https://api.github.com/repos/dlang/tools/labels/Blocked","name":"Blocked","color":"b60205","default":false},{"id":881835371,"url":"https://api.github.com/repos/dlang/tools/labels/Enhancement","name":"Enhancement","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2018-03-27T23:23:54Z","updated_at":"2018-03-28T23:14:44Z","closed_at":null,"author_association":"MEMBER","pull_request":{"url":"https://api.github.com/repos/dlang/tools/pulls/343","html_url":"https://github.com/dlang/tools/pull/343","diff_url":"https://github.com/dlang/tools/pull/343.diff","patch_url":"https://github.com/dlang/tools/pull/343.patch"},"body":"Note this is only part of the required fix.\nDMD at the moment doesn't allow to incrementally add to DFLAGS, so this needs to be fixed before this can be merged:\n\n\n```\n> DFLAGS=\"-version=Foo\" ../dmd/generated/linux/release/64/dmd -c -v foo.d\n\npredefs   DigitalMars Posix linux ELFv1 LittleEndian D_Version2 all D_SIMD D_InlineAsm_X86_64 X86_64 CRuntime_Glibc D_LP64 D_PIC assert D_HardFloat\nbinary    ../dmd/generated/linux/release/64/dmd\nversion   v2.079.0-284-g23b2e2e0d\nconfig    ../dmd/generated/linux/release/64/dmd.conf\nDFLAGS    -I../dmd/generated/linux/release/64/../../../../../druntime/import -I../dmd/generated/linux/release/64/../../../../../phobos -L-L../dmd/generated/linux/release/64/../../../../../phobos/generated/linux/release/64 -L--export-dynamic -fPIC\n```\n\n(no `Foo` set here)\n\n\n```\n> DFLAGS=\"-version=Foo\" dmd -conf= -I~/dlang/phobos -I~/dlang/druntime/import -c -v foo.d\n\npredefs   Foo DigitalMars Posix linux ELFv1 LittleEndian D_Version2 all D_SIMD D_InlineAsm_X86_64 X86_64 CRuntime_Glibc D_LP64 D_PIC assert D_HardFloat\nbinary    /home/seb/dlang/dmd/generated/linux/release/64/dmd\nversion   v2.079.0-284-g23b2e2e0d\nconfig    \nDFLAGS    -version=Foo\n```"},"comment":{"url":"https://api.github.com/repos/dlang/tools/issues/comments/377068589","html_url":"https://github.com/dlang/tools/pull/343#issuecomment-377068589","issue_url":"https://api.github.com/repos/dlang/tools/issues/343","id":377068589,"user":{"login":"CyberShadow","id":160894,"avatar_url":"https://avatars0.githubusercontent.com/u/160894?v=4","gravatar_id":"","url":"https://api.github.com/users/CyberShadow","html_url":"https://github.com/CyberShadow","followers_url":"https://api.github.com/users/CyberShadow/followers","following_url":"https://api.github.com/users/CyberShadow/following{/other_user}","gists_url":"https://api.github.com/users/CyberShadow/gists{/gist_id}","starred_url":"https://api.github.com/users/CyberShadow/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/CyberShadow/subscriptions","organizations_url":"https://api.github.com/users/CyberShadow/orgs","repos_url":"https://api.github.com/users/CyberShadow/repos","events_url":"https://api.github.com/users/CyberShadow/events{/privacy}","received_events_url":"https://api.github.com/users/CyberShadow/received_events","type":"User","site_admin":false},"created_at":"2018-03-28T23:14:43Z","updated_at":"2018-03-28T23:14:43Z","author_association":"OWNER","body":"> Make the DFLAGS environment variable a higher priority than the config file.\r\n\r\nI think this would actually break my setup from a few years ago, where I effectively aliased `dmd` to `dmd $DFLAGS`. Making `dmd` read `DFLAGS` suddenly would mean that the options would be parsed twice - which should be fine in most cases, but maybe not when something is parsed between the two and the later DFLAGS ends up canceling it.\r\n\r\n> Remove support for DFLAGS as an environment variable. I would add a warning like @wilzbach suggested when it is overriden by the config file, and I would start deprecation of DFLAGS when set via an environment variable.\r\n\r\nWhy would you want to add a warning when it *is* overridden by the config file? In that situation, removing it completely will have no effect. Did you mean to say that a warning will appear when it is *not* overridden by the config file?\r\n\r\n> Leave everything as is. We could mimic DMD's behavior in rdmd by reusing the code that DMD uses to process the config file, and also have it reuse the same logic to fallback to getting DFLAGS as an environment variable. Or we could just forget about this use case and say that rdmd won't work correctly when DFLAGS is set, in which case we could just say that it is not recommended to use DFLAGS as an environment variable otherwise you will get undefined/unsupported behavior.\r\n\r\nSorry, I've completely lost track of what this is about. If DFLAGS can currently only be set by changing the configuration file, then all we need to do is ensure that the configuration file is one of the \"dependencies\" that rdmd checks the modification time of, which I believe it already does. Right?"}}
{"actor":{"display_login":"CyberShadow"}}