Bug 1336153 - Remove MOZ_RUST. r=ted draft
authorRalph Giles <giles@mozilla.com>
Tue, 09 May 2017 11:36:13 -0700
changeset 575555 6f027b22413ad4c5b3c1ed9dd79b86948affa2f7
parent 575554 a5672019999edaf9dbfe64d810a8c69c2a6c950d
child 575556 a33217708e65b55bb5514547f9136d5f41b7b56e
push id58096
push userbmo:giles@thaumas.net
push dateWed, 10 May 2017 16:32:54 +0000
reviewersted
bugs1336153
milestone55.0a1
Bug 1336153 - Remove MOZ_RUST. r=ted We now have code that unconditionally requires the rust compiler and are committed to adding more. Remove this last vestige of conditional support. MozReview-Commit-ID: EK6FBnAbR
build/moz.configure/rust.configure
config/rules.mk
dom/media/gtest/moz.build
media/libstagefright/gtest/moz.build
media/libstagefright/moz.build
netwerk/base/moz.build
old-configure.in
toolkit/library/gtest/moz.build
toolkit/library/moz.build
toolkit/toolkit.mozbuild
xpcom/rust/nsstring/gtest/moz.build
--- a/build/moz.configure/rust.configure
+++ b/build/moz.configure/rust.configure
@@ -92,18 +92,16 @@ def rust_compiler(rustc_info, cargo_info
         To compile Rust language sources please install at least
         version {} of 'cargo' and make sure it is first in your path.
 
         You can verify this by typing 'cargo --version'.
         ''').format(version, cargo_min_version))
 
     return True
 
-set_config('MOZ_RUST', rust_compiler)
-
 @template
 def rust_triple_alias(host_or_target):
     """Template defining the alias used for rustc's --target flag.
     `host_or_target` is either `host` or `target` (the @depends functions
     from init.configure).
     """
     assert host_or_target in (host, target)
 
@@ -228,11 +226,10 @@ def rust_target_env_name(triple):
     return triple.upper().replace('-','_')
 
 # We need this to form various Cargo environment variables, as there is no
 # uppercase function in make, and we don't want to shell out just for
 # converting a string to uppercase.
 set_config('RUST_TARGET_ENV_NAME', rust_target_env_name)
 
 # Until we remove all the other Rust checks in old-configure.
-add_old_configure_assignment('MOZ_RUST', rust_compiler)
 add_old_configure_assignment('RUSTC', rustc)
 add_old_configure_assignment('RUST_TARGET', rust_target_triple)
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -895,17 +895,16 @@ endif
 ifdef MOZ_AUTOMATION
 ifeq (,$(filter 1,$(MOZ_AUTOMATION_BUILD_SYMBOLS)))
 DUMP_SYMS_TARGETS :=
 endif
 endif
 
 $(foreach file,$(DUMP_SYMS_TARGETS),$(eval $(call syms_template,$(file),$(file)_syms.track)))
 
-ifdef MOZ_RUST
 cargo_host_flag := --target=$(RUST_HOST_TARGET)
 cargo_target_flag := --target=$(RUST_TARGET)
 
 # Permit users to pass flags to cargo from their mozconfigs (e.g. --color=always).
 cargo_build_flags = $(CARGOFLAGS)
 ifndef MOZ_DEBUG_RUST
 cargo_build_flags += --release
 endif
@@ -1046,17 +1045,16 @@ force-cargo-program-build:
 endif # RUST_PROGRAMS
 ifdef HOST_RUST_PROGRAMS
 force-cargo-host-program-build:
 	$(REPORT_BUILD)
 	$(call CARGO_BUILD) $(addprefix --bin ,$(HOST_RUST_CARGO_PROGRAMS)) $(cargo_host_flag)
 
 $(HOST_RUST_PROGRAMS): force-cargo-host-program-build
 endif # HOST_RUST_PROGRAMS
-endif # MOZ_RUST
 
 $(SOBJS):
 	$(REPORT_BUILD)
 	$(AS) -o $@ $(DEFINES) $(ASFLAGS) $($(notdir $<)_FLAGS) $(LOCAL_INCLUDES) -c $<
 
 $(CPPOBJS):
 	$(REPORT_BUILD_VERBOSE)
 	$(call BUILDSTATUS,OBJECT_FILE $@)
--- a/dom/media/gtest/moz.build
+++ b/dom/media/gtest/moz.build
@@ -18,33 +18,30 @@ UNIFIED_SOURCES += [
     'TestIntervalSet.cpp',
     'TestMediaDataDecoder.cpp',
     'TestMediaEventSource.cpp',
     'TestMediaMIMETypes.cpp',
     'TestMozPromise.cpp',
     'TestMP3Demuxer.cpp',
     'TestMP4Demuxer.cpp',
     # 'TestMP4Reader.cpp', disabled so we can turn check tests back on (bug 1175752)
+    'TestRust.cpp',
     'TestTrackEncoder.cpp',
     'TestVideoSegment.cpp',
     'TestVideoUtils.cpp',
     'TestVPXDecoding.cpp',
     'TestWebMBuffered.cpp',
 ]
 
 if CONFIG['MOZ_WEBM_ENCODER']:
     UNIFIED_SOURCES += [
         'TestVideoTrackEncoder.cpp',
         'TestWebMWriter.cpp',
     ]
 
-if CONFIG['MOZ_RUST']:
-    UNIFIED_SOURCES += ['TestRust.cpp',]
-
-
 TEST_HARNESS_FILES.gtest += [
     '../test/gizmo-frag.mp4',
     '../test/gizmo.mp4',
     '../test/vp9cake.webm',
     'dash_dashinit.mp4',
     'id3v2header.mp3',
     'mediasource_test.mp4',
     'negative_duration.mp4',
--- a/media/libstagefright/gtest/moz.build
+++ b/media/libstagefright/gtest/moz.build
@@ -33,18 +33,17 @@ TEST_HARNESS_FILES.gtest += [
     'test_case_1301065-overfl.mp4',
     'test_case_1301065-u32max.mp4',
     'test_case_1301065-u64max.mp4',
     'test_case_1301065.mp4',
     'test_case_1329061.mov',
     'test_case_1351094.mp4',
 ]
 
-if CONFIG['MOZ_RUST']:
-    UNIFIED_SOURCES += ['TestMP4Rust.cpp',]
-    TEST_HARNESS_FILES.gtest += [
-        '../../../dom/media/test/street.mp4',
-    ]
-    LOCAL_INCLUDES += [
-        '../binding/include',
-    ]
+UNIFIED_SOURCES += ['TestMP4Rust.cpp',]
+TEST_HARNESS_FILES.gtest += [
+    '../../../dom/media/test/street.mp4',
+]
+LOCAL_INCLUDES += [
+    '../binding/include',
+]
 
 FINAL_LIBRARY = 'xul-gtest'
--- a/media/libstagefright/moz.build
+++ b/media/libstagefright/moz.build
@@ -78,20 +78,19 @@ SOURCES += [
     'frameworks/av/media/libstagefright/foundation/hexdump.cpp',
     'frameworks/av/media/libstagefright/MetaData.cpp',
     'system/core/libutils/RefBase.cpp',
     'system/core/libutils/String16.cpp',
     'system/core/libutils/String8.cpp',
     'system/core/libutils/VectorImpl.cpp',
 ]
 
-if CONFIG['MOZ_RUST']:
-    EXPORTS += [
-        'binding/include/mp4parse.h',
-    ]
+EXPORTS += [
+    'binding/include/mp4parse.h',
+]
 
 UNIFIED_SOURCES += [
     'binding/Adts.cpp',
     'binding/AnnexB.cpp',
     'binding/BitReader.cpp',
     'binding/Box.cpp',
     'binding/BufferStream.cpp',
     'binding/DecoderData.cpp',
--- a/netwerk/base/moz.build
+++ b/netwerk/base/moz.build
@@ -250,17 +250,17 @@ UNIFIED_SOURCES += [
     'StreamingProtocolService.cpp',
     'TCPFastOpenLayer.cpp',
     'ThrottleQueue.cpp',
     'ThrottlingService.cpp',
     'Tickler.cpp',
     'TLSServerSocket.cpp',
 ]
 
-if CONFIG['MOZ_RUST'] and CONFIG['MOZ_RUST_URLPARSE']:
+if CONFIG['MOZ_RUST_URLPARSE']:
     EXPORTS.mozilla.net += [ 'RustURL.h' ]
     UNIFIED_SOURCES += [ 'RustURL.cpp' ]
 
 if CONFIG['MOZ_WIDGET_TOOLKIT'] == 'windows':
     SOURCES += [
         'nsURLHelperWin.cpp',
         'ShutdownLayer.cpp',
     ]
--- a/old-configure.in
+++ b/old-configure.in
@@ -2323,24 +2323,22 @@ if test -n "$MOZ_GRAPHENE"; then
     AC_DEFINE(MOZ_GRAPHENE)
 fi
 
 if test -n "$MOZ_MULET"; then
     AC_DEFINE(MOZ_MULET)
 fi
 
 # Propagate feature switches for code written in rust from confvars.sh
-if test -n "$MOZ_RUST"; then
-    if test -n "$MOZ_RUST_MP4PARSE"; then
-        AC_DEFINE(MOZ_RUST_MP4PARSE)
-    fi
-    if test -n "$MOZ_RUST_URLPARSE"; then
-        AC_DEFINE(MOZ_RUST_URLPARSE)
-        AC_SUBST(MOZ_RUST_URLPARSE)
-    fi
+if test -n "$MOZ_RUST_MP4PARSE"; then
+    AC_DEFINE(MOZ_RUST_MP4PARSE)
+fi
+if test -n "$MOZ_RUST_URLPARSE"; then
+    AC_DEFINE(MOZ_RUST_URLPARSE)
+    AC_SUBST(MOZ_RUST_URLPARSE)
 fi
 
 AC_SUBST(MOZ_PHOENIX)
 AC_SUBST(MOZ_XULRUNNER)
 AC_SUBST(MOZ_B2G)
 AC_SUBST(MOZ_MULET)
 AC_SUBST(MOZ_B2G_VERSION)
 
--- a/toolkit/library/gtest/moz.build
+++ b/toolkit/library/gtest/moz.build
@@ -2,29 +2,25 @@
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 FINAL_TARGET = 'dist/bin/gtest'
 
 USE_LIBS += [
+    'gkrust-gtest',
     'static:xul',
     # xul-gtest is an intermediate static library. It is used as FINAL_TARGET
     # for gtest code.
     # If the FINAL_TARGET were the library in this directory, then the gtest
     # code would end up before static:xul, and before StaticXULComponentStart,
     # which needs to stay first.
     'xul-gtest',
 ]
 
 # This needs to come after static:xul to avoid things like libfallible coming
 # before StaticXULComponentStart.
 Libxul('xul-gtest-real')
 
-if CONFIG['MOZ_RUST']:
-    USE_LIBS += [
-        'gkrust-gtest',
-    ]
-
 DIRS += [
     'static',
 ]
--- a/toolkit/library/moz.build
+++ b/toolkit/library/moz.build
@@ -58,17 +58,17 @@ def Libxul(name):
 
     Libxul_defines()
 
     if CONFIG['MOZ_NEEDS_LIBATOMIC']:
         OS_LIBS += ['atomic']
 
     # This option should go away in bug 1290972, but we need to wait until
     # Rust 1.12 has been released.
-    if CONFIG['MOZ_RUST'] and CONFIG['OS_ARCH'] == 'Darwin':
+    if CONFIG['OS_ARCH'] == 'Darwin':
         LDFLAGS += ['-Wl,-no_compact_unwind']
 
 Libxul('xul')
 
 FORCE_STATIC_LIB = True
 
 STATIC_LIBRARY_NAME = 'xul_s'
 
@@ -346,10 +346,9 @@ if CONFIG['COMPILE_ENVIRONMENT']:
     FINAL_TARGET_FILES += ['!dependentlibs.list', '!dependentlibs.list.gtest']
 
 # This library needs to be last to make XPCOM module registration work.
 USE_LIBS += ['StaticXULComponentsEnd']
 
 # The above library needs to be last for C++ purposes.  This library,
 # however, is entirely composed of Rust code, and needs to come after
 # all the C++ code so any possible C++ -> Rust calls can be resolved.
-if CONFIG['MOZ_RUST']:
-    USE_LIBS += ['gkrust']
+USE_LIBS += ['gkrust']
--- a/toolkit/toolkit.mozbuild
+++ b/toolkit/toolkit.mozbuild
@@ -128,33 +128,26 @@ DIRS += [
     '/toolkit',
 ]
 
 if CONFIG['MOZ_PREF_EXTENSIONS']:
     DIRS += ['/extensions/pref']
 
 DIRS += [
     '/devtools',
+    '/toolkit/library',
+    '/toolkit/library/gtest/rust',
+    '/toolkit/library/rust',
+    '/toolkit/library/StaticXULComponentsEnd',
     '/services',
     '/startupcache',
     '/js/ductwork/debugger',
     '/other-licenses/snappy',
 ]
 
-if CONFIG['MOZ_RUST']:
-    DIRS += [
-        '/toolkit/library/gtest/rust',
-        '/toolkit/library/rust',
-    ]
-
-DIRS += [
-    '/toolkit/library/StaticXULComponentsEnd',
-    '/toolkit/library',
-]
-
 if 'gtk' in CONFIG['MOZ_WIDGET_TOOLKIT']:
     DIRS += ['/toolkit/system/gnome']
 
 DIRS += ['/addon-sdk']
 
 if CONFIG['ENABLE_MARIONETTE']:
     DIRS += [
         '/testing/firefox-ui',
--- a/xpcom/rust/nsstring/gtest/moz.build
+++ b/xpcom/rust/nsstring/gtest/moz.build
@@ -1,12 +1,11 @@
 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
-if CONFIG['MOZ_RUST']:
-    UNIFIED_SOURCES += [
-        'Test.cpp'
-    ]
+UNIFIED_SOURCES += [
+    'Test.cpp'
+]
 
 FINAL_LIBRARY = 'xul-gtest'