Add a generic header and footer to generated Makefiles

RESOLVED FIXED in mozilla26

Status

defect
RESOLVED FIXED
6 years ago
a year ago

People

(Reporter: glandium, Assigned: glandium)

Tracking

Trunk
mozilla26
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 7 obsolete attachments)

(Assignee)

Description

6 years ago
For bug 912292, I needed to reliably add something to all makefiles, either at the beginning or the end. Since I was doing this, I figured I might as well just add the usual boilerplate, and remove it from Makefile.in.
(Assignee)

Updated

6 years ago
Blocks: 912292
(Assignee)

Comment 2

6 years ago
I want to remove the blank lines this removes before putting this up for review.
(Assignee)

Comment 3

6 years ago
This also takes into account the makefiles we have in CONFIGURE_SUBST_FILES. (without this, make package fails, for instance)
Attachment #799198 - Flags: review?(gps)
(Assignee)

Updated

6 years ago
Attachment #799180 - Attachment is obsolete: true
Attachment #799180 - Flags: review?(gps)
Comment on attachment 799198 [details] [diff] [review]
Add a generic header and footer to generated Makefiles

Review of attachment 799198 [details] [diff] [review]:
-----------------------------------------------------------------

\o/ would review again.

::: js/src/configure.in
@@ -4327,5 @@
>  
>  dnl Spit out some output
>  dnl ========================================================
>  
> -AC_OUTPUT([js-confdefs.h Makefile config/autoconf.mk config/emptyvars.mk])

I'm surprised this lasted as long as it did!

::: python/mozbuild/mozbuild/backend/configenvironment.py
@@ +227,5 @@
> +        pp.handleLine('include $(DEPTH)/config/autoconf.mk\n')
> +        if not stub:
> +            pp.do_include(self.get_input(path))
> +        pp.handleLine('\n') # Empty line to avoid failures when last line
> +        # in Makefile.in ends with a backslash.

Nit: Move comment to own line(s)

::: python/mozbuild/mozbuild/backend/recursivemake.py
@@ +175,5 @@
>  
>          if isinstance(obj, DirectoryTraversal):
>              self._process_directory_traversal(obj, backend_file)
>          elif isinstance(obj, ConfigFileSubstitution):
> +            if obj.output_path.endswith('/Makefile'):

Is relying on / safe here? Should we throw in a .replace('/', os.sep) just to be sure? Maybe we should do that in emitter.py if we're not already?

@@ +179,5 @@
> +            if obj.output_path.endswith('/Makefile'):
> +                f = backend_file.environment.create_makefile(obj.output_path)
> +            else:
> +                f = backend_file.environment.create_config_file(obj.output_path)
> +            self._update_from_avoid_write(f)

This originally confused me because I thought f was a file and not a FileAvoidWrite result. Change variable to "result" or "r"?
Attachment #799198 - Flags: review?(gps) → review+
(Assignee)

Comment 5

6 years ago
Attachment #799223 - Flags: review?(gps)
(Assignee)

Updated

6 years ago
Attachment #799182 - Attachment is obsolete: true
(Assignee)

Updated

6 years ago
Attachment #799223 - Flags: review?(gps)
(Assignee)

Comment 6

6 years ago
Attachment #799231 - Flags: review?(gps)
(Assignee)

Updated

6 years ago
Attachment #799223 - Attachment is obsolete: true
(Assignee)

Comment 7

6 years ago
Removed a spurious DEPTH in js/xpconnect/loader/Makefile.in
Attachment #799233 - Flags: review?(gps)
(Assignee)

Updated

6 years ago
Attachment #799231 - Attachment is obsolete: true
Attachment #799231 - Flags: review?(gps)
(Assignee)

Comment 8

6 years ago
Comment on attachment 799233 [details] [diff] [review]
Remove now redundant boilerplate from Makefile.in

sigh. it's now broken for some reason :(
Attachment #799233 - Flags: review?(gps)
(Assignee)

Comment 9

6 years ago
I /think/ this is the one. Giving it a try spin.
(Assignee)

Updated

6 years ago
Attachment #799233 - Attachment is obsolete: true
(Assignee)

Updated

6 years ago
Depends on: 912368
(Assignee)

Comment 10

6 years ago
A couple changes to make config.status --file do kind of the right thing.
Attachment #799326 - Flags: review?(gps)
(Assignee)

Updated

6 years ago
Attachment #799198 - Attachment is obsolete: true
(Assignee)

Comment 11

6 years ago
Hopefully this one is good, although it's not against current m-i and will need some merge conflict resolution.
(Assignee)

Updated

6 years ago
Attachment #799246 - Attachment is obsolete: true
(In reply to Mike Hommey [:glandium] from comment #11)
> Created attachment 799327 [details] [diff] [review]
> Remove now redundant boilerplate from Makefile.in
> 
> Hopefully this one is good, although it's not against current m-i and will
> need some merge conflict resolution.

Makefiles under dom/imptests/*/ are automatically generated - http://mxr.mozilla.org/mozilla-central/source/dom/imptests/writeBuildFiles.py will need to be updated.
(Assignee)

Comment 13

6 years ago
(In reply to Ed Morley [:edmorley UTC+1] from comment #12)
> Makefiles under dom/imptests/*/ are automatically generated -
> http://mxr.mozilla.org/mozilla-central/source/dom/imptests/writeBuildFiles.
> py will need to be updated.

https://bugzilla.mozilla.org/page.cgi?id=splinter.html&bug=912293&attachment=799327 ;)
Ah dammit, case sensitive sort order in https://bugzilla.mozilla.org/attachment.cgi?id=799327&action=diff after using "collapse all"; saw dom/imptests/Makefile.in and didn't look below the directories under that. Sorry! :-)
(Assignee)

Comment 15

6 years ago
Comment on attachment 799327 [details] [diff] [review]
Remove now redundant boilerplate from Makefile.in

This is the one.
Attachment #799327 - Flags: review?(gps)
Thanks for the consideration, both :)
Attachment #799326 - Flags: review?(gps) → review+
Comment on attachment 799327 [details] [diff] [review]
Remove now redundant boilerplate from Makefile.in

Review of attachment 799327 [details] [diff] [review]:
-----------------------------------------------------------------

I only glanced at large parts of this patch because OMG IT MAKES MY EYES BLEED.

But, I did have a look at a few paths that interest me, notably dom/imptests and config/makefiles.
Attachment #799327 - Flags: review?(gps) → review+
https://hg.mozilla.org/mozilla-central/rev/92ee006ec0a5
https://hg.mozilla.org/mozilla-central/rev/45097bc3a578
Status: NEW → RESOLVED
Last Resolved: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla26
(Assignee)

Updated

6 years ago
Blocks: 920223

Updated

4 years ago
Blocks: 773349

Updated

a year ago
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.