Skip to content

Commit e5da2ba

Browse files
authored
Merge pull request #52 from sommersoft/fix_mpy_cross
Properly Truncate mpy Filenames
2 parents 318fa70 + 283d828 commit e5da2ba

File tree

1 file changed

+12
-8
lines changed

1 file changed

+12
-8
lines changed

circuitpython_build_tools/build.py

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -174,10 +174,12 @@ def library(library_path, output_directory, package_folder_prefix,
174174
_munge_to_temp(full_path, temp_file, library_version)
175175

176176
if mpy_cross:
177-
mpy_success = subprocess.call([mpy_cross,
178-
"-o", output_file,
179-
"-s", str(filename),
180-
temp_file.name])
177+
mpy_success = subprocess.call([
178+
mpy_cross,
179+
"-o", output_file,
180+
"-s", str(filename.relative_to(library_path)),
181+
temp_file.name
182+
])
181183
if mpy_success != 0:
182184
raise RuntimeError("mpy-cross failed on", full_path)
183185
else:
@@ -197,10 +199,12 @@ def library(library_path, output_directory, package_folder_prefix,
197199
filename.relative_to(library_path).with_suffix(new_extension)
198200
)
199201

200-
mpy_success = subprocess.call([mpy_cross,
201-
"-o", output_file,
202-
"-s", str(filename),
203-
temp_file.name])
202+
mpy_success = subprocess.call([
203+
mpy_cross,
204+
"-o", output_file,
205+
"-s", str(filename.relative_to(library_path)),
206+
temp_file.name
207+
])
204208
if mpy_success != 0:
205209
raise RuntimeError("mpy-cross failed on", full_path)
206210

0 commit comments

Comments
 (0)