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 packages to hook into code loading #26469

Closed
wants to merge 1 commit into from

Conversation

KristofferC
Copy link
Member

This is so e.g. Pkg3 can install packages on demand:

mar-15-2018 12-38-10

@ararslan ararslan added the packages Package management and loading label Mar 15, 2018
@fredrikekre
Copy link
Member

Notes from Pkg triage:

Prompting for package additionTop-level X:

  • happens when doing import X at top-level if X is not in load path
  • “Add package X?”
  • add X
  • resolve (implicit)Dev’d non-top-level package:
  • happens when Y does import X without Y in its deps
  • “Add package X to project Y?”
  • activate Y
  • add X
  • deactivate
  • resolve (edited)
    both cases need to have a package called X
    if there’s two packages called X they both need to ask which one you want

@DilumAluthge
Copy link
Member

This is only for the REPL, right? Presumably, if you are running a script, then using Foo should still throw an error if the package Foo is not found.

@Keno
Copy link
Member

Keno commented Mar 10, 2020

I think a better implementation of this would be to throw a special error type that the REPL intercepts. That way the REPL (and any other frontend offering code evaluation) can be in charge of presenting the UI without needing to inject callbacks in the core loading code.

@IanButterworth
Copy link
Member

I've given @Keno's suggestion a go over here #39026

@oxinabox
Copy link
Contributor

Can this now be closed?

@vchuravy vchuravy closed this Jul 14, 2021
@oscardssmith oscardssmith deleted the kc/code_loading_hook branch July 14, 2021 22:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packages Package management and loading
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants