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

Compatibility with PackageCompiler.jl #108

Closed
MichaelHatherly opened this issue May 20, 2021 · 5 comments
Closed

Compatibility with PackageCompiler.jl #108

MichaelHatherly opened this issue May 20, 2021 · 5 comments

Comments

@MichaelHatherly
Copy link
Contributor

Currently Dash.jl (and the related component packages) hardcode paths to resources into globals, see https://github.com/plotly/Dash.jl/blob/dev/src/Dash.jl#L5-L6 for example. This means that the package cannot be used along with https://github.com/JuliaLang/PackageCompiler.jl since that paths are not "relocatable" (https://julialang.github.io/PackageCompiler.jl/dev/devdocs/relocatable_part_3/#Relocatability-of-Julia-packages-1).

The two standard approaches to solving this issue are to either:

  • store the actual content of the files located in the resource folders directly into the module's globals, rather than just the paths to those resources, or
  • make use of the Artifacts system (https://pkgdocs.julialang.org/dev/artifacts/) to provide the resources in PackageCompiler-friendly paths.
@jackparmer
Copy link
Contributor

Would this allow Julia Dash apps to be compiled into desktop executables? Sounds pretty neat if so.

image

@MichaelHatherly
Copy link
Contributor Author

Yes, pretty much that. We have a workaround at the moment to force the resulting executables to be relocatable, but it's not something I'd like to keep around for too long 😆 I'm happy to look into it a bit more deeply when time allows, it'll likely require adjustments to the component generation code to avoid the hardcoding.

@waralex
Copy link
Collaborator

waralex commented Jun 21, 2021

Hi @MichaelHatherly! I wrote the PR #111 with the concept of solving this problem for the dash core. I would be grateful for your feedback and participation in its discussion. If this concept is accepted, then we can do something similar with the components

@etpinard
Copy link
Collaborator

Hi, @Felix-Gauthier and I recently made dash-textarea-autocomplete work in PackageCompiler compiled apps.

In etpinard/dash-textarea-autocomplete#26, I wrote down some info on how we made things work and some thoughts on how to potentially improve the dash-generate-components command and/or dash-component-boilerplate.

Cheers! (this will be my last PackageCompiler-related comment 😏 )

@etpinard
Copy link
Collaborator

#131 essentially resolves this issue. Closing

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

4 participants