Open Bug 1775202 Opened 3 years ago Updated 2 years ago

GN processor's mozbuild writer may pick the wrong conditions

Categories

(Firefox Build System :: General, defect, P3)

defect

Tracking

(Not tracked)

People

(Reporter: glandium, Unassigned)

References

Details

Attachments

(1 file)

This happened in bug 1738845, because of the missing combinations for MOZ_X11. This was worked around in https://phabricator.services.mozilla.com/D149850, but we need a more definitive solution, preferably not relying on a manual list of combinations.

Severity: -- → S3
Priority: -- → P3

Just a question, can't we add

diff --git a/third_party/libwebrtc/moz.build b/third_party/libwebrtc/moz.build
index 8579f8bb3622..d9ca79d4fcb8 100644
--- a/third_party/libwebrtc/moz.build
+++ b/third_party/libwebrtc/moz.build
@@ -520,7 +520,10 @@ if CONFIG["CPU_ARCH"] == "ppc64" and CONFIG["OS_TARGET"] == "Linux":
         "/third_party/libwebrtc/api/audio_codecs/isac/audio_decoder_isac_float_gn",
         "/third_party/libwebrtc/api/audio_codecs/isac/audio_encoder_isac_float_gn",
         "/third_party/libwebrtc/modules/audio_coding/isac_c_gn",
-        "/third_party/libwebrtc/modules/audio_coding/isac_gn"
+        "/third_party/libwebrtc/modules/audio_coding/isac_gn",
+        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn",
+        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
+        "/third_party/libwebrtc/modules/desktop_capture/primitives_gn"
     ]
 
 if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux":

as a workaround until there is a proper fix? I am aware we would lose the workaround when the moz.build file will be regenerated, but it would help our CI running green even with webrtc enabled on ppc64le.

This almost acts like it believes desktop capture is unsupported on ppc64.

Comparing the output of gn from x86_64 and ppc64, desktop_capture_generic, desktop_capture and primitives all appear in the generated JSON, so I don't know why gn_processor.py didn't pick it up.

(In reply to Cameron Kaiser [:spectre] from comment #4)

Comparing the output of gn from x86_64 and ppc64, desktop_capture_generic, desktop_capture and primitives all appear in the generated JSON, so I don't know why gn_processor.py didn't pick it up.

because the code in https://searchfox.org/mozilla-central/rev/52da19becaa3805e7f64088e91e9dade7dec43c8/python/mozbuild/mozbuild/gn_processor.py#507-522 doesn't work properly.

Regardless of that, shouldn't those other permutations have dirs in them? Adding some additional debugging to gn_processor.py, I see this:

args ('MOZ_DEBUG', '1') ('OS_TARGET', 'Linux') ('CPU_ARCH', 'ppc64') ('MOZ_X11', '1')
common_dirs third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn,third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn,third_party/libwebrtc/modules/desktop_capture/primitives_gn
args ('MOZ_DEBUG', '1') ('OS_TARGET', 'Linux') ('CPU_ARCH', 'ppc64') ('MOZ_X11', None)
common_dirs 
args ('MOZ_DEBUG', None) ('OS_TARGET', 'Linux') ('CPU_ARCH', 'ppc64') ('MOZ_X11', '1')
common_dirs 
args ('MOZ_DEBUG', None) ('OS_TARGET', 'Linux') ('CPU_ARCH', 'ppc64') ('MOZ_X11', None)
common_dirs 

Since common_dirs gets &= with the dir set, then these are lost. That explains the issue, so why aren't those showing up in the other permutations? Or is that the bug you mean?

They don't get added when MOZ_X11 is None. That seems to be the difference.

(In reply to Dan Horák from comment #2)

Just a question, can't we add

diff --git a/third_party/libwebrtc/moz.build b/third_party/libwebrtc/moz.build
index 8579f8bb3622..d9ca79d4fcb8 100644
--- a/third_party/libwebrtc/moz.build
+++ b/third_party/libwebrtc/moz.build
@@ -520,7 +520,10 @@ if CONFIG["CPU_ARCH"] == "ppc64" and CONFIG["OS_TARGET"] == "Linux":
         "/third_party/libwebrtc/api/audio_codecs/isac/audio_decoder_isac_float_gn",
         "/third_party/libwebrtc/api/audio_codecs/isac/audio_encoder_isac_float_gn",
         "/third_party/libwebrtc/modules/audio_coding/isac_c_gn",
-        "/third_party/libwebrtc/modules/audio_coding/isac_gn"
+        "/third_party/libwebrtc/modules/audio_coding/isac_gn",
+        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn",
+        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
+        "/third_party/libwebrtc/modules/desktop_capture/primitives_gn"
     ]
 
 if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux":

as a workaround until there is a proper fix? I am aware we would lose the workaround when the moz.build file will be regenerated, but it would help our CI running green even with webrtc enabled on ppc64le.

The workaround is not enough since 109.

patch should just omit this line:
"/third_party/libwebrtc/modules/desktop_capture/desktop_capture_generic_gn",

this dir no longer exists, it was merged into 'desktop_capture_gn' subdir in
https://github.com/mozilla/gecko-dev/commit/83be899015dd5582ce609f181a93f14d7e426a69

simple updated patch:

diff --git a/third_party/libwebrtc/moz.build b/third_party/libwebrtc/moz.build
index 8579f8bb3622..d9ca79d4fcb8 100644
--- a/third_party/libwebrtc/moz.build
+++ b/third_party/libwebrtc/moz.build
@@ -520,7 +520,9 @@ if CONFIG["CPU_ARCH"] == "ppc64" and CONFIG["OS_TARGET"] == "Linux":
         "/third_party/libwebrtc/api/audio_codecs/isac/audio_decoder_isac_float_gn",
         "/third_party/libwebrtc/api/audio_codecs/isac/audio_encoder_isac_float_gn",
         "/third_party/libwebrtc/modules/audio_coding/isac_c_gn",
-        "/third_party/libwebrtc/modules/audio_coding/isac_gn"
+        "/third_party/libwebrtc/modules/audio_coding/isac_gn",
+        "/third_party/libwebrtc/modules/desktop_capture/desktop_capture_gn",
+        "/third_party/libwebrtc/modules/desktop_capture/primitives_gn"
     ]
 
 if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "Linux":

moz.build patch for 114 (and likely 115) is at https://gist.github.com/classilla/95b5dd53627528448f8512a82205672c for 116/trunk I am using the attachment above
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: