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

Error with relocatability #54

Open
guilhermebodin opened this issue Jan 29, 2025 · 1 comment
Open

Error with relocatability #54

guilhermebodin opened this issue Jan 29, 2025 · 1 comment

Comments

@guilhermebodin
Copy link

Hello,

we have embedded PlotlyLight into a compiled Julia application but it is facing some weird relocatability issues.

SystemError: opening file "/root/.julia/artifacts/aa67a2d0c294419c5568a236d0fdf8de18af2bd6/templates/plotly_white.json": No such file or directory
Stacktrace:
  [1] systemerror(?::String, ?::Int32; ?::Nothing)
    @ Base ./<missing>:0
  [2] open(?::String; ?::Bool, ?::Nothing, ?::Nothing, ?::Nothing, ?::Nothing, ?::Nothing)
    @ Base ./<missing>:0
  [3] open(?::Base.var"#470#471"{Tuple{}}, ?::String; ?::@Kwargs{})
    @ Base ./<missing>:0
  [4] template!(?::String)
    @ PlotlyLight ~/.julia/packages/PlotlyLight/DpYsf/src/PlotlyLight.jl:168
  [5] _set_plot_defaults
    @ /model_build/IARA.jl/src/plots/plots.jl:105 [inlined]
  [6] initialize
    @ /model_build/IARA.jl/src/IARA.jl:44 [inlined]
  [7] main(?::IARA.Args)
    @ IARA.InterfaceCalls /model_build/IARA.jl/src/interface_calls/main.jl:23
  [8] main
    @ /model_build/IARA.jl/src/interface_calls/main.jl:18 [inlined]
  [9] julia_interface_call()
    @ IARA /model_build/IARA.jl/src/main.jl:59
 [10] top-level scope
    @ none:1root@3efb74253c79:/IARA#

The path /.root/.julia./... comes from the machine where the application was compiled.

Although through investigation it seems that everything is relocatable I am afraid that the definition of plotly::PlotlyArtifacts = PlotlyArtifacts() in the main file of the module gets compiled at that moment of compilation and gets saved in the system image.

Is it possible to check or modify this in runtime?

@joshday
Copy link
Member

joshday commented Jan 29, 2025

Ah, yeah that should be inside an __init__ function. A quick workaround is setting it yourself (untested):

PlotlyLight.plotly = PlotlyLight.PlotlyArtifacts(path="path/to/plotly.js")

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

2 participants