Skip to content

Revert "refactor: remove clite.init() for non baremetal targets"#1613

Closed
xushiwei wants to merge 1 commit intomainfrom
revert-1300-remove-clite-init
Closed

Revert "refactor: remove clite.init() for non baremetal targets"#1613
xushiwei wants to merge 1 commit intomainfrom
revert-1300-remove-clite-init

Conversation

@xushiwei
Copy link
Member

@xushiwei xushiwei commented Feb 5, 2026

Reverts #1300

@gemini-code-assist
Copy link

Summary of Changes

Hello @xushiwei, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request reverses a previous refactoring effort related to the clite.init() function within the goplus/llgo project. The primary impact is a change in when and where this initialization function is executed across different compilation targets. Specifically, it reinstates the execution of clite.init() for standard (non-baremetal) environments while disabling its explicit execution for baremetal builds, effectively reverting the system to its state before the original refactor.

Highlights

  • Revert of PR refactor: remove clite.init() for non baremetal targets #1300: This pull request fully reverts the changes introduced in refactor: remove clite.init() for non baremetal targets #1300, which aimed to refactor the clite.init() function execution.
  • Restored clite.init() for non-baremetal targets: The execution of clite.init() is restored for general and non-baremetal environments by re-introducing LLGoPackage = true in runtime/internal/clite/c.go and removing LLGoPackage = "decl" from platform-specific stdio files.
  • Disabled clite.init() for baremetal targets: The explicit enabling of clite.init() for baremetal targets is removed by deleting LLGoPackage = true from runtime/internal/clite/stdio_baremetal.go.
  • Symbol Declaration Update: The _demo/go/export/libexport.h.want file is updated to re-include the declaration for github_com_goplus_llgo_runtime_internal_clite_init.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Changelog
  • _demo/go/export/libexport.h.want
    • Re-added the declaration for github_com_goplus_llgo_runtime_internal_clite_init.
  • runtime/internal/clite/c.go
    • Re-introduced const LLGoPackage = true to ensure clite.init() execution for general targets.
  • runtime/internal/clite/stdio_baremetal.go
    • Removed const LLGoPackage = true, disabling clite.init() execution for baremetal targets.
  • runtime/internal/clite/stdio_darwin.go
    • Removed const LLGoPackage = "decl", restoring clite.init() execution for Darwin targets.
  • runtime/internal/clite/stdio_default.go
    • Removed const LLGoPackage = "decl", restoring clite.init() execution for default non-baremetal targets.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request reverts a previous change that removed the clite.init() call for non-baremetal targets. The changes correctly re-enable the initialization for all targets by moving the LLGoPackage = true constant to a common file and removing platform-specific overrides. The modifications are consistent and appear correct for the intended revert.

@xgopilot
Copy link
Contributor

xgopilot bot commented Feb 5, 2026

Code Review Summary

This revert PR cleanly restores clite.init() execution for all targets by moving LLGoPackage = true to c.go. The change is straightforward and the test file update (libexport.h.want) correctly reflects the new exported symbol.

Minor observations:

  • The centralized constant placement is simpler but removes per-platform flexibility that existed before
  • Non-baremetal targets (darwin, default) will now execute init() even though their stdio variables use linkname and don't require initialization

Overall, this is a clean revert. If there was a specific issue that prompted this revert, it would be helpful to document it in the PR description for future reference.


const (
// we want to execute init(), link / decl skips executing init()
LLGoPackage = true
Copy link
Contributor

Choose a reason for hiding this comment

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

Consider expanding this comment to clarify that LLGoPackage accepts different values:

  • true - execute init()
  • "decl" or "link" - skip init() execution

This helps future maintainers understand why the previous per-platform configuration used string values in some files.

@codecov
Copy link

codecov bot commented Feb 5, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.51%. Comparing base (d3861ee) to head (4512a0f).

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1613   +/-   ##
=======================================
  Coverage   90.51%   90.51%           
=======================================
  Files          48       48           
  Lines       12077    12077           
=======================================
  Hits        10931    10931           
  Misses        956      956           
  Partials      190      190           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@xushiwei xushiwei closed this Feb 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant