Skip to content

Conversation

nsajko
Copy link
Member

@nsajko nsajko commented Mar 22, 2025

Should make the sysimage less vulnerable to invalidation.

As far as I understand this change can't break any code, because:

  • the macro definition requires AbstractString
  • the way Julia macros work, the argument is either a literal or an Expr
  • String is the only AbstractString with literals

Should make the sysimage less vulnerable to invalidation.

As far as I understand this change can't break any code, because:
* the macro definition requires `AbstractString`
* the way Julia macros work, the argument is either a literal or an `Expr`
* `String` is the only `AbstractString` with literals
@nsajko nsajko added backport 1.10 Change should be backported to the 1.10 release backport 1.11 Change should be backported to release-1.11 invalidations backport 1.12 Change should be backported to release-1.12 macros @macros labels Mar 22, 2025
@nsajko
Copy link
Member Author

nsajko commented Mar 22, 2025

Prevents the invalidation:

{
    "method_instance": {
        "method": "var\"@b_str\"(__source__::LineNumberNode, __module__::Module, s) @ Base strings/io.jl:588",
        "method_instance": "MethodInstance for var\"@b_str\"(::LineNumberNode, ::Module, ::Any)"
    },
    "children": [
    ]
}

Also fixing the following invalidation would cause a chain reaction where even more invalidation gets fixed (for a future PR to JuliaSyntax):

{
    "method_instance": {
        "method": "var\"@u8_str\"(__source__::LineNumberNode, __module__::Module, str) @ Base.JuliaSyntax /cache/build/builder-amdci5-7/julialang/julia-master/base/JuliaSyntax/src/utils.jl:54",
        "method_instance": "MethodInstance for Base.JuliaSyntax.var\"@u8_str\"(::LineNumberNode, ::Module, ::Any)"
    },
    "children": [
    ]
}

@KristofferC KristofferC mentioned this pull request Mar 24, 2025
27 tasks
@KristofferC KristofferC merged commit 87f4d3a into JuliaLang:master Mar 25, 2025
9 of 12 checks passed
@nsajko nsajko deleted the Base_restrict_macro_b_str_argument_to_String branch March 25, 2025 13:04
KristofferC pushed a commit that referenced this pull request Mar 26, 2025
Should make the sysimage less vulnerable to invalidation.

As far as I understand this change can't break any code, because:
* the macro definition requires `AbstractString`
* the way Julia macros work, the argument is either a literal or an
`Expr`
* `String` is the only `AbstractString` with literals

(cherry picked from commit 87f4d3a)
@KristofferC KristofferC removed the backport 1.12 Change should be backported to release-1.12 label Mar 31, 2025
KristofferC pushed a commit that referenced this pull request Mar 31, 2025
Should make the sysimage less vulnerable to invalidation.

As far as I understand this change can't break any code, because:
* the macro definition requires `AbstractString`
* the way Julia macros work, the argument is either a literal or an
`Expr`
* `String` is the only `AbstractString` with literals

(cherry picked from commit 87f4d3a)
@KristofferC KristofferC mentioned this pull request Mar 31, 2025
71 tasks
KristofferC pushed a commit that referenced this pull request Mar 31, 2025
Should make the sysimage less vulnerable to invalidation.

As far as I understand this change can't break any code, because:
* the macro definition requires `AbstractString`
* the way Julia macros work, the argument is either a literal or an
`Expr`
* `String` is the only `AbstractString` with literals

(cherry picked from commit 87f4d3a)
KristofferC pushed a commit that referenced this pull request Mar 31, 2025
Should make the sysimage less vulnerable to invalidation.

As far as I understand this change can't break any code, because:
* the macro definition requires `AbstractString`
* the way Julia macros work, the argument is either a literal or an
`Expr`
* `String` is the only `AbstractString` with literals

(cherry picked from commit 87f4d3a)
@KristofferC KristofferC removed the backport 1.11 Change should be backported to release-1.11 label Apr 10, 2025
@KristofferC KristofferC mentioned this pull request Jun 4, 2025
75 tasks
KristofferC pushed a commit that referenced this pull request Jun 5, 2025
Should make the sysimage less vulnerable to invalidation.

As far as I understand this change can't break any code, because:
* the macro definition requires `AbstractString`
* the way Julia macros work, the argument is either a literal or an
`Expr`
* `String` is the only `AbstractString` with literals

(cherry picked from commit 87f4d3a)
KristofferC pushed a commit that referenced this pull request Jul 3, 2025
Should make the sysimage less vulnerable to invalidation.

As far as I understand this change can't break any code, because:
* the macro definition requires `AbstractString`
* the way Julia macros work, the argument is either a literal or an
`Expr`
* `String` is the only `AbstractString` with literals

(cherry picked from commit 87f4d3a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 1.10 Change should be backported to the 1.10 release invalidations macros @macros
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants