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

Errors on importing PlotlyJS after fresh install on nightly Julia #363

Closed
robsmith11 opened this issue Jan 26, 2021 · 8 comments
Closed

Comments

@robsmith11
Copy link

If I call import/using a second time, there is no error and I can use PlotlyJS fine.

(@v1.7) pkg> status
      Status `~/.julia/environments/v1.7/Project.toml`
  [f0f68f2c] PlotlyJS v0.14.0

julia> versioninfo()
Julia Version 1.7.0-DEV.383
Commit bf15b706e9* (2021-01-26 04:39 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: AMD Ryzen 7 4700U with Radeon Graphics
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, znver2)
ERROR: InitError: SystemError: opening file "/home/me/.julia/packages/PlotlyJS/m2Lzd/deps/build.log": No such file or directory
Stacktrace:
  [1] systemerror(p::String, errno::Int32; extrainfo::Nothing)
    @ Base ./error.jl:168
  [2] #systemerror#66
    @ ./error.jl:167 [inlined]
  [3] systemerror
    @ ./error.jl:167 [inlined]
  [4] open(fname::String; lock::Bool, read::Nothing, write::Nothing, create::Nothing, truncate::Nothing, append::Nothing)
    @ Base ./iostream.jl:293
  [5] open
    @ ./iostream.jl:282 [inlined]
  [6] open(f::Base.var"#354#355"{String}, args::String; kwargs::Base.Iterators.Pairs{Union{}, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ Base ./io.jl:328
  [7] open
    @ ./io.jl:328 [inlined]
  [8] read
    @ ./io.jl:435 [inlined]
  [9] __init__()
    @ PlotlyJS ~/.julia/packages/PlotlyJS/m2Lzd/src/PlotlyJS.jl:65
 [10] _include_from_serialized(path::String, depmods::Vector{Any})
    @ Base ./loading.jl:670
 [11] _require_search_from_serialized(pkg::Base.PkgId, sourcepath::String)
    @ Base ./loading.jl:756
 [12] _require(pkg::Base.PkgId)
    @ Base ./loading.jl:994
 [13] require(uuidkey::Base.PkgId)
    @ Base ./loading.jl:910
 [14] require(into::Module, mod::Symbol)
    @ Base ./loading.jl:897
during initialization of module PlotlyJS
@sglyon
Copy link
Member

sglyon commented Jan 26, 2021

Thanks @robsmith11

I'm not working on nightly right now, so I don't think I'll be able to contribute a fix.

That being said, I'm happy to review a PR if someone who does work on nightly is willing to tackle this one

@jkrimmer
Copy link
Contributor

jkrimmer commented Feb 7, 2021

I am encountering the same issue on 1.6.0-rc1. However, the generated plots are not displayed in the Blink window.
@robsmith11 Are you able to reproduce this issue on the nightly build as well?
Anyway, I will try to dig deeper to ensure compatibility with the new release as soon as possible :)

EDIT: Okay, I have found the culprit much sooner than expected. The __init__() function, which is executed each time we are using PlotlyJS, looks for a file called "build.log" in joinpath(_pkg_root, "deps", "build.log"). If this file cannot be found, the initialization fails. Apparently, the source directory of the PlotlyJS package is not writeable on julia 1.6.0-rc1 (Windows 10) and above due to some change in the permission handling. Hence, there exists no such "build.log" file in the deps-directory.

To my understanding, there is now the scratch spaces API which places files such as logfiles (which usually do not have to be accessed by the user with a file browser) in a a package-specific mutable directory.

@robsmith11
Copy link
Author

Thanks for looking into it more, @jonas-kr. I've always just exported the plot to a html file and viewed it in Firefox, so I've never tried using Blink, but it's likely broken here too.

@sglyon
Copy link
Member

sglyon commented Feb 8, 2021

@jonas-kr I don't know much about this scratch spaces api

Is this something you could help us integrate here?

@jkrimmer
Copy link
Contributor

jkrimmer commented Feb 9, 2021

Honestly, I do not know anything about this api, yet. However, I will try to look into this.

@ericphanson
Copy link

ericphanson commented Mar 14, 2021

It looks to me like this was fixed (or at least worked-around) in c4418cc, there just hasn't been a release since then

@jkrimmer
Copy link
Contributor

@ericphanson Thanks a lot for this hint, this commit does provide a workaround for the issue. Actually, building the package on an 1.6.0-rc3 build creates an (in my case empty) build.log file in a subdirectory of .julia/scratchspaces. Hence, it seems like the only thing that remains to be fixed is the path of this build.log file. I will try to resolve this issue asap.

@sglyon
Copy link
Member

sglyon commented Mar 17, 2021

I did just release a fresh version of plotlyJS in response to @ericphanson comment (thanks for the reminder!)

Hopefully things work on latest release of this package

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