|
|
Created:
9 years, 4 months ago by scottmg Modified:
9 years, 4 months ago CC:
chromium-reviews Visibility:
Public. |
DescriptionLink chrome.exe to its IntDir and then hardlink to OutDir as a
postbuild on msvs. This avoids a clash between the .ilk files
for chrome.exe and chrome.dll which disables incremental linking
for chrome_dll.
BUG=92528
TEST=No new functionality, no link/run problems
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=97074
Patch Set 1 #Patch Set 2 : only use IntDir on 2008 to avoid breaking 2010 #Messages
Total messages: 15 (0 generated)
OK, I just took Roger's patch from http://codereview.chromium.org/7634025/ and made it VS 2008-only for now to avoid any problems with 2010. Once I get 2010 installed I can revisit whether this is necessary there, and the best way to accomplish this.
I prefer to not use msvs_postbuild. Why not an action with the output defined instead?
Actions run before the build step. On 16 August 2011 12:55, <maruel@chromium.org> wrote: > I prefer to not use msvs_postbuild. Why not an action with the output > defined > instead? > > > http://codereview.chromium.**org/7633024/<http://codereview.chromium.org/7633... >
On 2011/08/16 17:09:55, Roger McFarlane (Google) wrote: > Actions run before the build step. You can do a process_outputs_as_sources = 1 and use a rule.
On Tue, Aug 16, 2011 at 10:12 AM, <maruel@chromium.org> wrote: > On 2011/08/16 17:09:55, Roger McFarlane (Google) wrote: >> >> Actions run before the build step. > > You can do a process_outputs_as_sources = 1 and use a rule. OK, I'll try working one up that way.
On Tue, Aug 16, 2011 at 10:14 AM, Scott Graham <scottmg@chromium.org> wrote: > On Tue, Aug 16, 2011 at 10:12 AM, <maruel@chromium.org> wrote: >> On 2011/08/16 17:09:55, Roger McFarlane (Google) wrote: >>> >>> Actions run before the build step. >> >> You can do a process_outputs_as_sources = 1 and use a rule. > > OK, I'll try working one up that way. > Sorry if I'm being dense here, I'm having some trouble getting this to work. This adds $(IntDir)\chrome.exe to the chrome project with a custom tool on it, but it still runs before the linker. Am I doing something obviously wrong here, or do I need to introduce a new target/vcproj that depends on chrome to get this to work? ['OS=="win" and MSVS_VERSION=="2008"', { 'msvs_settings': { 'VCLinkerTool': { 'OutputFile': '$(IntDir)\\chrome.exe', }, }, 'sources': [ '$(IntDir)\\chrome.exe', ], 'process_outputs_as_sources': 1, 'rules': [ { 'rule_name': 'do_hardlink_to_outdir', 'extension': 'exe', 'inputs': [ '$(IntDir)\\chrome.exe', ], 'outputs': [ '$(OutDir)\\chrome.exe', ], 'action': [ 'tools\\build\\win\\hardlink_failsafe.bat', '$(IntDir)\\chrome.exe', '$(OutDir)\\chrome.exe' ], 'msvs_cygwin_shell': 0, }], }],
Sorry I just thought about it and process_outputs_as_sources is indeed processed before linking. In theory you'd need to create another target. :/ Ok then, sorry for the waste of time and use msvs_postbuild instead. M-A Le 16 août 2011 16:36, Scott Graham <scottmg@chromium.org> a écrit : > On Tue, Aug 16, 2011 at 10:14 AM, Scott Graham <scottmg@chromium.org> > wrote: > > On Tue, Aug 16, 2011 at 10:12 AM, <maruel@chromium.org> wrote: > >> On 2011/08/16 17:09:55, Roger McFarlane (Google) wrote: > >>> > >>> Actions run before the build step. > >> > >> You can do a process_outputs_as_sources = 1 and use a rule. > > > > OK, I'll try working one up that way. > > > > Sorry if I'm being dense here, I'm having some trouble getting this to > work. This adds $(IntDir)\chrome.exe to the chrome project with a > custom tool on it, but it still runs before the linker. > > Am I doing something obviously wrong here, or do I need to introduce a > new target/vcproj that depends on chrome to get this to work? > > > ['OS=="win" and MSVS_VERSION=="2008"', { > 'msvs_settings': { > 'VCLinkerTool': { > 'OutputFile': '$(IntDir)\\chrome.exe', > }, > }, > 'sources': [ > '$(IntDir)\\chrome.exe', > ], > 'process_outputs_as_sources': 1, > 'rules': [ > { > 'rule_name': 'do_hardlink_to_outdir', > 'extension': 'exe', > 'inputs': [ > '$(IntDir)\\chrome.exe', > ], > 'outputs': [ > '$(OutDir)\\chrome.exe', > ], > 'action': [ > 'tools\\build\\win\\hardlink_failsafe.bat', > '$(IntDir)\\chrome.exe', '$(OutDir)\\chrome.exe' > ], > 'msvs_cygwin_shell': 0, > }], > }], >
On Tue, Aug 16, 2011 at 1:41 PM, Marc-Antoine Ruel <maruel@chromium.org> wrote: > Sorry I just thought about it and process_outputs_as_sources is indeed > processed before linking. In theory you'd need to create another target. :/ > Ok then, sorry for the waste of time and use msvs_postbuild instead. OK, no problem. I could introduce another target, call new one "chrome", and rename the current "chrome" to "chrome_exe" or something. Does that seem more confusing?
On Tue, Aug 16, 2011 at 1:43 PM, Scott Graham <scottmg@chromium.org> wrote: > On Tue, Aug 16, 2011 at 1:41 PM, Marc-Antoine Ruel <maruel@chromium.org> wrote: >> Sorry I just thought about it and process_outputs_as_sources is indeed >> processed before linking. In theory you'd need to create another target. :/ >> Ok then, sorry for the waste of time and use msvs_postbuild instead. > > OK, no problem. I could introduce another target, call new one > "chrome", and rename the current "chrome" to "chrome_exe" or > something. > > Does that seem more confusing? Oh, I guess that's a bit tricky too because it'll have to use SHARED_INTERMEDIATE_DIR for chrome.exe (unless there's some other way to get access to $(IntDir) for the dependent?
On Tue, Aug 16, 2011 at 1:47 PM, Scott Graham <scottmg@chromium.org> wrote: > On Tue, Aug 16, 2011 at 1:43 PM, Scott Graham <scottmg@chromium.org> wrote: >> On Tue, Aug 16, 2011 at 1:41 PM, Marc-Antoine Ruel <maruel@chromium.org> wrote: >>> Sorry I just thought about it and process_outputs_as_sources is indeed >>> processed before linking. In theory you'd need to create another target. :/ >>> Ok then, sorry for the waste of time and use msvs_postbuild instead. >> >> OK, no problem. I could introduce another target, call new one >> "chrome", and rename the current "chrome" to "chrome_exe" or >> something. >> >> Does that seem more confusing? > > Oh, I guess that's a bit tricky too because it'll have to use > SHARED_INTERMEDIATE_DIR for chrome.exe (unless there's some other way > to get access to $(IntDir) for the dependent? Hrm, and I'd need to make the target renaming happen only windows + vs2008, which seems a complex in gyp. So, if you don't object, I think *will* go back to postbuild, if you can l.g.t.m. this one as is.
On 2011/08/16 20:55:01, scottmg wrote: > So, if you don't object, I think *will* go back to postbuild, if you > can l.g.t.m. this one as is. yep
No LGTM from valid reviewers yet.
lgtm
Change committed as 97074
Hmm, this is bad for running in the debugger. Sigh, didn't think this would be so difficult. Without changing the Debugging > Command to $(OutDir)\chrome.exe, from the default of $(TargetPath) chrome will just exit immediately after launch because by default it can't find chrome.dll, because of course it's running from the copy it built in $(IntDir). I'm back to thinking it would be better to rename either the exe or the dll now rather than doing this tricky stuff. On Tue, Aug 16, 2011 at 6:01 PM, <commit-bot@chromium.org> wrote: > Change committed as 97074 > > http://codereview.chromium.org/7633024/ > |