summaryrefslogtreecommitdiff
path: root/tools/makemanifest.py
AgeCommit message (Collapse)Author
2021-04-29tools/makemanifest.py: Show directory name if there is a FreezeError.Steve App
2021-02-16tools/makemanifest.py: Allow passing option args to include().Jim Mussared
This allows customising which features can be enabled in a frozen library. e.g. `include("path.py", extra_features=True)` in path.py: options.defaults(standard_features=True) if options.standard_features: # freeze standard modules. if options.extra_features: # freeze extra modules. Signed-off-by: Jim Mussared <jim.mussared@gmail.com>
2021-01-30tools/makemanifest.py: Add check that freeze path is a directory.Jim Mussared
Avoids accidentally writing freeze("path/to/file.py") and getting unexpected results.
2020-09-11tools: Write msvc-compatible frozen content.stijn
The msvc compiler doesn't accept zero-sized arrays so let the freezing process generate compatible C code in case no modules are found and the involved arrays are all empty. This doesn't affect the functionality in any way because those arrays only get accessed when mp_frozen_mpy_names contains names, i.e. when modules are actually found.
2020-08-22tools/makemanifest.py: Use os.makedirs to make path for generated files.Damien George
The existing implementation of mkdir() in this file is not sophisticated enough to work correctly on all operating systems (eg Mac can raise EISDIR). Using the standard os.makedirs() function handles all cases correctly. Signed-off-by: Damien George <damien@micropython.org>
2020-08-08tools/makemanifest.py: Print nicely formatted errors from mpy-cross.Damien George
If mpy-cross exits with an error be sure to print that error in a way that is readable, instead of a long bytes object. Signed-off-by: Damien George <damien@micropython.org>
2020-07-26tools/makemanifest.py: Use errno.EEXIST instead of number 17.Damien George
To make this code more portable, across different platforms. Signed-off-by: Damien George <damien@micropython.org>
2020-06-24tools/makemanifest.py: Support freezing a subdirectory recursively.Damien George
This adds support for freezing an entire directory while keeping the directory as part of the import path. For example freeze("path/to/library", "module") will recursively freeze all scripts in "path/to/library/module" and have them importable as "from module import ...". Signed-off-by: Damien George <damien@micropython.org>
2020-03-05tools/makemanifest.py: Fix build on Windows by adding .exe to mpy-cross.MikeTeachman
When using a manifest on Windows the reference to mpy-cross compiler was missing the .exe file extension, so add it when appropriate. Also allow the default path to mpy-cross to be overridden by the (optional) MICROPY_MPYCROSS environment variable, to allow full flexibility on any OS.
2020-02-28all: Reformat C and Python source code with tools/codeformat.py.Damien George
This is run with uncrustify 0.70.1, and black 19.10b0.
2020-02-20tools/makemanifest.py: Support freezing with empty list of mpy files.Damien George
Fixes issue #5655.
2019-11-13tools/makemanifest.py: Use sys.executable when invoking Python scripts.Yonatan Goldschmidt
So the version of Python used to run makemanifest.py is also used for the sub-scripts.
2019-11-07tools/makemanifest.py: Skip freezing unsupported files with warning.Andrew Leech
2019-11-06tools/makemanifest.py: Follow symlinks when freezing linked directories.Mirko Vogt
While the new manifest.py style got introduced for freezing python code into the resulting binary, the old way - where files and modules within ports/*/modules where baked into the resulting binary - was still supported via `freeze('$(PORT_DIR)/modules')` within manifest.py. However behaviour changed for symlinked directories (=modules), as those links weren't followed anymore. This commit restores the original behaviour by explicitly following symlinks within a modules/ directory
2019-10-21tools/makemanifest.py: Eval relative paths w.r.t. current manifest file.Jim Mussared
When loading a manifest file, e.g. by include(), it will chdir first to the directory of that manifest. This means that all file operations within a manifest are relative to that manifest's location. As a consequence of this, additional environment variables are needed to find absolute paths, so the following are added: $(MPY_LIB_DIR), $(PORT_DIR), $(BOARD_DIR). And rename $(MPY) to $(MPY_DIR) to be consistent. Existing manifests are updated to match.
2019-10-15tools: Add mechanism to provide a manifest of frozen files.Damien George
This introduces a new build variable FROZEN_MANIFEST which can be set to a manifest listing (written in Python) that describes the set of files to be frozen in to the firmware.