Skip to content

Remove env_var and command_line from options #1240

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 8 commits into from
May 15, 2025

Conversation

wks
Copy link
Collaborator

@wks wks commented Nov 28, 2024

Removed from_env_var and from_command_line from MMTkOption because now all options can be set in both ways.

Replaced Options::set_from_command_line and Options::set_from_env_var with a single Options::set_from_string.

Moved several methods of Options out of the options! macro if they don't need to be generated via macro expansion. Now only two methods are generated by the macro.

  • set_from_string_inner: Requires matching field names against user-provided strings.
  • new: Initializing fields using default values.

In order to replicate the behavior that Options::read_env_var_settings silently ignores unrecognized option keys in MMTK_* environment variables, we introduced an error type SetOptionByStringError which Options::set_from_string_inner returns so that Options::read_env_var_settings and Options::set_bulk_from_string can behave differently when encountering invalid keys.

wks added 4 commits November 30, 2024 18:16
Remove env_var and command_line because they can all be set in both
ways.

Also renamed functions that set options by name, and removed "convenient
methods" in MMTKBuilder and memory_manager.
Require T in MMTKOption<T> to implemnt FromStr because we use
parse::<T>() anyway.

Move Default out of macro.

Update comments.
@wks wks force-pushed the fix/remove-envvar-cmdline branch from 8004a10 to 8941384 Compare November 30, 2024 13:14
@wks wks changed the title Refactor Options Remove env_var and command_line from options Nov 30, 2024
wks added 2 commits May 15, 2025 15:04
We restore to the naming style similar to the old names.
@wks wks added the PR-extended-testing Run extended tests for the pull request label May 15, 2025
@wks wks marked this pull request as ready for review May 15, 2025 07:19
@wks wks requested a review from qinsoon May 15, 2025 07:19
Copy link
Member

@qinsoon qinsoon left a comment

Choose a reason for hiding this comment

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

LGTM

@wks wks removed the PR-extended-testing Run extended tests for the pull request label May 15, 2025
@wks
Copy link
Collaborator Author

wks commented May 15, 2025

The extended tests passed except for JikesRVM which failed for the well-known "xxxx is not in RVM space" error. I just added a change to the API migration log, and this should be ready to merge now. I removed the PR-extended-testing flag so that the test can finish faster.

@wks wks enabled auto-merge May 15, 2025 09:45
@wks wks added PR-extended-testing Run extended tests for the pull request and removed PR-extended-testing Run extended tests for the pull request labels May 15, 2025
@wks wks force-pushed the fix/remove-envvar-cmdline branch from 391c0fe to fde940d Compare May 15, 2025 13:44
@wks wks added this pull request to the merge queue May 15, 2025
Merged via the queue into mmtk:master with commit a592f87 May 15, 2025
31 of 32 checks passed
@wks wks deleted the fix/remove-envvar-cmdline branch May 15, 2025 15:46
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.

2 participants