Skip to content

fix breakage with jl_get_global #58540

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 1 commit into from
May 29, 2025
Merged

fix breakage with jl_get_global #58540

merged 1 commit into from
May 29, 2025

Conversation

vtjnash
Copy link
Member

@vtjnash vtjnash commented May 27, 2025

Introduce a new jl_get_global_value to do the new world-aware behavior, while preserving the old behavior for jl_get_global. Choose between jl_get_global, jl_get_global_value, and jl_eval_global_var, depending on what behavior is required. Also take this opportunity to fix some data race mistakes introduced by bindings (relaxed loads of jl_world_counter outside of assert) and lacking type asserts / unnecessary globals in precompile code.

Fix #58097
Addresses post-review comment #57213 (comment), so this is already tested against by existing logic

@vtjnash vtjnash added the backport 1.12 Change should be backported to release-1.12 label May 27, 2025
@KristofferC KristofferC mentioned this pull request May 28, 2025
58 tasks
@topolarity
Copy link
Member

Choose between jl_get_global, jl_get_global_value, and jl_eval_global_var, depending on what behavior is required.

Can we put some comments somewhere to dis-ambiguate these? A small doc-comment above the functions is probably plenty

Introduce a new `jl_get_global_value` to do the new world-aware
behavior, while preserving the old behavior for `jl_get_global`.
Choose between `jl_get_global`, `jl_get_global_value`, and
`jl_eval_global_var`, depending on what behavior is required. Also take
this opportunity to fix some data race mistakes introduced by bindings
(relaxed loads of jl_world_counter outside of assert) and lacking type
asserts / unnecessary globals in precompile code.

Fix #58097
@vtjnash vtjnash merged commit 965d007 into master May 29, 2025
5 of 7 checks passed
@vtjnash vtjnash deleted the jn/58097 branch May 29, 2025 18:53
KristofferC pushed a commit that referenced this pull request Jun 2, 2025
Introduce a new `jl_get_global_value` to do the new world-aware
behavior, while preserving the old behavior for `jl_get_global`. Choose
between `jl_get_global`, `jl_get_global_value`, and
`jl_eval_global_var`, depending on what behavior is required. Also take
this opportunity to fix some data race mistakes introduced by bindings
(relaxed loads of jl_world_counter outside of assert) and lacking type
asserts / unnecessary globals in precompile code.

Fix #58097
Addresses post-review comment
#57213 (comment), so
this is already tested against by existing logic

(cherry picked from commit 965d007)
@KristofferC
Copy link
Member

I backported this to 1.12 but got some error like "NTuple not defined in Core" when printing a backdated admonition so some help with that would be good.

vtjnash added a commit that referenced this pull request Jun 5, 2025
Introduce a new `jl_get_global_value` to do the new world-aware
behavior, while preserving the old behavior for `jl_get_global`. Choose
between `jl_get_global`, `jl_get_global_value`, and
`jl_eval_global_var`, depending on what behavior is required. Also take
this opportunity to fix some data race mistakes introduced by bindings
(relaxed loads of jl_world_counter outside of assert) and lacking type
asserts / unnecessary globals in precompile code.

Fix #58097
Addresses post-review comment
#57213 (comment), so
this is already tested against by existing logic

(cherry picked from commit 965d007)
@KristofferC KristofferC mentioned this pull request Jun 6, 2025
60 tasks
@KristofferC KristofferC removed the backport 1.12 Change should be backported to release-1.12 label Jul 9, 2025
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.

v1.12, embedding: unable to access globals in used module without updating world age
3 participants