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

Pipeline log files permission issues #88

Closed
AnHeuermann opened this issue Aug 24, 2023 · 1 comment · Fixed by #94
Closed

Pipeline log files permission issues #88

AnHeuermann opened this issue Aug 24, 2023 · 1 comment · Fixed by #94

Comments

@AnHeuermann
Copy link
Member

Issue Description

OMJulia starts an omc process that writes to stdout.log and stderr.log. When an additional process starts or the previous OMJulia session wasn't closed correctly I have to restart Julia to close and remove these files.

                withenv("OPENMODELICAHOME" => omhome) do
                    this.omcprocess = open(pipeline(`$ompath $args2 $args3$args4`, stdout="stdout.log", stderr="stderr.log"))
                end

Suggested Changes

Write to unique IO streams in memory for each OMJulia session.
IOBuffer is breaking on Windows and isn't save to use, see JuliaLang/julia#39311.
Using undocumented Base.BufferStream() seems to work, though:

  out = Base.BufferStream()
  err = Base.BufferStream()
  try
      withenv("OPENMODELICAHOME" => omhome) do
          this.omcprocess = open(pipeline(`$ompath $args2 $args3$args4`, stdout=out, stderr=err))
      end
    # stdout = read(out, String)
  catch e
    println(read(err, String))
    rethrow(e)
  finally
    close(out)
    close(err)
  end

Versions 'n stuff

  • OpenModelica: v1.22.0-dev-285-gf718aa4020-cmake
  • OS: Windows 11
  • Julia v1.9.2
@AnHeuermann
Copy link
Member Author

I tried to use Base.BufferStream() but it seems to get stuck on read(outStream, String). Maybe because the omc process isn't stopped at this point.
Maybe related to JuliaLang/julia#46869

I'll just remove the logging. I added it for debugging purpose, but if this breaks the Windows version of OMJulia there is no point in debugging it anyway.

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

Successfully merging a pull request may close this issue.

1 participant