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

Fix iteration over dict in loading.jl #48608

Closed
wants to merge 1 commit into from

Conversation

gbaraldi
Copy link
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
@@ -1200,7 +1200,7 @@ function run_extension_callbacks(pkgid::PkgId)
# take ownership of extids that depend on this pkgid
extids = pop!(EXT_DORMITORY, pkgid, nothing)
extids === nothing && return
for extid in extids
for extid in values(extids)
Copy link
Sponsor 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
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
Sponsor 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
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 on lines +1023 to 1026
for extid in values(EXT_DORMITORY)
if extid.id == pkg
print(extid.parentid.name, " → ")
break
Copy link
Sponsor 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
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
Sponsor Member

Easier to fix this on top of #48586?

@gbaraldi
Copy link
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