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

Precompilation fails when STDOUT is an IOStream #12975

Closed
garrison opened this issue Sep 6, 2015 · 7 comments
Closed

Precompilation fails when STDOUT is an IOStream #12975

garrison opened this issue Sep 6, 2015 · 7 comments
Labels
compiler:precompilation Precompilation of modules io Involving the I/O subsystem: libuv, read, write, etc.
Milestone

Comments

@garrison
Copy link
Member

garrison commented Sep 6, 2015

Consider the following very simple test.jl:

@show typeof(STDOUT)
using Compat

If run such that STDOUT is a tty, the precompilation succeeds. However, if STDOUT is not a tty, it fails:

$ rm -f ~/.julia/lib/v0.4/Compat.ji
$ julia test.jl > /tmp/outfile
ERROR: LoadError: MethodError: `open` has no method matching open(::Cmd, ::ASCIIString, ::IOStream)
Closest candidates are:
  open(!Matched::Function, ::Any...)
  open(::Base.AbstractCmd, ::AbstractString)
  open(::Base.AbstractCmd, ::AbstractString, !Matched::Base.AsyncStream)
  ...
 in create_expr_cache at loading.jl:303
 in compilecache at loading.jl:349
 in require at ./loading.jl:217
 in include at ./boot.jl:260
 in include_from_node1 at ./loading.jl:271
 in process_options at ./client.jl:308
 in _start at ./client.jl:411
while loading /tmp/test.jl, in expression starting on line 5

Possibly (?) related: #12941

@tkelman tkelman added the compiler:precompilation Precompilation of modules label Sep 6, 2015
@vtjnash
Copy link
Member

vtjnash commented Sep 6, 2015

fixed by #12839

@JeffBezanson JeffBezanson added the io Involving the I/O subsystem: libuv, read, write, etc. label Sep 7, 2015
@garrison garrison changed the title create_expr_cache fails when STDOUT is not a tty Precompilation fails when STDOUT is not a tty Sep 11, 2015
@garrison garrison changed the title Precompilation fails when STDOUT is not a tty Precompilation fails when STDOUT is an IOStream Sep 12, 2015
@garrison
Copy link
Member Author

One annoying thing about this bug is that you can establish a workflow that seems to work reliably, but fails as soon as you run Pkg.update() and things need to be re-precompiled. This could be an unwelcome surprise to anyone using julia in production (if their workflow involves directing stdout to a file) if this is not fixed before 0.4 final.

(In other words, if #12839 is not going to make it into release-0.4, I think some fix should.)

@garrison
Copy link
Member Author

I'm going to add this to the 0.4.0 milestone because it is a regression in behavior from 0.3. Feel free to move to a later milestone if you don't think this bug should hold up the release.

@garrison garrison added this to the 0.4.0 milestone Sep 27, 2015
@garrison
Copy link
Member Author

To be clear, this issue is fixed on master with #12839. The remaining question is how to backport a fix for 0.4. Since #12839 no longer renames AsyncStream, is it possible/nonbreaking to do a straightforward backport to 0.4?

@tkelman
Copy link
Contributor

tkelman commented Sep 27, 2015

I'll try putting it on a backport branch (probably after rc3 to avoid pushing that back any further) and evaluate whether it breaks anything via pkgeval

@garrison
Copy link
Member Author

Sounds like a great plan. Thanks @tkelman!

@garrison
Copy link
Member Author

garrison commented Oct 4, 2015

Fixed in v0.4.0-rc4.

@garrison garrison closed this as completed Oct 4, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
compiler:precompilation Precompilation of modules io Involving the I/O subsystem: libuv, read, write, etc.
Projects
None yet
Development

No branches or pull requests

4 participants