Skip to content

Comments

Fix: Return modified modules list in build_standard_library.py#8332

Closed
chawdamrunal wants to merge 1 commit intoballerina-platform:mainfrom
chawdamrunal:fix/build-script-return-value
Closed

Fix: Return modified modules list in build_standard_library.py#8332
chawdamrunal wants to merge 1 commit intoballerina-platform:mainfrom
chawdamrunal:fix/build-script-return-value

Conversation

@chawdamrunal
Copy link

@chawdamrunal chawdamrunal commented Oct 8, 2025

Description

Fixes: #8347

Fixes a logic bug in get_stdlib_module_list() function where the modified modules list was not being returned.

Problem

The function was building a modified modules list throughout its execution (adding extended_modules, connectors, tools, and distribution when requested), but was returning the original unmodified module_list["modules"] instead.

This caused command-line flags to be ignored:

  • --build-extended-modules
  • --build-connectors
  • --build-tools
  • --build-distribution

Solution

Changed line 368 in resources/scripts/build_standard_library.py:

  • Before: return module_list["modules"]
  • After: return modules

Impact

Users can now successfully build extended modules, connectors, tools, and distribution when using the respective command-line flags.

Testing

  • Verified the logic fix addresses the root cause
  • No breaking changes introduced
  • Code follows project standards

Related

  • Identified during security audit/code review
  • This is a functional bug fix that improves build script reliability

Note: This is a Hacktoberfest contribution 🎃

Checklist:

  • Code follows the project's coding standards
  • Fix addresses the root cause of the issue
  • No breaking changes introduced

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.
@CLAassistant
Copy link

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


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.

@chawdamrunal
Copy link
Author

🎃 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 modules list is returned so that the build flags work as intended.

Happy to make any changes if needed!

@ThisaruGuruge ThisaruGuruge requested a review from Copilot October 9, 2025 08:43
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 modules list instead of the original module_list["modules"]

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@ThisaruGuruge
Copy link
Member

Hi @chawdamrunal

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.

@chawdamrunal
Copy link
Author

@ThisaruGuruge, I have signed the CLA. Kindly check.

@ThisaruGuruge
Copy link
Member

@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.

@chawdamrunal
Copy link
Author

@ThisaruGuruge, it seems like the main root cause. Kindly close the PR I'll raise it again.

@daneshk daneshk closed this Oct 21, 2025
@daneshk daneshk reopened this Oct 21, 2025
@daneshk daneshk closed this Oct 21, 2025
@daneshk
Copy link
Member

daneshk commented Oct 21, 2025

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Return modified modules list in build_standard_library.py (Fixed)

4 participants