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

Make Revise an optional dependency #731

Open
schlichtanders opened this issue Feb 7, 2025 · 5 comments
Open

Make Revise an optional dependency #731

schlichtanders opened this issue Feb 7, 2025 · 5 comments

Comments

@schlichtanders
Copy link

Hi there, I tried to packagecompile a GenieApp which simply fails because Revise cannot be packagecompiled.

It would also be nice in general to don't have Revise in a packagecompiled code, but this bug makes it crucial not to rely on Revise so that packagecompilation works at all.

Optional dependencies in Julia would go via PackageExtensions.
Donwside is that users would need to install Revise next to Genie, but packagecompilation is a big thing for production use, so I think this is worth it.

@essenciary
Copy link
Member

@schlichtanders Thanks!
@hhaensel what's your take?
Can't we use it based on env? Revise is disabled in prod, though probably we need to add some logic around includet / include, depending on env. This way it would be bundled in dev (as it should) and not used in prod. Can we have it as a development dependency? Does latest Pkg allow this yet?

@hhaensel
Copy link
Member

hhaensel commented Feb 8, 2025

I'm surprised to hear that Revise is not package compilable. Could you tell more exactly what your doing to obtain the error?

@hhaensel
Copy link
Member

hhaensel commented Feb 8, 2025

I have developed several apps that I use as Packages which are precompiled.

@hhaensel
Copy link
Member

Now on a computer and not on my mobile. Finally I understood the issue. Please ignore my previous comment.

@hhaensel
Copy link
Member

@schlichtanders Thanks! @hhaensel what's your take?

When I saw the first time that Revise is a mandatory dependency of Genie, I was really surprised.
While I love the hot reloading and debugging of Genie Apps, I am also afraid that it might be a security issue for apps in production.
From that point of view an optional dependency would be great.

On the other hand, if Revise had an On/Off-Switch that could be another way of reducing the security risk. However, the issue with the basebuilddir would still need to be solved.

I have several ideas how a fallback could look like

  • environment variable
  • deriving from BUILD_STDLIB_PATH, e.g. joinpath(splitpath(abspath(Sys.BUILD_STDLIB_PATH))[1:end-5]) (not sure if this is correct, though)
  • launch a julia instance replace(strip(read(`julia -E 'dirname(dirname(filter(x->endswith(x[2], "sysimg.jl"), Base._included_files)[1][2]))'`, String))[2:end-1], "\\\\" => "\\") maybe the current calling parameters would need to be retrieved and set.

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

No branches or pull requests

3 participants