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

Allow sysimage build without the doc system #53533

Merged
merged 1 commit into from
Mar 1, 2024
Merged

Allow sysimage build without the doc system #53533

merged 1 commit into from
Mar 1, 2024

Conversation

Keno
Copy link
Member

@Keno Keno commented Feb 29, 2024

The earliest bootstrapping code has a definition of atdoc that is just supposed to ignore the doc string and pass the defining code through. This function is then replaced by the actual docsystem once that is available. For testing, I wanted to build the whole system image without the doc system using this boostrap definition. However, this turns out not to be possible, because there's a few doc syntax semantics that do not actually just ignore the doc string.

In particular:

"""
I am a doc for a particular signature
"""
foo(x::Int, y::Float64)

Does not acutally result in a call to foo.

And similarly

"""
I am a doc for a global binding
"""
MyModule.foo

Does not require MyModule.foo to actually have a value, since it only documents the binding.

This PR allows both of those cases in the boostrap version of atdoc so that we can bootstrap without the doc system if we wanted to.

The earliest bootstrapping code has a definition of `atdoc` that is
just supposed to ignore the doc string and pass the defining code
through. This function is then replaced by the actual docsystem once
that is available. For testing, I wanted to build the whole system
image without the doc system using this boostrap definition. However,
this turns out not to be possible, because there's a few doc syntax
semantics that do not actually just ignore the doc string.

In particular:
```
"""
I am a doc for a particular signature
"""
foo(x::Int, y::Float64)
```

Does not acutally result in a call to `foo`.

And similarly

```
"""
I am a doc for a global binding
"""
MyModule.foo
```

Does not require `MyModule.foo` to actually have a value, since
it only documents the binding.

This PR allows both of those cases in the boostrap version of
`atdoc` so that we can bootstrap without the doc system if we
wanted to.
Copy link
Member

@vtjnash vtjnash left a comment

Choose a reason for hiding this comment

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

I am a little bit hesitant to approve this, as I think there are other syntaxes that also change meaning slightly when the advanced doc parser is active. But it also probably doesn't hurt anyways that this is incomplete.

@Keno
Copy link
Member Author

Keno commented Mar 1, 2024

Yeah, I considered that, but it seems annoying to duplicate all that logic and this makes the system image build at least, which I think is a reasonable position to be in for now.

@Keno Keno merged commit 0918cf1 into master Mar 1, 2024
5 of 7 checks passed
@Keno Keno deleted the kf/docsbootstrap branch March 1, 2024 06:34
tecosaur pushed a commit to tecosaur/julia that referenced this pull request Mar 4, 2024
The earliest bootstrapping code has a definition of `atdoc` that is just
supposed to ignore the doc string and pass the defining code through.
This function is then replaced by the actual docsystem once that is
available. For testing, I wanted to build the whole system image without
the doc system using this boostrap definition. However, this turns out
not to be possible, because there's a few doc syntax semantics that do
not actually just ignore the doc string.

In particular:
```
"""
I am a doc for a particular signature
"""
foo(x::Int, y::Float64)
```

Does not acutally result in a call to `foo`.

And similarly

```
"""
I am a doc for a global binding
"""
MyModule.foo
```

Does not require `MyModule.foo` to actually have a value, since it only
documents the binding.

This PR allows both of those cases in the boostrap version of `atdoc` so
that we can bootstrap without the doc system if we wanted to.
mkitti pushed a commit to mkitti/julia that referenced this pull request Apr 13, 2024
The earliest bootstrapping code has a definition of `atdoc` that is just
supposed to ignore the doc string and pass the defining code through.
This function is then replaced by the actual docsystem once that is
available. For testing, I wanted to build the whole system image without
the doc system using this boostrap definition. However, this turns out
not to be possible, because there's a few doc syntax semantics that do
not actually just ignore the doc string.

In particular:
```
"""
I am a doc for a particular signature
"""
foo(x::Int, y::Float64)
```

Does not acutally result in a call to `foo`.

And similarly

```
"""
I am a doc for a global binding
"""
MyModule.foo
```

Does not require `MyModule.foo` to actually have a value, since it only
documents the binding.

This PR allows both of those cases in the boostrap version of `atdoc` so
that we can bootstrap without the doc system if we wanted to.
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