Figure out how to put dom/plugins/test/testplugin/ in moz.build

RESOLVED FIXED in Firefox 48

Status

()

Core
Build Config
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: ted, Assigned: mshal)

Tracking

(Blocks: 1 bug)

unspecified
mozilla48
Points:
---

Firefox Tracking Flags

(firefox48 fixed)

Details

MozReview Requests

()

Submitter Diff Changes Open Issues Last Updated
Loading...
Error loading review requests:

Attachments

(1 attachment)

(Reporter)

Description

2 years ago
We've got a set of Makefiles that build various test plugins, all cargo-culted from the original:
https://hg.mozilla.org/mozilla-central/file/af7c0cb0798f5425d5d344cbaf0ac0ecb1a72a86/dom/plugins/test/testplugin/Makefile.in
https://hg.mozilla.org/mozilla-central/file/af7c0cb0798f5425d5d344cbaf0ac0ecb1a72a86/dom/plugins/test/testplugin/flashplugin/Makefile.in
https://hg.mozilla.org/mozilla-central/file/af7c0cb0798f5425d5d344cbaf0ac0ecb1a72a86/dom/plugins/test/testplugin/javaplugin/Makefile.in
https://hg.mozilla.org/mozilla-central/file/af7c0cb0798f5425d5d344cbaf0ac0ecb1a72a86/dom/plugins/test/testplugin/silverlightplugin/Makefile.in
https://hg.mozilla.org/mozilla-central/file/af7c0cb0798f5425d5d344cbaf0ac0ecb1a72a86/dom/plugins/test/testplugin/thirdplugin/Makefile.in
https://hg.mozilla.org/mozilla-central/file/af7c0cb0798f5425d5d344cbaf0ac0ecb1a72a86/dom/plugins/test/testplugin/secondplugin/Makefile.in

They all include this common Makefile:
https://hg.mozilla.org/mozilla-central/file/af7c0cb0798f5425d5d344cbaf0ac0ecb1a72a86/dom/plugins/test/testplugin/testplugin.mk

On everything but OS X, it simply copies the shared library to $DIST/plugins, which could be accomplished by setting FINAL_TARGET. On OS X it copies the shared library to $(DIST)/plugins/$(COCOA_NAME).plugin/Contents/MacOS (where $COCOA_NAME is set per-Makefile), but also copies an Info.plist file to $(DIST)/plugins/$(COCOA_NAME).plugin/Contents/.

I guess if we had a fix for bug 1223748 we could use that and this would be straightforward.

There's already also a common.mozbuild that we could shoehorn this into:
https://hg.mozilla.org/mozilla-central/file/af7c0cb0798f5425d5d344cbaf0ac0ecb1a72a86/dom/plugins/test/testplugin/testplugin.mk
(Assignee)

Comment 1

2 years ago
It's not too terrible to use OBJDIR_FILES for the Info.plist file, so I think we can kill this now.
Assignee: nobody → mshal
(Assignee)

Comment 2

2 years ago
Created attachment 8737352 [details]
MozReview Request: Bug 1255359 - Remove testplugin.mk; r?ted

Review commit: https://reviewboard.mozilla.org/r/43917/diff/#index_header
See other reviews: https://reviewboard.mozilla.org/r/43917/
Attachment #8737352 - Flags: review?(ted)
(Reporter)

Comment 3

2 years ago
Comment on attachment 8737352 [details]
MozReview Request: Bug 1255359 - Remove testplugin.mk; r?ted

https://reviewboard.mozilla.org/r/43917/#review43721

::: dom/plugins/test/testplugin/testplugin.mozbuild:78
(Diff revision 1)
>      # conversion from 'X' to 'Y' requires a narrowing conversion
>      CXXFLAGS += ['-wd4838']
> +
> +if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'cocoa':
> +    FINAL_TARGET = 'dist/plugins/%s.plugin/Contents/MacOS' % cocoa_name
> +    OBJDIR_FILES.dist.plugins['%s.plugin' % cocoa_name].Contents += ['Info.plist']

I sure don't love this, but it's better than the Makefile.
Attachment #8737352 - Flags: review?(ted) → review+

Comment 4

2 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/04d5b31350e4

Comment 5

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/04d5b31350e4
Status: NEW → RESOLVED
Last Resolved: 2 years ago
status-firefox48: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
Backed out in https://hg.mozilla.org/mozilla-central/rev/cb65ec85049efa44b18e2e8d06af26768c3bfb94. I think what happened was that we merged around something which was busted without a clobber, so we clobbered m-i and f-t, and once we got Mac clobber builds, they hadn't packaged test plugins, so they did things like https://treeherder.mozilla.org/logviewer.html#?job_id=26068019&repo=mozilla-inbound and https://treeherder.mozilla.org/logviewer.html#?job_id=26068023&repo=mozilla-inbound and https://treeherder.mozilla.org/logviewer.html#?job_id=26073561&repo=mozilla-inbound and cetera.
Status: RESOLVED → REOPENED
status-firefox48: fixed → ---
Resolution: FIXED → ---
Target Milestone: mozilla48 → ---
(Assignee)

Comment 7

2 years ago
The problem was with this line:

OBJDIR_FILES.dist.plugins['%s.plugin' % cocoa_name].Contents += ['Info.plist']

It ends up copying the Info.plist file from dom/plugins/test/testplugin into each of the subdirectories, rather than secondplugin/Info.plist, thirdplugin/Info.plist, etc. So we just end up with several copies of the same file, which is obviously wrong.

We already have 'relative_path' for this, so the line should be:

OBJDIR_FILES.dist.plugins['%s.plugin' % cocoa_name].Contents += ['%s/Info.plist' % relative_path]

try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=240f2515dd8a

Comment 8

2 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/969d250bffc4

Comment 9

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/969d250bffc4
Status: REOPENED → RESOLVED
Last Resolved: 2 years ago2 years ago
status-firefox48: --- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla48
You need to log in before you can comment on or make changes to this bug.