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

Cygwin build can't see STDIN #15

Closed
muellerj opened this issue Aug 28, 2015 · 10 comments
Closed

Cygwin build can't see STDIN #15

muellerj opened this issue Aug 28, 2015 · 10 comments

Comments

@muellerj
Copy link

The compile completes just fine, however when I call the resulting binary later, it doesn't see to get the input string I pass it via STDIN:

projects/heatseeker [3d|master*] cargo build --release
   Compiling libc v0.1.10
   Compiling unicode-width v0.1.3
   Compiling winapi v0.2.2
   Compiling winapi-build v0.1.1
   Compiling num_cpus v0.2.6
   Compiling log v0.3.1
   Compiling kernel32-sys v0.1.4
   Compiling getopts v0.2.13
   Compiling time v0.1.32
   Compiling heatseeker v1.3.0 (file:///C:/Users/q284114/projects/heatseeker)
projects/heatseeker [3d|master*] cp target/release/hs.exe ~/bin
‘target/release/hs.exe’ -> ‘/cygdrive/c/Users/muellerj/bin/hs.exe’
projects/heatseeker [3d|master*] which hs
/cygdrive/c/Users/muellerj/bin/hs
projects/heatseeker [3d|master*] echo "foo\nbar\baz" | hs

  [ Here, nothing is displayed, I eventually kill it with ^C ]

projects/heatseeker [3d|master*] hs --help
Usage: C:\Users\muellerj\bin\hs.exe [options]

Options:
    -h, --help          Show this message
    -v, --version       Show version
    -s, --search [SEARCH]
                        Specify an initial search string
    -f, --first         Automatically select the first match
    -F, --full-screen   Use the entire screen in order to display as many
                        choices as possible
@muellerj
Copy link
Author

If you need details about the Cygwin environment, please let me know!

@rschmitt
Copy link
Owner

What's the output of --version?

@muellerj
Copy link
Author

I'll be back at the Windows workstation on Monday to check. The build output says 1.3.0?

@rschmitt
Copy link
Owner

I'm more interested in the target triple.

@muellerj
Copy link
Author

Sure! This is what I get:

~ [7d|master] ~/bin/hs --version
heatseeker 1.3.0 single-threaded (baa2351) (built 2015-08-28 10:59:36 +0100 for x86_64-pc-windows-gnu)

@rschmitt
Copy link
Owner

I wouldn't expect that to work. That's the actual Windows executable, and it needs to talk directly to the Windows API to manipulate the screen. (That's how the Windows console works. It's not a character stream like POSIX terminals are.) You need to build hs for Cygwin.

@muellerj
Copy link
Author

Sorry if this is a silly question, but how would I tell cargo build to do so?

@rschmitt
Copy link
Owner

I'm not sure. I think you'd have to build your own rustc within Cygwin, or
find a binary that somebody else built.

On Mon, Aug 31, 2015 at 12:03 PM, Jonas Müller notifications@github.com
wrote:

Sorry if this is a silly question, but how would I tell cargo build to do
so?


Reply to this email directly or view it on GitHub
#15 (comment).

@rschmitt
Copy link
Owner

It's a long shot, but have you tried just using the musl linux build within
Cygwin?

On Mon, Aug 31, 2015 at 12:20 PM, Ryan Schmitt rschmitt@pobox.com wrote:

I'm not sure. I think you'd have to build your own rustc within Cygwin, or
find a binary that somebody else built.

On Mon, Aug 31, 2015 at 12:03 PM, Jonas Müller notifications@github.com
wrote:

Sorry if this is a silly question, but how would I tell cargo build to
do so?


Reply to this email directly or view it on GitHub
#15 (comment)
.

@muellerj
Copy link
Author

muellerj commented Sep 1, 2015

I have not, but I see how that's a problem concerning rust under Cygwin. The official docs say Cygwin ist not officially supported:

0.3 Does it run on Windows?
Yes. All development happens in lockstep on all 3 target platforms (using MinGW, not Cygwin).

(from https://doc.rust-lang.org/complement-lang-faq.html)

I'll try around some more and keep this issue up-to-date if I find something, but close this issue for now.

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

No branches or pull requests

2 participants