Skip to content
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

bpart: Start enforcing min_world for global variable definitions #57150

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

Keno
Copy link
Member

@Keno Keno commented Jan 24, 2025

This is the analog of #57102 for global variables. Unlike for consants, there is no automatic global backdate mechanism. The reasoning for this is that global variables can be declared at any time, unlike constants which can only be decalared once their value is available. As a result code patterns using Core.eval to declare globals are rarer and likely incorrect.

@Keno Keno force-pushed the kf/globalminworld branch from a06285c to b53c87e Compare January 24, 2025 03:41
Base automatically changed from kf/backdatedconstwarn to master January 25, 2025 02:50
Keno added a commit to JuliaLang/Distributed.jl that referenced this pull request Jan 25, 2025
The internal function `jl_set_const` is allowed during bootstrap only
and ignores world age partition. This would give incorrect results after
JuliaLang/julia#57150. Just eval the constant definition directly,
which has well defined semantics.
@Keno Keno force-pushed the kf/globalminworld branch from b53c87e to dfa20f4 Compare January 25, 2025 04:57
@Keno
Copy link
Member Author

Keno commented Jan 25, 2025

Distributed test failure is JuliaLang/Distributed.jl#125.

JamesWrigley pushed a commit to JuliaLang/Distributed.jl that referenced this pull request Jan 26, 2025
The internal function `jl_set_const` is allowed during bootstrap only
and ignores world age partition. This would give incorrect results after
JuliaLang/julia#57150. Just eval the constant definition directly,
which has well defined semantics.
JamesWrigley pushed a commit to JuliaLang/Distributed.jl that referenced this pull request Jan 26, 2025
The internal function `jl_set_const` is allowed during bootstrap only
and ignores world age partition. This would give incorrect results after
JuliaLang/julia#57150. Just eval the constant definition directly,
which has well defined semantics.
@DilumAluthge
Copy link
Member

Needs #57169 I presume.

@DilumAluthge
Copy link
Member

@Keno Here's the test failure now:

Error in testset rebinding:
Error During Test at /cache/build/tester-amdci5-13/julialang/julia-master/julia-7f6d503f8b/share/julia/test/testdefs.jl:24
  Got exception outside of a @test
  LoadError: invalid redefinition of constant Rebinding.Foo
  Stacktrace:

@Keno Keno force-pushed the kf/globalminworld branch from 7f6d503 to 036bc6f Compare January 28, 2025 01:24
This is the analog of #57102 for global variables. Unlike for consants,
there is no automatic global backdate mechanism. The reasoning for this
is that global variables can be declared at any time, unlike constants
which can only be decalared once their value is available. As a result
code patterns using `Core.eval` to declare globals are rarer and likely
incorrect.
@Keno Keno force-pushed the kf/globalminworld branch from 036bc6f to e7b83ba Compare January 28, 2025 22:51
@Keno Keno merged commit f209eba into master Jan 29, 2025
7 checks passed
@Keno Keno deleted the kf/globalminworld branch January 29, 2025 02:08
@IanButterworth
Copy link
Member

I assume this test noise from the docs tests was introduced here

      From worker 6:	WARNING: Detected access to binding `NoDocStrings.##meta#60` in a world prior to its definition world.
      From worker 6:	  Julia 1.12 has introduced more strict world age semantics for global bindings.
      From worker 6:	  !!! This code may malfunction under Revise.
      From worker 6:	  !!! This code will error in future versions of Julia.
      From worker 6:	Hint: Add an appropriate `invokelatest` around the access to this binding.
      From worker 6:	WARNING: Detected access to binding `DocRefTests.##meta#60` in a world prior to its definition world.
      From worker 6:	  Julia 1.12 has introduced more strict world age semantics for global bindings.
      From worker 6:	  !!! This code may malfunction under Revise.
      From worker 6:	  !!! This code will error in future versions of Julia.
      From worker 6:	Hint: Add an appropriate `invokelatest` around the access to this binding.

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.

3 participants