Closed Bug 1407359 Opened 7 years ago Closed 7 years ago

Add a small framework to apply patches to MinGW

Categories

(Firefox Build System :: General, enhancement)

enhancement
Not set
normal

Tracking

(firefox58 fixed)

RESOLVED FIXED
mozilla58
Tracking Status
firefox58 --- fixed

People

(Reporter: tjr, Assigned: tjr)

References

(Blocks 1 open bug)

Details

Attachments

(1 file)

Bug 1372958 and Bug 1407289 show that we will definitely need to apply local patches to MinGW before they are upstreamed to keep the build working.  This bug is to set up how to do that and get it approved, so landing the first or subsequent patches can easily take advantage of that mechanism.
Comment on attachment 8917091 [details]
Bug 1407359 Set up a framework for patching the MinGW toolchain

https://reviewboard.mozilla.org/r/188102/#review193346

::: build/unix/build-gcc/mingw-sample-patch.patch:1
(Diff revision 3)
> +diff --git a/AUTHORS b/AUTHORS

I'll remove this file and the application of it in the final push, but I wanted to test that the patch process worked.
Attachment #8917091 - Flags: review?(mh+mozilla)
Comment on attachment 8917091 [details]
Bug 1407359 Set up a framework for patching the MinGW toolchain

https://reviewboard.mozilla.org/r/188102/#review193456

::: build/unix/build-gcc/build-gcc.sh:82
(Diff revision 3)
> +apply_gcc_patch() {
>    pushd $root_dir/gcc-$gcc_version
>    patch -p1 < $1
>    popd
>  }
>  
> +apply_mingw_patch() {
> +  pushd $root_dir/mingw-w64
> +  patch -p1 < $1
> +  popd
> +}

might as well make that more generic, like:

apply_patch() {
  pushd $root_dir/$1
  patch -p1 < $2
  popd
}

::: taskcluster/scripts/misc/build-gcc-mingw32.sh:10
(Diff revision 3)
> -# Do not define root_dir so we build everything to a tmpdir
> +root_dir=$HOME_DIR
> -#root_dir=$HOME_DIR

That seems unrelated.
Attachment #8917091 - Flags: review?(mh+mozilla)
Or, not requiring changes to scripts other than the mingw one:
apply_patch() {
  if [ $# -ge 2 ]; then
    pushd $root_dir/$1
    shift
  else
    pushd $root_dir/gcc-$gcc_version
  fi
  patch -p1 < $1
  popd
}
Comment on attachment 8917091 [details]
Bug 1407359 Set up a framework for patching the MinGW toolchain

https://reviewboard.mozilla.org/r/188102/#review193734

::: taskcluster/scripts/misc/build-gcc-mingw32.sh:10
(Diff revision 3)
> -# Do not define root_dir so we build everything to a tmpdir
> +root_dir=$HOME_DIR
> -#root_dir=$HOME_DIR

You're right, I thought it was needed, but it is not.
Comment on attachment 8917091 [details]
Bug 1407359 Set up a framework for patching the MinGW toolchain

https://reviewboard.mozilla.org/r/188102/#review193804

Don't forget to remove the patch before landing. Note this will force almost all toolchains to be rebuilt, delaying firefox builds for something like 90 minutes when this lands.
Attachment #8917091 - Flags: review?(mh+mozilla) → review+
Pushed by philringnalda@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/2bba20317885
Set up a framework for patching the MinGW toolchain r=glandium
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/2bba20317885
Status: NEW → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla58
Product: Core → Firefox Build System
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: