Bug 132619 - Add Makefile targets for copying static libraries (LLVM and WKSI)
Summary: Add Makefile targets for copying static libraries (LLVM and WKSI)
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Tools / Tests (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: David Kilzer (:ddkilzer)
URL:
Keywords:
: 129499 (view as bug list)
Depends on:
Blocks:
 
Reported: 2014-05-06 11:58 PDT by David Kilzer (:ddkilzer)
Modified: 2015-09-08 09:30 PDT (History)
10 users (show)

See Also:


Attachments
Patch v1 (3.98 KB, patch)
2014-05-06 13:13 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff
Patch v2 (3.66 KB, patch)
2014-05-06 13:19 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff
Patch v3 (3.57 KB, patch)
2014-05-06 17:22 PDT, David Kilzer (:ddkilzer)
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description David Kilzer (:ddkilzer) 2014-05-06 11:58:45 PDT
For developers that use "make" to build WebKit, it would be useful to have targets to copy the static libraries so that one could run:

make libs debug

Or even more abbreviated:

make l d
Comment 1 Mark Rowe (bdash) 2014-05-06 12:41:26 PDT
Why not just include WebKitLibraries in the top level Makefile's list of projects, and give it a Makefile that does the right thing? Then the obvious "make debug" will Just Work.
Comment 2 David Kilzer (:ddkilzer) 2014-05-06 13:13:16 PDT
Created attachment 230926 [details]
Patch v1
Comment 3 David Kilzer (:ddkilzer) 2014-05-06 13:14:49 PDT
(In reply to comment #1)
> Why not just include WebKitLibraries in the top level Makefile's list of projects, and give it a Makefile that does the right thing? Then the obvious "make debug" will Just Work.

I had assumed for internal developers who build WKSI that this wouldn't be desirable, but I now realize the default action for copy-webkitlibraries-to-product-directory is not to overwrite newer copies of WKSI (and LLVM) static libraries, so this would be fine.

New patch forthcoming.
Comment 4 David Kilzer (:ddkilzer) 2014-05-06 13:19:20 PDT
Created attachment 230927 [details]
Patch v2
Comment 5 Mark Rowe (bdash) 2014-05-06 13:22:21 PDT
Comment on attachment 230927 [details]
Patch v2

View in context: https://bugs.webkit.org/attachment.cgi?id=230927&action=review

> WebKitLibraries/Makefile:10
> +libs l:
> +	perl $(SCRIPTS_PATH)/copy-webkitlibraries-to-product-directory --wksi --llvm
> +
> +llvm:
> +	perl $(SCRIPTS_PATH)/copy-webkitlibraries-to-product-directory --llvm
> +
> +wksi:
> +	perl $(SCRIPTS_PATH)/copy-webkitlibraries-to-product-directory --wksi

The llvm, wksi and l targets seem unnecessary.

How does copy-webkitlibraries-to-product-directory know which configuration's build directory to copy to?
Comment 6 David Kilzer (:ddkilzer) 2014-05-06 13:46:21 PDT
(In reply to comment #5)
> (From update of attachment 230927 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=230927&action=review
> 
> > WebKitLibraries/Makefile:10
> > +libs l:
> > +	perl $(SCRIPTS_PATH)/copy-webkitlibraries-to-product-directory --wksi --llvm
> > +
> > +llvm:
> > +	perl $(SCRIPTS_PATH)/copy-webkitlibraries-to-product-directory --llvm
> > +
> > +wksi:
> > +	perl $(SCRIPTS_PATH)/copy-webkitlibraries-to-product-directory --wksi
> 
> The llvm, wksi and l targets seem unnecessary.

The are convenience targets in case someone wants to "build" only one or the other (instead of typing out the whole command).

> How does copy-webkitlibraries-to-product-directory know which configuration's build directory to copy to?

It ends up calling productDir() in webkitdirs.pm, which uses the current set-webkit-configuration (which is set by Makefile.shared, which WebKitLibraries/Makefile includes) because we don't pass a product directory on the command line, and we don't set BUILT_PRODUCTS_DIR in the environment when the script is run.

In other words, the fallback for the product directory in copy-webkitlibraries-to-product-directory is the following:

1. command-line argument, else
2. $ENV{BUILT_PRODUCTS_DIR}, else
3. productDir() in webkitdirs.pm.
Comment 7 David Kilzer (:ddkilzer) 2014-05-06 13:47:11 PDT
(In reply to comment #6)
> (In reply to comment #5)
> > The llvm, wksi and l targets seem unnecessary.
> 
> The are convenience targets in case someone wants to "build" only one or the other (instead of typing out the whole command).

I'm okay removing these as well.
Comment 8 Mark Rowe (bdash) 2014-05-06 13:58:37 PDT
(In reply to comment #6)
> (In reply to comment #5)
> > (From update of attachment 230927 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=230927&action=review
> > 
> > > WebKitLibraries/Makefile:10
> > > +libs l:
> > > +	perl $(SCRIPTS_PATH)/copy-webkitlibraries-to-product-directory --wksi --llvm
> > > +
> > > +llvm:
> > > +	perl $(SCRIPTS_PATH)/copy-webkitlibraries-to-product-directory --llvm
> > > +
> > > +wksi:
> > > +	perl $(SCRIPTS_PATH)/copy-webkitlibraries-to-product-directory --wksi
> > 
> > The llvm, wksi and l targets seem unnecessary.
> 
> The are convenience targets in case someone wants to "build" only one or the other (instead of typing out the whole command).
> 
> > How does copy-webkitlibraries-to-product-directory know which configuration's build directory to copy to?
> 
> It ends up calling productDir() in webkitdirs.pm, which uses the current set-webkit-configuration (which is set by Makefile.shared, which WebKitLibraries/Makefile includes) because we don't pass a product directory on the command line, and we don't set BUILT_PRODUCTS_DIR in the environment when the script is run.
> 
> In other words, the fallback for the product directory in copy-webkitlibraries-to-product-directory is the following:
> 
> 1. command-line argument, else
> 2. $ENV{BUILT_PRODUCTS_DIR}, else
> 3. productDir() in webkitdirs.pm.

Consider the following sequence of events:
1) set-webkit-configuration --release
2) make -C WebKitLibraries debug

Based on your WebKitLibraries/Makefile, I expect this will copy the libraries in to the Release configuration's build directory rather than Debug's like the command implies. I think you'll also see warnings like so:

Makefile:4: warning: overriding commands for target `debug'
../Makefile.shared:32: warning: ignoring old commands for target `debug'
Comment 9 David Kilzer (:ddkilzer) 2014-05-06 17:22:58 PDT
Created attachment 230956 [details]
Patch v3
Comment 10 WebKit Commit Bot 2014-05-06 22:18:36 PDT
Comment on attachment 230956 [details]
Patch v3

Clearing flags on attachment: 230956

Committed r168410: <http://trac.webkit.org/changeset/168410>
Comment 11 WebKit Commit Bot 2014-05-06 22:18:40 PDT
All reviewed patches have been landed.  Closing bug.
Comment 12 BJ Burg 2015-09-08 09:30:05 PDT
*** Bug 129499 has been marked as a duplicate of this bug. ***