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

Compiling on Win 7 (32 bit) fails #14

Open
dgollub opened this issue Jun 1, 2015 · 1 comment
Open

Compiling on Win 7 (32 bit) fails #14

dgollub opened this issue Jun 1, 2015 · 1 comment

Comments

@dgollub
Copy link
Contributor

dgollub commented Jun 1, 2015

Hi,

I am trying to compile promptoglyph on Win 7 (32 bit) with this D compiler version:

dkg@x60s-dkg:~/whome/Projekte/oss/promptoglyph$ dmd --version
DMD32 D Compiler v2.067.1

And this is the result:

dkg@x60s-dkg:~/whome/Projekte/oss/promptoglyph$ make clean
rm -rf build promptoglyph.tar.gz
dkg@x60s-dkg:~/whome/Projekte/oss/promptoglyph$ make
dmd -wi -g -debug -ofbuild/promptoglyph-path promptoglyph-path.d help.d
dmd -wi -g -debug -ofbuild/promptoglyph-vcs promptoglyph-vcs.d help.d vcs.d time.d color.d git.d
git.d(95): Error: undefined identifier 'fileno'
git.d(98): Error: undefined identifier pollfd
git.d(108): Error: undefined identifier poll, did you mean function kill?
git.d(111): Error: undefined identifier POLLIN
git.d(44): Error: function git.asyncGetFlags no return exp; or assert(0); at end of function
Makefile:26: the rule for target „build/promptoglyph-vcs“ failed (### I translated this from the German error message I got)
make: *** [build/promptoglyph-vcs] Fehler 1 (error 1)

dkg@x60s-dkg:~/whome/Projekte/oss/promptoglyph$ git rev-parse HEAD
581feccf948f70c7607d09ef19ed67af2bfbca84

I have not checked the source yet, because I have no time right now. As soon as I have some more time I will have a closer look, but no promises :-)

@mrkline
Copy link
Owner

mrkline commented Jun 1, 2015

The issue is that I'm using Posix poll to allow the prompt to exit early if git status blocks for longer than we want. From the code:

// Currently we can only do this for Unix.
// Windows async pipe I/O (they call it "overlapped" I/O)
// is more... involved.
// TODO: Either write a Windows implementation or suck it up
//       and do things synchronously in Windows.

On Posix, I can just poll a file descriptor, but continue using the D standard library for everything else. On Windows the situation is a bit more complicated. I have to use the Windows API for reading the file instead of the D standard library (since the needed OVERLAPPED struct gets passed into their ReadFile call). I'd certainly like to support Windows. It's just something I didn't get around to yet since I spend most of my time (whenever I'm not gaming) on Linux.

dgollub added a commit to dgollub/promptd that referenced this issue Mar 7, 2016
This commit adds custom build.bat for Windows and changes the code
so that it can be compiled on Windows.

The resulting exe files run without issues in Powershell, cmd.exe
and Cygwin.

The code is not the cleanest and could be improved and there are
also a few Notes and Todos throughout it that could be addressed
in the future.

For now the big breakthrough is that "it compiles" on Windows.
dgollub added a commit to dgollub/promptd that referenced this issue Mar 7, 2016
This commit adds custom build.bat for Windows and changes the code
so that it can be compiled on Windows.

The resulting exe files run without issues in Powershell, cmd.exe
and Cygwin.

The code is not the cleanest and could be improved and there are
also a few Notes and Todos throughout it that could be addressed
in the future.

For now the big breakthrough is that "it compiles" on Windows.
dgollub added a commit to dgollub/promptd that referenced this issue Mar 7, 2016
This commit adds custom build.bat for Windows and changes the code
so that it can be compiled on Windows.

The resulting exe files run without issues in Powershell, cmd.exe
and Cygwin.

The code is not the cleanest and could be improved and there are
also a few Notes and Todos throughout it that could be addressed
in the future.

For now the big breakthrough is that "it compiles" on Windows.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants