{"action":"opened","issue":{"url":"https://api.github.com/repos/deplinenoise/tundra/issues/244","labels_url":"https://api.github.com/repos/deplinenoise/tundra/issues/244/labels{/name}","comments_url":"https://api.github.com/repos/deplinenoise/tundra/issues/244/comments","events_url":"https://api.github.com/repos/deplinenoise/tundra/issues/244/events","html_url":"https://github.com/deplinenoise/tundra/issues/244","id":58420302,"number":244,"title":"Generated code split between debug and release","user":{"login":"leidegre","id":63085,"avatar_url":"https://avatars.githubusercontent.com/u/63085?v=3","gravatar_id":"","url":"https://api.github.com/users/leidegre","html_url":"https://github.com/leidegre","followers_url":"https://api.github.com/users/leidegre/followers","following_url":"https://api.github.com/users/leidegre/following{/other_user}","gists_url":"https://api.github.com/users/leidegre/gists{/gist_id}","starred_url":"https://api.github.com/users/leidegre/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leidegre/subscriptions","organizations_url":"https://api.github.com/users/leidegre/orgs","repos_url":"https://api.github.com/users/leidegre/repos","events_url":"https://api.github.com/users/leidegre/events{/privacy}","received_events_url":"https://api.github.com/users/leidegre/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-02-20T22:35:55Z","updated_at":"2015-02-20T22:35:55Z","closed_at":null,"body":"I have a custom `DefRule` for Google's Protocol Buffer files.\r\n\r\n    DefRule {\r\n      Name            = \"Protobuf\",\r\n      Pass            = \"CodeGeneration\",\r\n      ConfigInvariant = true,\r\n      Command         = \"$(OBJECTDIR)$(SEP)protoc$(PROGSUFFIX) --error_format=msvs --cpp_out=$(OBJECTDIR) $(PROTO_PATH:n:p-I) $(<)\",\r\n      ImplicitInputs  = { \"$(OBJECTDIR)$(SEP)protoc$(PROGSUFFIX)\" },\r\n      Blueprint = {\r\n        Include = { Type = \"string\", Required = false },\r\n        Source = { Type = \"table\", Required = true },\r\n      },\r\n      Setup = function (env, data)\r\n    \t\tif data.Include then\r\n    \t\t\tenv:set(\"PROTO_PATH\", native.getcwd() .. \"/\" .. data.Include)\r\n    \t\tend\r\n    \t\tlocal outputs = {}\r\n    \t\tfor _, inputFile in ipairs(data.Source) do\r\n    \t\t\tlocal f = path.get_filename_base(inputFile)\r\n    \t\t\toutputs[#outputs + 1] = \"$(OBJECTDIR)/\" .. f .. \".pb.h\"\r\n    \t\t\toutputs[#outputs + 1] = \"$(OBJECTDIR)/\" .. f .. \".pb.cc\"\r\n    \t\tend\r\n        return {\r\n          InputFiles  = data.Source,\r\n          OutputFiles = outputs,\r\n        }\r\n      end,\r\n    }\r\n\r\nThe above appears to work just fine but this is where it gets weird.\r\n\r\nI invoke tundra like this `tundra2 -v win64-msvc-debug protofiles` which will tell it to build this unit:\r\n\r\n    local protobuf_path = \"lib/protobuf-2.4.1/src\"\r\n    StaticLibrary {\r\n    \tName = \"protofiles\",\r\n    \tPass = \"CodeGeneration\",\r\n    \tEnv = {\r\n    \t\tCPPPATH = {\r\n    \t\t\tprotobuf_path,\r\n    \t\t\t\"$(OBJECTDIR)\",\r\n    \t\t},\r\n    \t},\r\n    \tPropagate = {\r\n    \t\tEnv = {\r\n    \t\t\tCPPPATH = {\r\n    \t\t\t\tprotobuf_path,\r\n    \t\t\t\t\"$(OBJECTDIR)\",\r\n    \t\t\t},\r\n    \t\t},\r\n    \t},\r\n    \tSources = {\r\n    \t\tProtobuf { \r\n    \t\t\tInclude = \"src/win32/protofiles\",\r\n    \t\t\tSource = Glob { \r\n    \t\t\t\tDir = \"src/win32/protofiles\", \r\n    \t\t\t\tExtensions = { \".proto\" } \r\n    \t\t\t} \r\n    \t\t}\r\n    \t},\r\n    }\r\n\r\nAnd here is what happens...\r\n\r\n    Protobuf src\\win32\\protofiles\\FileVersionInfo.proto src\\win32\\protofiles\\Usage.proto\r\n    t2-output\\win64-msvc-release-default\\protoc.exe --error_format=msvs --cpp_out=t2-output\\win64-msvc-release-default -ID:\\project\\src\\win32\\protofiles D:\\project\\src\\win32\\protofiles\\FileVersionInfo.proto D:\\project\\src\\win32\\protofiles\\Usage.proto\r\n    C++ t2-output\\win64-msvc-release-default\\FileVersionInfo.pb.cc\r\n    \"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\vc\\bin\\amd64\\cl.exe\" /c @RESPONSE|@|/D_WIN32 /DUNICODE /D_UNICODE /D_USING_V110_SDK71_ /D_WIN32_WINNT=0x501  /I\"lib\\\\protobuf-2.4.1\\\\src\" /I\"t2-output\\\\win64-msvc-debug-default\" /nologo /FS /FC /EHa /MDd /Od   /Zi /Fdt2-output\\win64-msvc-debug-default\\protofiles_ccpdb.pdb /FoD:\\project\\t2-output\\win64-msvc-debug-default\\__protofiles\\t2-output\\win64-msvc-release-default\\FileVersionInfo.pb__cc.obj D:\\project\\t2-output\\win64-msvc-release-default\\FileVersionInfo.pb.cc\r\n    C++ t2-output\\win64-msvc-release-default\\Usage.pb.cc\r\n    \"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\vc\\bin\\amd64\\cl.exe\" /c @RESPONSE|@|/D_WIN32 /DUNICODE /D_UNICODE /D_USING_V110_SDK71_ /D_WIN32_WINNT=0x501  /I\"lib\\\\protobuf-2.4.1\\\\src\" /I\"t2-output\\\\win64-msvc-debug-default\" /nologo /FS /FC /EHa /MDd /Od   /Zi /Fdt2-output\\win64-msvc-debug-default\\protofiles_ccpdb.pdb /FoD:\\project\\t2-output\\win64-msvc-debug-default\\__protofiles\\t2-output\\win64-msvc-release-default\\Usage.pb__cc.obj D:\\project\\t2-output\\win64-msvc-release-default\\Usage.pb.cc\r\n    FileVersionInfo.pb.cc\r\n    Usage.pb.cc\r\n    StaticLibrary t2-output\\win64-msvc-debug-default\\protofiles.lib\r\n    \"C:\\Program Files (x86)\\Microsoft Visual Studio 12.0\\vc\\bin\\amd64\\lib.exe\" /nologo @RESPONSE|@|/MACHINE:X64 /out:\"D:\\\\Project\\\\t2-output\\\\win64-msvc-debug-default\\\\protofiles.lib\"\r\n\r\nIt's a wall of text, take a closer look at where the files end up. The output sources from protoc are put in the `t2-output\\win64-msvc-release-default` dir but the object and library files correctly end up in `t2-output\\win64-msvc-debug-default` (but no source files) since everything is specified using `$(OBJECTDIR)` in my `DefRule` how can it mix it like that? What's going on here? Why is the `t2-output\\win64-msvc-release-default` dir being built at all when I tell tundra to build just `win64-msvc-debug`? Does it have anything to do with the way passes work or the `Always` function?\r\n\r\nI think the header files is going to be a problem. They'll end up in the wrong folder.\r\n\r\n"}}