Skip to content

Fix iteration over dict in loading.jl#48608

Closed
gbaraldi wants to merge 1 commit intoJuliaLang:masterfrom
gbaraldi:fix-include
Closed

Fix iteration over dict in loading.jl#48608
gbaraldi wants to merge 1 commit intoJuliaLang:masterfrom
gbaraldi:fix-include

Conversation

@gbaraldi
Copy link
Copy Markdown
Member

@gbaraldi gbaraldi commented Feb 9, 2023

Should fix #48590, but I wasn't able to reproduce the original failure locally. So a working mwe for a test would be nice.
In the meanwhile, @anandijain could you check locally?

@gbaraldi gbaraldi requested a review from vtjnash February 9, 2023 18:33
Comment thread base/loading.jl
extids = pop!(EXT_DORMITORY, pkgid, nothing)
extids === nothing && return
for extid in extids
for extid in values(extids)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

extids is an Array, so calling values is unnecessary

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Forgot that pop changes dicts into arrays.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It doesn't? The values of that dict are vectors.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah , sorry :(. In any case do we have a way to check if a pkg is an extension at this time? To get back the pretty printing?

Comment thread base/loading.jl
Comment on lines +1023 to 1026
for extid in values(EXT_DORMITORY)
if extid.id == pkg
print(extid.parentid.name, " → ")
break
Copy link
Copy Markdown
Member

@vtjnash vtjnash Feb 9, 2023

Choose a reason for hiding this comment

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

This will not return true for any element, so it could be simply replaced here by:

Suggested change
for extid in values(EXT_DORMITORY)
if extid.id == pkg
print(extid.parentid.name, "")
break
if false; if false

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Yeah :(. This broke the time_imports pretty printing for extensions.

@KristofferC
Copy link
Copy Markdown
Member

Easier to fix this on top of #48586?

@gbaraldi
Copy link
Copy Markdown
Member Author

gbaraldi commented Feb 9, 2023

Is that the PR that delays the loading of the extensions? Though in any case if we ever decide to do that this kind of printing won't work anymore because it relies on loading the extension immediately after the main package

@gbaraldi gbaraldi closed this Feb 9, 2023
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.

@time_imports giving ERROR: type Pair has no field id on nightly

3 participants