Merge pull request #52 from sommersoft/fix_mpy_cross

Properly Truncate mpy Filenames
This commit is contained in:
Kattni 2019-10-15 19:46:26 -04:00 committed by GitHub
commit e5da2baed3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -174,10 +174,12 @@ def library(library_path, output_directory, package_folder_prefix,
_munge_to_temp(full_path, temp_file, library_version)
if mpy_cross:
mpy_success = subprocess.call([mpy_cross,
"-o", output_file,
"-s", str(filename),
temp_file.name])
mpy_success = subprocess.call([
mpy_cross,
"-o", output_file,
"-s", str(filename.relative_to(library_path)),
temp_file.name
])
if mpy_success != 0:
raise RuntimeError("mpy-cross failed on", full_path)
else:
@ -197,10 +199,12 @@ def library(library_path, output_directory, package_folder_prefix,
filename.relative_to(library_path).with_suffix(new_extension)
)
mpy_success = subprocess.call([mpy_cross,
"-o", output_file,
"-s", str(filename),
temp_file.name])
mpy_success = subprocess.call([
mpy_cross,
"-o", output_file,
"-s", str(filename.relative_to(library_path)),
temp_file.name
])
if mpy_success != 0:
raise RuntimeError("mpy-cross failed on", full_path)