This commit adds support for building and bundling fxc2.
Since the Makefile upstream is pretty simple and has no install targets for example, I manually do that in the fxc2/build file. Ideally, there are a few changes we could make upstream:
add a proper version
improve the Makefile
create and sign a release
But I am not sure if that is required and I am assuming that the current changes on our end are enough. If you feel that we should submit a patch upstream instead, let me know.
The patch looks good to me, although I did not try to build the firefox part.
However I think we are missing the part where we copy the d3dcompiler_47.dll file to the bundle (I think in $distdir/Browser).
I added it by setting fxcdir and copying the dll. Is that fine or can we do better?
And a minor thing: you can indent the make lines in the IF to make that easier to read. Or maybe it can be simplified like this:
{{{
diff --git a/projects/fxc2/build b/projects/fxc2/build
index 6ff3808..1b48326 100644
--- a/projects/fxc2/build
+++ b/projects/fxc2/build
@@ -8,11 +8,7 @@ mkdir -p /var/tmp/build
tar -C /var/tmp/build -xf [% project %]-[% c("version") %].tar.gz
cd /var/tmp/build/[% project %]-[% c("version") %]
-[% IF c("arch") == "i686" -%]
-make x86
-[% ELSE -%]
-make x64
-[% END -%]
+make [% IF c("var/windows-i686") %]x86[% ELSE %]x64[% END %]
The Firefox build detects fxc2 but fails due to the other toolchain errors:
0:03.71 checking for fxc... /var/tmp/dist/fxc2/bin/fxc2.exe 0:03.71 checking for wine... /usr/bin/wine 0:03.94 checking for cpuid.h... yes [snip] 0:04.92 checking for rustc... not found 0:04.92 checking for cargo... not found 0:04.92 ERROR: Rust compiler not found. 0:04.92 To compile rust language sources, you must have 'rustc' in your path. 0:04.92 See https://www.rust-lang.org/ for more information. 0:04.92 0:04.92 You can install rust by running './mach bootstrap' 0:04.92 or by directly running the installer from https://rustup.rs/ 0:04.92 0:04.95 *** Fix above errors and then restart with\ 0:04.95 "/usr/bin/make -f client.mk build" 0:04.95 client.mk:145: recipe for target 'configure' failed 0:04.95 make: *** [configure] Error 1
The patch looks good to me, although I did not try to build the firefox part.
However I think we are missing the part where we copy the d3dcompiler_47.dll file to the bundle (I think in $distdir/Browser).
I added it by setting fxcdir and copying the dll. Is that fine or can we do better?
This looks good. If you set fxcdir before setting PATH, you can use it while seting PATH.
An other thing I noticed while looking at the patch again: in projects/fxc2/build you can replace /var/tmp/dist/fxc2/bin/ in the 3 lines it is used by "$distdir/bin/".
I added it by setting fxcdir and copying the dll. Is that fine or can we do better?
The patch here: https://bugzilla.mozilla.org/show_bug.cgi?id=1460620 will get it into dist/bin in a portable way. I haven't landed it because I haven't been able to investigate the test failures indicating that sometimes we don't find the dll and sometimes we do.
The patch looks good to me, although I did not try to build the firefox part.
However I think we are missing the part where we copy the d3dcompiler_47.dll file to the bundle (I think in $distdir/Browser).
I added it by setting fxcdir and copying the dll. Is that fine or can we do better?
This looks good. If you set fxcdir before setting PATH, you can use it while seting PATH.
An other thing I noticed while looking at the patch again: in projects/fxc2/build you can replace /var/tmp/dist/fxc2/bin/ in the 3 lines it is used by "$distdir/bin/".
I added it by setting fxcdir and copying the dll. Is that fine or can we do better?
The patch here: https://bugzilla.mozilla.org/show_bug.cgi?id=1460620 will get it into dist/bin in a portable way. I haven't landed it because I haven't been able to investigate the test failures indicating that sometimes we don't find the dll and sometimes we do.
So, we want to use a 32bit .dll for our 64bit Windows builds, too? It seems to me Mozilla is using a 64-bit one for 64-bit Windows and a 32-bit one for 32-bit Windows:
# The DirectX SDK libraries are split into x86 and x64 sub-directoriescase "${target_cpu}" ini*86) MOZ_D3D_CPU_SUFFIX=x86 ;;x86_64) MOZ_D3D_CPU_SUFFIX=x64 ;;esac
Alright I decided to try to be thorough about this. Here are all the d3d compilers on my system. (Lots of apps ship their own copy...)
[snip]
Which would you like? =)
That's easy: we want the same libraries Mozilla bundles in ESR 60. :)
And why don't you want the same libraries of M$ C Runtime for, e.g., #12968 (moved)?