Bug 1305604 - Convert dashes to underscores in crate name when generating --extern option. r=froydnj
authorMatthew Gregan <kinetik@flim.org>
Wed, 28 Sep 2016 10:07:47 +1300
changeset 315401 b7366ba1500d0fa6a63c9c8613a07ec34f72cf0e
parent 315400 9429b90c5754982ad3564da4c1b7a11f772e2566
child 315402 e3f2279355ba4974913f3d3415bf2da04eee0355
push id82157
push usermgregan@mozilla.com
push dateTue, 27 Sep 2016 21:08:11 +0000
treeherdermozilla-inbound@b7366ba1500d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1305604
milestone52.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1305604 - Convert dashes to underscores in crate name when generating --extern option. r=froydnj
python/mozbuild/mozbuild/backend/recursivemake.py
--- a/python/mozbuild/mozbuild/backend/recursivemake.py
+++ b/python/mozbuild/mozbuild/backend/recursivemake.py
@@ -1269,17 +1269,17 @@ class RecursiveMakeBackend(CommonBackend
                             % rlib.basename.replace('-', '_'))
             backend_file.write('RUST_PRELINK_SRC := %s\n' % extern_crate_file)
 
             backend_file.write('RUST_PRELINK_FLAGS :=\n')
             backend_file.write('RUST_PRELINK_DEPS :=\n')
             for rlib in rlibs:
                 rlib_relpath = pretty_relpath(rlib)
                 backend_file.write('RUST_PRELINK_FLAGS += --extern %s=%s/%s\n'
-                                   % (rlib.basename, rlib_relpath, rlib.import_name))
+                                   % (rlib.basename.replace('-', '_'), rlib_relpath, rlib.import_name))
                 backend_file.write('RUST_PRELINK_FLAGS += -L %s/%s\n'
                                    % (rlib_relpath, rlib.deps_path))
                 backend_file.write('RUST_PRELINK_DEPS += %s/%s\n'
                                    % (rlib_relpath, rlib.import_name))
 
         for lib in obj.linked_system_libs:
             if obj.KIND == 'target':
                 backend_file.write_once('OS_LIBS += %s\n' % lib)