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

Windows: Long package silently not opened in browser #46

Open
tfiers opened this issue Jan 2, 2023 · 11 comments
Open

Windows: Long package silently not opened in browser #46

tfiers opened this issue Jan 2, 2023 · 11 comments
Labels
bug Something isn't working
Milestone

Comments

@tfiers
Copy link
Owner

tfiers commented Jan 2, 2023

depgraph_web(:Plots), eg

url(:Plots,) shows that truncated..

@tfiers tfiers added the bug Something isn't working label Jan 2, 2023
@tfiers
Copy link
Owner Author

tfiers commented Jan 2, 2023

  • figure out threshold (or some reasonable 'lower bound')
  • copy to clipboard instead

@tfiers
Copy link
Owner Author

tfiers commented Jan 28, 2023

another one: depgraph_web(:OrdinaryDiffEq)

@tfiers
Copy link
Owner Author

tfiers commented Jan 28, 2023

Also, that takes a long time, #TTFX.
So let's go to

@tfiers tfiers added this to the v1 milestone Jan 28, 2023
@tfiers
Copy link
Owner Author

tfiers commented Jan 28, 2023

(Actually, OrdinarryDiffEq takes longer to crawl than Plots)

Ok this works:

julia> link=PkgGraph.url(PkgGraph.depgraph_as_dotstr(:OrdinaryDiffEq));
julia> run(pipeline(`echo $link`, `clip.exe`))

(and then pasting in browser)
(btw, that is not a useful viz. link)

@tfiers
Copy link
Owner Author

tfiers commented Jan 28, 2023

(it's not better w/ jll and stdlib filtered out! (link))

@tfiers
Copy link
Owner Author

tfiers commented Jan 28, 2023

aha, interesting:
with our deved DefaultApp
(

)

julia> DefaultApplication.open(link)
ERROR: IOError: stat("https://drea [...] Diff%0A%7D%0A"): name too long (ENAMETOOLONG)
Stacktrace:
 [1] uv_error
   @ ./libuv.jl:100 [inlined]
 [2] stat(path::String)
   @ Base.Filesystem ./stat.jl:152
 [3] ispath
   @ ./stat.jl:461 [inlined]
 [4] #open#1
   @ ~/.julia/dev/DefaultApplication/src/DefaultApplication.jl:27 [inlined]
 [5] open(filename::String)
   @ DefaultApplication ~/.julia/dev/DefaultApplication/src/DefaultApplication.jl:18
 [6] top-level scope
   @ REPL[5]:1

@tfiers
Copy link
Owner Author

tfiers commented Jan 28, 2023

aha, but it works on WSL:

julia> ope(path) = run(`powershell.exe -NoProfile -NonInteractive -Command start \"$(path)\"`);
julia> ope(link);

(works)

So. Is it on windows only this bug?

(wow. crazy long on Windows, #windows IO is slower than linux:
image

compare w/ asciinema rec here:

ok that was :Plots, but still.
I remember ODE on WSL being ~14 seconds, not two minutes
)

but ok, yes, it is a windows only thing:

julia> PkgGraph.depgraph_web(:OrdinaryDiffEq)
[ Info: Package "OrdinaryDiffEq" not found in active project. Using General registry
✓ Crawling registry      Time: 0:01:58
ERROR: IOError: could not spawn `'C:\WINDOWS\system32\cmd.exe' /c start 'https://dreampuf.github.io/GraphvizOnline/#digraph%20%7B%0A%20%20%20%20bgcolor%20%3D%20%22transparent%22%0A%20%20%20%20node%20%5Bfontcolor%3D%22black
[ .. ]
%20%20%20%20Logging%20%5Bfontcolor%3Dgray%5D%0A%20%20%20%20Mmap%20%5Bfontcolor%3Dgray%5D%0A%7D%0A'`: name too long (ENAMETOOLONG)
Stacktrace:
  [1] _spawn_primitive(file::String, cmd::Cmd, stdio::Vector{Union{RawFD, Base.Libc.WindowsRawSocket, IO}})
    @ Base .\process.jl:128
  [2] #760
    @ .\process.jl:139 [inlined]
  [3] setup_stdios(f::Base.var"#760#761"{Cmd}, stdios::Vector{Union{RawFD, Base.Libc.WindowsRawSocket, IO}})
    @ Base .\process.jl:223
  [4] _spawn
    @ .\process.jl:138 [inlined]
  [5] run(::Cmd; wait::Bool)
    @ Base .\process.jl:483
  [6] #open#1
    @ C:\Users\tfiers\.julia\packages\DefaultApplication\7wyMn\src\DefaultApplication.jl:33 [inlined]
  [7] open
    @ C:\Users\tfiers\.julia\packages\DefaultApplication\7wyMn\src\DefaultApplication.jl:18 [inlined]
  [8] depgraph_web(pkgname::Symbol, base_url::String; dryrun::Bool, kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
    @ PkgGraph C:\Users\tfiers\.julia\dev\PkgGraph\src\includes\enduser.jl:14
  [9] depgraph_web
    @ C:\Users\tfiers\.julia\dev\PkgGraph\src\includes\enduser.jl:10 [inlined]
 [10] depgraph_web(pkgname::Symbol)
    @ PkgGraph C:\Users\tfiers\.julia\dev\PkgGraph\src\includes\enduser.jl:10
 [11] top-level scope
    @ REPL[3]:1

@tfiers
Copy link
Owner Author

tfiers commented Jan 28, 2023

(could also be the case on mac, dunno)
Can I run(explorer) on it directly? Does that work w/ urls?
(or, run run(cmd.exe /c start …))
nope:

julia> run(`explorer.exe $link`)
ERROR: IOError: could not spawn `explorer.exe 'https://dreampuf.github
[..]
%3Dgray%5D%0A%20%20%20%20Logging%20%5Bfontcolor%3Dgray%5D%0A%20%20%20%20Mmap%20%5Bfontcolor%3Dgray%5D%0A%7D%0A'`: name too long (ENAMETOOLONG)
Stacktrace:
 [1] _spawn_primitive(file::String, cmd::Cmd, stdio::Vector{Union{RawFD, Base.Libc.WindowsRawSocket, IO}})
   @ Base .\process.jl:128
 [2] #760
   @ .\process.jl:139 [inlined]
 [3] setup_stdios(f::Base.var"#760#761"{Cmd}, stdios::Vector{Union{RawFD, Base.Libc.WindowsRawSocket, IO}})
   @ Base .\process.jl:223
 [4] _spawn
   @ .\process.jl:138 [inlined]
 [5] run(::Cmd; wait::Bool)
   @ Base .\process.jl:479
 [6] run(::Cmd)
   @ Base .\process.jl:477
 [7] top-level scope
   @ REPL[8]:1

@tfiers
Copy link
Owner Author

tfiers commented Jan 28, 2023

So, we know thr: https://learn.microsoft.com/en-us/troubleshoot/windows-client/shell-experience/command-line-string-limitation

"#how-to-work-around-the-limitation": write to tmp file, then pipe through. ok sure (could be a defaultapp pr)

hah, maybe PowerShell doesn't have this?

ah no,

julia> run(`powershell.exe -NoProfile -NonInteractive -Command start $link`)

gives same error (IOError: could not spawn .. : name too long (ENAMETOOLONG))

@tfiers tfiers changed the title Long package silently not opened in browser Windows: Long package silently not opened in browser Jan 28, 2023
@tfiers
Copy link
Owner Author

tfiers commented Jan 28, 2023

Current status: will be fixed once

is merged and released

@tfiers
Copy link
Owner Author

tfiers commented Sep 5, 2023

Should be released and thus fixed: https://github.com/tpapp/DefaultApplication.jl/commits/master
Might need a lower bound on this dep version. And to check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant