Bug 1302704 - part 2 - rename cargo_target_directory; r=chmanchester
authorNathan Froyd <froydnj@mozilla.com>
Thu, 23 Feb 2017 10:35:07 -0500
changeset 373622 17b7f6a479363762110c33625771be609be00990
parent 373621 7b63c26dd7c1776c35b6fb9afbe5a90f980e4147
child 373623 3c3ffbed3a4b22e613f0912c2ecb0378e7f8a35e
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschmanchester
bugs1302704
milestone54.0a1
Bug 1302704 - part 2 - rename cargo_target_directory; r=chmanchester We're going to be introducing a value for CARGO_TARGET_DIR in a later patch, we we should rename this function to not conflict with that concept.
python/mozbuild/mozbuild/frontend/data.py
--- a/python/mozbuild/mozbuild/frontend/data.py
+++ b/python/mozbuild/mozbuild/frontend/data.py
@@ -415,17 +415,17 @@ class SimpleProgram(BaseProgram):
 
 class HostSimpleProgram(HostMixin, BaseProgram):
     """Context derived container object for each program in
     HOST_SIMPLE_PROGRAMS"""
     SUFFIX_VAR = 'HOST_BIN_SUFFIX'
     KIND = 'host'
 
 
-def cargo_target_directory(context, target_var):
+def cargo_output_directory(context, target_var):
     # cargo creates several directories and places its build artifacts
     # in those directories.  The directory structure depends not only
     # on the target, but also what sort of build we are doing.
     rust_build_kind = 'release'
     if context.config.substs.get('MOZ_DEBUG'):
         rust_build_kind = 'debug'
     return mozpath.join(context.config.substs[target_var], rust_build_kind)
 
@@ -441,17 +441,17 @@ class BaseRustProgram(ContextDerived):
         'KIND',
         'TARGET_SUBST_VAR',
     )
 
     def __init__(self, context, name, cargo_file):
         ContextDerived.__init__(self, context)
         self.name = name
         self.cargo_file = cargo_file
-        cargo_dir = cargo_target_directory(context, self.TARGET_SUBST_VAR)
+        cargo_dir = cargo_output_directory(context, self.TARGET_SUBST_VAR)
         exe_file = '%s%s' % (name, context.config.substs.get(self.SUFFIX_VAR, ''))
         self.location = mozpath.join(cargo_dir, exe_file)
 
 
 class RustProgram(BaseRustProgram):
     SUFFIX_VAR = 'BIN_SUFFIX'
     KIND = 'target'
     TARGET_SUBST_VAR = 'RUST_TARGET'
@@ -537,17 +537,17 @@ class RustLibrary(StaticLibrary):
         # package names defined in Cargo.toml with underscores in actual
         # filenames. But we need to keep the basename consistent because
         # many other things in the build system depend on that.
         assert self.crate_type == 'staticlib'
         self.lib_name = '%s%s%s' % (context.config.lib_prefix,
                                      basename.replace('-', '_'),
                                      context.config.lib_suffix)
         self.dependencies = dependencies
-        build_dir = cargo_target_directory(context, self.TARGET_SUBST_VAR)
+        build_dir = cargo_output_directory(context, self.TARGET_SUBST_VAR)
         self.import_name = mozpath.join(build_dir, self.lib_name)
         self.deps_path = mozpath.join(build_dir, 'deps')
         self.features = features
 
 
 class SharedLibrary(Library):
     """Context derived container object for a shared library"""
     __slots__ = (