Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 55fcc019e4 | |||
| 5d758c2998 |
+7
-1
@@ -7,6 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
|
|
||||||
## [Unreleased]
|
## [Unreleased]
|
||||||
|
|
||||||
|
## [1.0.0-pre.2] - 2026-03-06
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
- Module `init` is no longer called if dependencies are not satisfied. The library handle is unloaded and a dep error is returned.
|
||||||
|
|
||||||
## [1.0.0-pre.1] - 2026-03-06
|
## [1.0.0-pre.1] - 2026-03-06
|
||||||
|
|
||||||
### Added
|
### Added
|
||||||
@@ -140,7 +145,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|||||||
- Dependency management and versioning not yet implemented
|
- Dependency management and versioning not yet implemented
|
||||||
- API is unstable and subject to change in future releases
|
- API is unstable and subject to change in future releases
|
||||||
|
|
||||||
[Unreleased]: https://github.com/anth64/stk/compare/v1.0.0-pre.1...HEAD
|
[Unreleased]: https://github.com/anth64/stk/compare/v1.0.0-pre.2...HEAD
|
||||||
|
[1.0.0-pre.2]: https://github.com/anth64/stk/compare/v1.0.0-pre.1...v1.0.0-pre.2
|
||||||
[1.0.0-pre.1]: https://github.com/anth64/stk/compare/v0.1.3...v1.0.0-pre.1
|
[1.0.0-pre.1]: https://github.com/anth64/stk/compare/v0.1.3...v1.0.0-pre.1
|
||||||
[0.1.3]: https://github.com/anth64/stk/releases/tag/v0.1.3
|
[0.1.3]: https://github.com/anth64/stk/releases/tag/v0.1.3
|
||||||
[0.1.2]: https://github.com/anth64/stk/releases/tag/v0.1.2
|
[0.1.2]: https://github.com/anth64/stk/releases/tag/v0.1.2
|
||||||
|
|||||||
@@ -323,6 +323,32 @@ unsigned char stk_module_load(const char *path, int index)
|
|||||||
|
|
||||||
extract_module_id(path, module_id);
|
extract_module_id(path, module_id);
|
||||||
|
|
||||||
|
u.obj = platform_get_symbol(handle, stk_mod_deps_sym);
|
||||||
|
if (u.obj) {
|
||||||
|
const stk_dep_t *early_deps = (const stk_dep_t *)u.obj;
|
||||||
|
size_t early_dep_count = 0;
|
||||||
|
size_t di;
|
||||||
|
int found;
|
||||||
|
|
||||||
|
while (early_deps[early_dep_count].id[0] != '\0')
|
||||||
|
early_dep_count++;
|
||||||
|
|
||||||
|
for (di = 0; di < early_dep_count; di++) {
|
||||||
|
found = is_mod_loaded(early_deps[di].id);
|
||||||
|
if (found < 0) {
|
||||||
|
platform_unload_library(handle);
|
||||||
|
return STK_MOD_DEP_NOT_FOUND_ERROR;
|
||||||
|
}
|
||||||
|
if (early_deps[di].version[0] &&
|
||||||
|
!stk_validate_constraint(
|
||||||
|
early_deps[di].version,
|
||||||
|
stk_modules[found].version)) {
|
||||||
|
platform_unload_library(handle);
|
||||||
|
return STK_MOD_DEP_VERSION_MISMATCH_ERROR;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (stk_modules[index].init() != STK_MOD_INIT_SUCCESS) {
|
if (stk_modules[index].init() != STK_MOD_INIT_SUCCESS) {
|
||||||
platform_unload_library(handle);
|
platform_unload_library(handle);
|
||||||
return STK_MOD_INIT_FAILURE;
|
return STK_MOD_INIT_FAILURE;
|
||||||
|
|||||||
Reference in New Issue
Block a user