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 while analysing SeisProcessing #89

Open
giordano opened this issue Jul 23, 2023 · 4 comments
Open

Error while analysing SeisProcessing #89

giordano opened this issue Jul 23, 2023 · 4 comments
Labels
bug Something isn't working

Comments

@giordano
Copy link
Member

julia> analyze("SeisProcessing")
ERROR: SystemError: opening file "/var/folders/v2/hmy3kzgj4tb3xsy8qkltxd0r0000gn/T/jl_OD2NBs/SeisProcessing/kmGog/src/Processing/.#SeisGain.jl": No such file or directory
Stacktrace:
  [1] systemerror(p::String, errno::Int32; extrainfo::Nothing)
    @ Base ./error.jl:176
  [2] systemerror(p::String, b::Bool; extrainfo::Nothing)
    @ Base ./error.jl:175 [inlined]
  [3] open(fname::String; lock::Bool, read::Nothing, write::Nothing, create::Nothing, truncate::Nothing, append::Nothing)
    @ Base ./iostream.jl:293
  [4] open(fname::String)
    @ Base ./iostream.jl:275 [inlined]
  [5] open(f::Base.var"#434#435"{String}, args::String; kwargs::@Kwargs{})
    @ Base ./io.jl:394
  [6] open(f::Base.var"#434#435"{String}, args::String)
    @ Base ./io.jl:393 [inlined]
  [7] read(filename::String, ::Type{String})
    @ Base ./io.jl:486 [inlined]
  [8] parse_green_node(file_path::String)
    @ PackageAnalyzer ~/.julia/packages/PackageAnalyzer/ku4CT/src/count_loc.jl:102
  [9] count_julia_lines_of_code(dir::String)
    @ PackageAnalyzer ~/.julia/packages/PackageAnalyzer/ku4CT/src/count_loc.jl:146
 [10] count_lines_of_code(dir::String)
    @ PackageAnalyzer ~/.julia/packages/PackageAnalyzer/ku4CT/src/count_loc.jl:16
 [11] analyze_code(dir::String; repo::String, reachable::Bool, subdir::String, auth::GitHub.OAuth2, sleep::Int64, only_subdir::Bool, version::VersionNumber)
    @ PackageAnalyzer ~/.julia/packages/PackageAnalyzer/ku4CT/src/analyze.jl:263
 [12] kwcall(::NamedTuple, ::typeof(PackageAnalyzer.analyze_code), dir::AbstractString)
    @ PackageAnalyzer ~/.julia/packages/PackageAnalyzer/ku4CT/src/analyze.jl:221 [inlined]
 [13] analyze(pkg::PackageAnalyzer.Release; root::String, auth::GitHub.OAuth2, sleep::Int64)
    @ PackageAnalyzer ~/.julia/packages/PackageAnalyzer/ku4CT/src/analyze.jl:163
 [14] analyze
    @ PackageAnalyzer ~/.julia/packages/PackageAnalyzer/ku4CT/src/analyze.jl:155 [inlined]
 [15] analyze(name_or_dir_or_url::String; registries::Vector{RegistryInstances.RegistryInstance}, auth::GitHub.OAuth2, sleep::Int64, version::Nothing, root::String, subdir::String)
    @ PackageAnalyzer ~/.julia/packages/PackageAnalyzer/ku4CT/src/analyze.jl:67
 [16] analyze(name_or_dir_or_url::String)
    @ PackageAnalyzer ~/.julia/packages/PackageAnalyzer/ku4CT/src/analyze.jl:58
 [17] top-level scope
    @ REPL[3]:1

Not sure what's the problem: https://github.com/SeismicJulia/SeisProcessing.jl

@giordano
Copy link
Member Author

Ah, the problem is this broken symlink: https://github.com/SeismicJulia/SeisProcessing.jl/blob/fd47fe606a22de97e2a76bd3722f61edb5a57ac8/src/Processing/.%23SeisGain.jl

We should probably check that a file exist before attempting to read it?

@giordano giordano added the bug Something isn't working label Jul 23, 2023
@giordano giordano changed the title Error while parsing SeisProcessing Error while analysing SeisProcessing Jul 23, 2023
@ericphanson
Copy link
Member

We get the paths from readdir, I didn’t realize those might not be actual files. Should be easy to fix, is isfile the right check?

@giordano
Copy link
Member Author

No, I think it's ispath. isfile returns whether the argument is a regular file, which a symlink never is.

@ericphanson
Copy link
Member

I guess they could have a directory named dir.jl and I shouldn’t read that? So maybe ispath(p) && !isdir(p) ?

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

2 participants