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

git clone fails on Windows because "aux" is a reserved name #457

Closed
bugabinga opened this issue Jul 23, 2018 · 4 comments
Closed

git clone fails on Windows because "aux" is a reserved name #457

bugabinga opened this issue Jul 23, 2018 · 4 comments

Comments

@bugabinga
Copy link
Contributor

It seems aux is a reserved file name on Windows, which leads to errors on git clone when checking out lib/howl/aux.moon (extension seems to be irrelevant).

PS Z:\> git clone https://github.com/howl-editor/howl.git
Cloning into 'howl'...
remote: Counting objects: 28587, done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 28587 (delta 0), reused 1 (delta 0), pack-reused 28585
Receiving objects: 100% (28587/28587), 38.20 MiB | 5.54 MiB/s, done.
Resolving deltas: 100% (19133/19133), done.
error: unable to stat just-written file lib/howl/aux.moon: No such file or directory
fatal: cannot create directory at 'lib/ljglibs/aux': Invalid argument
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

PS Z:\> git config --system core.longpaths true
PS Z:\> git clone https://github.com/howl-editor/howl.git
fatal: destination path 'howl' already exists and is not an empty directory.
PS Z:\> cd .\howl\
PS Z:\howl> git checkout -f HEAD
error: unable to stat just-written file lib/howl/aux.moon: No such file or directory
fatal: cannot create directory at 'lib/ljglibs/aux': Invalid Argument

References:

git-for-windows/git#883
git-for-windows/git#843 (comment)
git-for-windows/git#700 (comment)

@refi64
Copy link
Contributor

refi64 commented Jul 24, 2018

#261 fixes this, but it's been rotting for a while... Apparently MSYS2 is now the official way of getting GTK+ on Windows, and there are Visual Studio build scripts, so I might have to try that again sometime...

@bugabinga
Copy link
Contributor Author

@kirbyfan64 cloning in msys2 Shell works out. good to know!

I've tried the following to build on Windows:

  1. Install MSYS2
  2. Update MSYS2
  3. Install GTK3 (mingw-w64-x86_64-gtk3)
  4. Install Toolchain and base development tools (gcc, make, wget, ...)
  5. Install msys2-runtime-devel (<sys/wait.h>)
  6. Add /mingw64/bin to PATH
  7. Add /mingw64/lib/pkgconfig to PKG_CONFIG_PATH
  8. Add /usr/include to includes in CFLAGS (-I/usr/include)
  9. Build LuaJit with HOST_SYS="Windows" TARGET_SYS="Windows"
  10. Install mingw-w64-x86_64-dlfcn (-ldl)

This seems to work out until the linking step:

$ make
cc -o howl main.o process_helpers.o deps/lpeg-0.10.2/lpeg.o deps/LuaJIT-2.1.0-beta3/src/libluajit.a -lm -ldl -L/mingw64/lib -LC:/building/msys64/mingw64/lib/../lib -L/mingw64/lib -lgtk-3 -lgdk-3 -lgdi32 -limm32 -lshell32 -lole32 -Wl,-luuid -lwinmm -ldwmapi -lsetupapi -lcfgmgr32 -lz -lepoxy -lopengl32 -lgdi32 -lpangocairo-1.0 -lpangoft2-1.0 -lpangowin32-1.0 -lusp10 -lgdi32 -lpango-1.0 -lm -lfribidi -latk-1.0 -lcairo-gobject -lcairo -lz -lpixman-1 -lfontconfig -liconv -lexpat -lfreetype -lbz2 -lharfbuzz -lm -lgraphite2 -lpng16 -lz -lgdk_pixbuf-2.0 -lm -lpng16 -lz -lgmodule-2.0 -pthread -lgio-2.0 -lz -lgmodule-2.0 -pthread -lgobject-2.0 -lffi -lglib-2.0 -lintl -pthread -lws2_32 -lole32 -lwinmm -lshlwapi -lpcre -lintl -lpcre -shared
C:/Users/okr/scoop/apps/msys2/current/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/7.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: main.o:main.c:(.rdata$.refptr._impure_ptr[.refptr._impure_ptr]+0x0): undefined reference to `_impure_ptr'
collect2.exe: error: ld returned 1 exit status
make: *** [Makefile:55: howl] Fehler 1

Any ideas what this even means?

@refi64
Copy link
Contributor

refi64 commented Jul 24, 2018

@bugabinga Yeah, random, weird issues like that are why I stopped for now...

That being said, this issue is because you need to run all the build commands from a MinGW 32-bit shell, not an MSYS2 shell. MSYS2 installs both, but the former is more like MinGW (a lightweight compatibility layer), whereas the latter is more like Cygwin (a much heavier POSIX compatibility layer). Delete your entire build directory (from experience, if you don't, you'll spend ages debugging obscure errors) and rebuild from the MinGW 32-bit shell. You also shouldn't have to pass any parameters to LuaJIT or modify the PATH now.

@bugabinga
Copy link
Contributor Author

@kirbyfan64 thanks for explaining

this is frustratingly complicated.

with your instructions, the luajit build does not need parameters indeed.
however the archive is then named lua51.dll (instead of libluajit.a).

still, the same linker error as mentioned above remains.

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