Fix: Return modified modules list in build_standard_library.py#8332
Fix: Return modified modules list in build_standard_library.py#8332chawdamrunal wants to merge 1 commit intoballerina-platform:mainfrom
Conversation
The function was building a modified 'modules' list but returning the original 'module_list["modules"]', causing --build-extended-modules, --build-connectors, --build-tools, and --build-distribution flags to be ignored. This commit fixes the return statement to return the modified 'modules' variable. Resolves a logic bug where optional build components were never included in the build process despite being requested via command-line flags.
|
Mrunal Chawda seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
|
🎃 This PR is part of Hacktoberfest 2024! I noticed this bug during a security audit of the codebase. The fix is straightforward - ensuring the modified Happy to make any changes if needed! |
There was a problem hiding this comment.
Pull Request Overview
This PR fixes a logic bug in the get_stdlib_module_list() function where the function was incorrectly returning the original unmodified module list instead of the accumulated modules variable. This bug prevented command-line flags (--build-extended-modules, --build-connectors, --build-tools, --build-distribution) from working correctly.
- Fixed return statement to return the modified
moduleslist instead of the originalmodule_list["modules"]
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
|
Thank you for your contribution. It would be better if you can create an issue for the fix, and tag it in this PR, so that we can assign hacktoberfest credits for you. Then, please sign the CLA so that we can merge your PR. |
|
@ThisaruGuruge, I have signed the CLA. Kindly check. |
It still says you have not signed. Can you please check whether your commits are done using the GitHub account email? Usually this happens when your commits have a different user email than the GitHub one. |
|
@ThisaruGuruge, it seems like the main root cause. Kindly close the PR I'll raise it again. |
I closed the PR. please open a new PR |
Description
Fixes: #8347
Fixes a logic bug in
get_stdlib_module_list()function where the modifiedmoduleslist was not being returned.Problem
The function was building a modified
moduleslist throughout its execution (adding extended_modules, connectors, tools, and distribution when requested), but was returning the original unmodifiedmodule_list["modules"]instead.This caused command-line flags to be ignored:
--build-extended-modules--build-connectors--build-tools--build-distributionSolution
Changed line 368 in
resources/scripts/build_standard_library.py:return module_list["modules"]return modulesImpact
Users can now successfully build extended modules, connectors, tools, and distribution when using the respective command-line flags.
Testing
Related
Note: This is a Hacktoberfest contribution 🎃
Checklist: