Giter Site home page Giter Site logo

Getting WARN -- : posix_spawn is not yet supported on x86_64-cygwin (x86_64-cygwin), falling back to default implementation. about seeing_is_believing HOT 4 CLOSED

bolandross avatar bolandross commented on August 25, 2024
Getting WARN -- : posix_spawn is not yet supported on x86_64-cygwin (x86_64-cygwin), falling back to default implementation.

from seeing_is_believing.

Comments (4)

JoshCheek avatar JoshCheek commented on August 25, 2024 1

There's not :(

I opened an issue on ChildProcess: enkessler/childprocess#176

Locally I did this, which worked for me:
image

I'm not sure what to do in the long-run. I think, ideally I would be able to use Ruby's builtin spawn method, but I'm not sure it can handle all the things I need from it (I haven't looked into it recently). This is how I'm currently using it:

child = ChildProcess.build(*popen_args)
child.cwd = file_directory if local_cwd
child.leader = true
child.duplex = true
child.environment.merge!(env)
child.io.stdout = child_stdout
child.io.stderr = child_stderr
child.start
# close child streams b/c they won't emit EOF if parent still has an open reference
close_streams(child_stdout, child_stderr)
child.io.stdin.binmode
child.io.stdin.sync = true
# Start receiving events from the child
eventstream = event_server.accept
# send stdin (char at a time b/c input could come from a stream)
Thread.new do
begin
provided_input.each_char { |char| child.io.stdin.write char }
rescue
# don't explode if child closes IO
ensure
child.io.stdin.close
end
end
# set up the event consumer
consumer = EventStream::Consumer.new(events: eventstream, stdout: stdout, stderr: stderr)
consumer_thread = Thread.new do
consumer.each do |e|
swap_files.show_user_program if e.is_a? SeeingIsBelieving::EventStream::Events::FileLoaded
event_handler.call e
end
end
# wait for completion
if timeout_seconds == 0
child.wait
else
child.poll_for_exit(timeout_seconds)
end
consumer.process_exitstatus(child.exit_code)
consumer_thread.join
rescue ChildProcess::TimeoutError
consumer.process_timeout(timeout_seconds)
child.stop
consumer_thread.join
ensure
# On Windows, we need to call stop if there is an error since it interrupted
# the previos waiting/polling. If we don't call stop, in that situation, it will
# leave orphan processes. On Unix, we need to always call stop or it may leave orphans
begin
if ChildProcess.unix?
child.stop
elsif $!
child.stop
consumer.process_exitstatus(child.exit_code)
end
child.alive? && child.stop
rescue ChildProcess::Error
# On AppVeyor, I keep getting errors
# The handle is invalid: https://ci.appveyor.com/project/JoshCheek/seeing-is-believing/build/22
# Access is denied: https://ci.appveyor.com/project/JoshCheek/seeing-is-believing/build/24
end
close_streams(stdout, stderr, eventstream, event_server)
end

These are the tests it would need to pass:
image

from seeing_is_believing.

bolandross avatar bolandross commented on August 25, 2024 1

Hey and thanks for getting back to this.

Since I am using seeing_is_believing as a vim-plugin (and additionally not being very experienced with any of these involved components) I took a crowbar approach and removed the warning line from the childprocess source file in the gems directory 😅 as soon as I'll have a bit more time to spare, I'll try some more experimenting for a more elegant solution.

from seeing_is_believing.

JoshCheek avatar JoshCheek commented on August 25, 2024

I was thinking about this some more, and my answer above may have not been exactly what you were asking. If all you want to do is to suppress warning, then you can probably do this:

ruby -W0 -S seeing_is_believing ...

🤔 that could be difficult though, if you're using an editor integration, because it may not give you the ability to configure that. Maybe instead use the RUBYOPT env var, set it to -W0 and then Ruby should turn warnings off when running SiB.

image

from seeing_is_believing.

JoshCheek avatar JoshCheek commented on August 25, 2024

This isn't released yet, but I've locally got it working... except for on Windows 😅 Hoping to release it soon, though.

from seeing_is_believing.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.