Created
May 5, 2015 10:10
-
-
Save garbas/48926cc07f0fc84291ff to your computer and use it in GitHub Desktop.
building nix-1.9 on cygwin 64
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GrayWorm@Missandei ~/nix-1.9pre4103_1f795f9 | |
$ make | |
CXX src/nix-hash/nix-hash.o | |
CXX src/libmain/shared.o | |
CXX src/libstore/build.o | |
CXX src/libstore/derivations.o | |
CXX src/libstore/gc.o | |
CXX src/libstore/globals.o | |
CXX src/libstore/local-store.o | |
CXX src/libstore/misc.o | |
CXX src/libstore/optimise-store.o | |
CXX src/libstore/pathlocks.o | |
CXX src/libstore/references.o | |
CXX src/libstore/remote-store.o | |
CXX src/libstore/store-api.o | |
CXX src/libutil/affinity.o | |
CXX src/libutil/archive.o | |
CXX src/libutil/hash.o | |
CXX src/libutil/serialise.o | |
CXX src/libutil/util.o | |
In file included from /usr/lib/gcc/x86_64-pc-cygwin/4.9.2/include/c++/cstdio:42:0, | |
from src/libutil/util.hh:12, | |
from src/libutil/util.cc:3: | |
src/libutil/util.cc: In function ‘std::string nix::runProgram(nix::Path, bool, const Strings&, const string&)’: | |
src/libutil/util.cc:945:10: error: no matching function for call to ‘nix::Pipe::Pipe(__FILE*&)’ | |
Pipe stdout, stdin; | |
^ | |
src/libutil/util.cc:945:10: note: candidates are: | |
In file included from src/libutil/util.cc:3:0: | |
src/libutil/util.hh:230:7: note: nix::Pipe::Pipe() | |
class Pipe | |
^ | |
src/libutil/util.hh:230:7: note: candidate expects 0 arguments, 1 provided | |
src/libutil/util.hh:230:7: note: nix::Pipe::Pipe(const nix::Pipe&) | |
src/libutil/util.hh:230:7: note: no known conversion for argument 1 from ‘__FILE* {aka __sFILE64*}’ to ‘const nix::Pipe&’ | |
src/libutil/util.hh:230:7: note: nix::Pipe::Pipe(nix::Pipe&&) | |
src/libutil/util.hh:230:7: note: no known conversion for argument 1 from ‘__FILE* {aka __sFILE64*}’ to ‘nix::Pipe&&’ | |
src/libutil/util.cc:946:12: error: request for member ‘create’ in ‘__getreent()->_reent::_stdout’, which is of pointer type ‘__FILE* {aka __sFILE64*}’ (maybe you meant to use ‘->’ ?) | |
stdout.create(); | |
^ | |
src/libutil/util.cc:947:31: error: request for member ‘create’ in ‘__getreent()->_reent::_stdin’, which is of pointer type ‘__FILE* {aka __sFILE64*}’ (maybe you meant to use ‘->’ ?) | |
if (!input.empty()) stdin.create(); | |
^ | |
src/libutil/util.cc: In lambda function: | |
src/libutil/util.cc:951:25: error: request for member ‘writeSide’ in ‘__getreent()->_reent::_stdout’, which is of pointer type ‘__FILE* {aka __sFILE64*}’ (maybe you meant to use ‘->’ ?) | |
if (dup2(stdout.writeSide, STDOUT_FILENO) == -1) | |
^ | |
src/libutil/util.cc:954:28: error: request for member ‘readSide’ in ‘__getreent()->_reent::_stdin’, which is of pointer type ‘__FILE* {aka __sFILE64*}’ (maybe you meant to use ‘->’ ?) | |
if (dup2(stdin.readSide, STDIN_FILENO) == -1) | |
^ | |
src/libutil/util.cc: In function ‘std::string nix::runProgram(nix::Path, bool, const Strings&, const string&)’: | |
src/libutil/util.cc:970:12: error: request for member ‘writeSide’ in ‘__getreent()->_reent::_stdout’, which is of pointer type ‘__FILE* {aka __sFILE64*}’ (maybe you meant to use ‘->’ ?) | |
stdout.writeSide.close(); | |
^ | |
src/libutil/util.cc:974:15: error: request for member ‘readSide’ in ‘__getreent()->_reent::_stdin’, which is of pointer type ‘__FILE* {aka __sFILE64*}’ (maybe you meant to use ‘->’ ?) | |
stdin.readSide.close(); | |
^ | |
src/libutil/util.cc:975:25: error: request for member ‘writeSide’ in ‘__getreent()->_reent::_stdin’, which is of pointer type ‘__FILE* {aka __sFILE64*}’ (maybe you meant to use ‘->’ ?) | |
writeFull(stdin.writeSide, input); | |
^ | |
src/libutil/util.cc:976:15: error: request for member ‘writeSide’ in ‘__getreent()->_reent::_stdin’, which is of pointer type ‘__FILE* {aka __sFILE64*}’ (maybe you meant to use ‘->’ ?) | |
stdin.writeSide.close(); | |
^ | |
src/libutil/util.cc:979:36: error: request for member ‘readSide’ in ‘__getreent()->_reent::_stdout’, which is of pointer type ‘__FILE* {aka __sFILE64*}’ (maybe you meant to use ‘->’ ?) | |
string result = drainFD(stdout.readSide); | |
^ | |
mk/patterns.mk:2: recipe for target 'src/libutil/util.o' failed | |
make: *** [src/libutil/util.o] Error 1 | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
string runProgram(Path program, bool searchPath, const Strings & args, | |
const string & input) | |
{ | |
checkInterrupt(); | |
/* Create a pipe. */ | |
Pipe stdout, stdin; | |
stdout.create(); | |
if (!input.empty()) stdin.create(); | |
/* Fork. */ | |
Pid pid = startProcess([&]() { | |
if (dup2(stdout.writeSide, STDOUT_FILENO) == -1) | |
throw SysError("dupping stdout"); | |
if (!input.empty()) { | |
if (dup2(stdin.readSide, STDIN_FILENO) == -1) | |
throw SysError("dupping stdin"); | |
} | |
Strings args_(args); | |
args_.push_front(program); | |
auto cargs = stringsToCharPtrs(args_); | |
if (searchPath) | |
execvp(program.c_str(), (char * *) &cargs[0]); | |
else | |
execv(program.c_str(), (char * *) &cargs[0]); | |
throw SysError(format("executing ‘%1%’") % program); | |
}); | |
stdout.writeSide.close(); | |
/* FIXME: This can deadlock if the input is too long. */ | |
if (!input.empty()) { | |
stdin.readSide.close(); | |
writeFull(stdin.writeSide, input); | |
stdin.writeSide.close(); | |
} | |
string result = drainFD(stdout.readSide); | |
/* Wait for the child to finish. */ | |
int status = pid.wait(true); | |
if (!statusOk(status)) | |
throw ExecError(format("program ‘%1%’ %2%") | |
% program % statusToString(status)); | |
return result; | |
} | |
... |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
class AutoCloseFD | |
{ | |
int fd; | |
public: | |
AutoCloseFD(); | |
AutoCloseFD(int fd); | |
AutoCloseFD(const AutoCloseFD & fd); | |
~AutoCloseFD(); | |
void operator =(int fd); | |
operator int() const; | |
void close(); | |
bool isOpen(); | |
int borrow(); | |
}; | |
class Pipe | |
{ | |
public: | |
AutoCloseFD readSide, writeSide; | |
void create(); | |
}; | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment