Skip to content

Added remaining changes to make it run on MSYS - #246

Merged
jrosdahl merged 6 commits into
ccache:masterfrom
afbjorklund:msys
Jul 28, 2019
Merged

jrosdahl merged 6 commits into
ccache:masterfrom
afbjorklund:msys

Conversation

@afbjorklund

Copy link
Copy Markdown
Contributor

Installed msys2-x86_64-20161025.exe, with gcc and make (using pacman).

After some fixes, it runs in Unix mode (Cygwin). Windows mode (MinGW) left to do.

Most issues were related to symlinks.

Closes #170

unittest/run.exe
PASSED: 484 assertions, 95 tests, 10 suites
CC='gcc' /bin/sh ./test/run
Compiler:         gcc (/usr/bin/gcc)
Compiler version: gcc (GCC) 6.4.0
CUDA compiler:    not available

Running test suite base.......................................................
Running test suite nocpp2.......................................................
Running test suite cpp1.
Skipped test suite multi_arch [multiple -arch options not supported on MSYS_NT-6.1]
Skipped test suite serialize_diagnostics [--serialize-diagnostics not supported by compiler]
Running test suite debug_prefix_map..
Skipped test suite masquerading [symlinks not supported on MSYS_NT-6.1]
Running test suite hardlink.
Running test suite direct........................................
Running test suite basedir.....
Running test suite compression.
Running test suite readonly...
Running test suite readonly_direct..
Running test suite cleanup............
Running test suite pch...............
Running test suite upgrade.
Running test suite input_charset.
Skipped test suite nvcc [nvcc is not available]
Skipped test suite nvcc_direct [nvcc is not available]
Skipped test suite nvcc_ldir [nvcc is not available]
Skipped test suite nvcc_nocpp2 [nvcc is not available]
PASSED

@afbjorklund

Copy link
Copy Markdown
Contributor Author

@peterbud : I added some work-in-progress windows code to 217a260

But there is still a lot of confusion about paths (C:/foo/bar versus C:\foo\bar)
plus a lot of basic file operations are plain failing, like rename/unlink of "stats" ?
So the Unix-based MSYS(2) is in a better shape than the Windows-based MinGW.
We are defaulting to the 32-bit version, simply since it works better with Wine...

So I don't think we can say that the Windows ccache version works just yet ?


The MSYS(2) installer is found here: http://www.msys2.org/
It will install all three environments (MSYS/MinGW32/MinGW64)

Toolchain is found here: https://mingw-w64.org/doku.php
Normally you would just install the tools using pacman, though.

The old Cygwin and MinGW are now ancient and busted, so I think we'll drop those.

But the MSYS2 (on Windows) or MinGW-w64/Wine (on Linux) are quite useful still...

https://github.com/msys2/msys2/wiki/Porting

https://packages.ubuntu.com/xenial/mingw-w64

@peterbud

peterbud commented Apr 7, 2018

Copy link
Copy Markdown
Contributor

@afbjorklund : we are not there yet, you are right. I have a working version of ccache which works on MSYS2/MINGW 64-bit, and addressing many of the path issues. I'm not full satisfied with everything. What would be your suggestion to unify our efforts?

Also as I have promised will create an Appveyor script to have a proper CI solution without Wine.

@afbjorklund

Copy link
Copy Markdown
Contributor Author

@peterbud : I put the code changes I had done up on a "windows" branch, do you have a similar one ?

The MSYS target and build should already be addressed ("travis"), but it doesn't actually run anything
The idea is to use Travis to make sure that everything still builds, for the Windows (_WIN32) target...

We had an earlier effort to start a Appveyor build (#69), but it was never completed - lack of interest

@afbjorklund

afbjorklund commented Apr 18, 2018 •

Copy link
Copy Markdown
Contributor Author

This should be rebased to 3.4-maint, on top of #245 when that is done...

The first two commits are obsolete, replaced with e79f2eb and fee1339

Comment thread test/suites/basedir.bash Outdated
cat <<EOF >dir1/src/test.c
#include <stdarg.h>
#include <test.h>
#include "test.h"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just so I understand, why is this needed? Isn't test.h included via the -I directive, not via .?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

WIll have to retry it on windows, see what the issue might have been (forgot)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't seem to be needed anymore, if it ever was...

@jrosdahl jrosdahl added os: windows Related to building or running on Windows issue: portability Caused by OS or platform differences when building or running ccache labels May 7, 2018
@afbjorklund

Copy link
Copy Markdown
Contributor Author

Passed the tests locally:

$ make test
unittest/run.exe
PASSED: 493 assertions, 99 tests, 10 suites
CC='gcc' /bin/sh ../test/run
Compiler:         gcc (/usr/bin/gcc)
Compiler version: gcc (GCC) 7.3.0
CUDA compiler:    not available

Running test suite base.......................................................
Running test suite nocpp2.......................................................
Running test suite cpp1.
Skipped test suite multi_arch [multiple -arch options not supported on MSYS_NT-6.1]
Skipped test suite serialize_diagnostics [--serialize-diagnostics not supported by compiler]
Running test suite debug_prefix_map..
Skipped test suite masquerading [symlinks not supported on MSYS_NT-6.1]
Running test suite hardlink.
Running test suite direct........................................
Running test suite basedir.....
Running test suite compression.
Running test suite readonly...
Running test suite readonly_direct..
Running test suite cleanup............
Running test suite pch.............
Running test suite upgrade.
Running test suite input_charset.
Skipped test suite nvcc [nvcc is not available]
Skipped test suite nvcc_direct [nvcc is not available]
Skipped test suite nvcc_ldir [nvcc is not available]
Skipped test suite nvcc_nocpp2 [nvcc is not available]
PASSED

@afbjorklund

Copy link
Copy Markdown
Contributor Author

@jrosdahl: this should be good to go (I think?), sorry I missed to follow up on that review commit...

As stated, this fixes the tests on MSYS2/MSYS (Cygwin mode), not on MSYS2/MinGW (Windows mode)
(See https://github.com/msys2/msys2/wiki/MSYS2-introduction for the difference between the modes)

@peterbud

Copy link
Copy Markdown
Contributor

Just to state the obvious: This is working for me as well on MSYS2 perfectly!

@rkitover

Copy link
Copy Markdown
Contributor

Hi, I have a related PR #311

I checked out your branch, and the tests pass for me on latest msys2 both without and with the bundled zlib.

Some notes about the changes:

  • Categorizing cygwin as "useless" may be a bit of a stretch, I believe there are far more cygwin users than there are msys2 users. It's very popular in corporate environments etc..
  • There is no reason to disable symlinks on cygwin proper, they generally work transparently to POSIX regardless of what winsymlinks is set to in the CYGWIN env var.
  • MSYS2 has symlink support, but not unprivileged last I checked and most people don't use this, so it would be fine to disable symlinks for MSYS/MSYS2 for the time being, although having an option to enable them might be nice.
  • The mkstemp check I will try to improve in my PR, perhaps with defines, or perhaps with autoconf.

@afbjorklund

Copy link
Copy Markdown
Contributor Author

Symlinks is not a big deal, we only use them for the optional "masquerading" feature... Might as well leave them out, for both ?

@rkitover

Copy link
Copy Markdown
Contributor

Yeah if it doesn't hurt the functionality then it's no loss.

@afbjorklund afbjorklund added the help wanted The ccache maintainers need your help label Jul 21, 2019
@afbjorklund

Copy link
Copy Markdown
Contributor Author

See #170 for details

@afbjorklund afbjorklund removed the os: windows Related to building or running on Windows label Jul 21, 2019
@jrosdahl
jrosdahl changed the base branch from 3.4-maint to master July 28, 2019 09:20
@jrosdahl
jrosdahl merged commit 93e1c97 into ccache:master Jul 28, 2019
@jrosdahl jrosdahl added this to the 3.8 milestone Jul 28, 2019
llunak pushed a commit to llunak/ccache that referenced this pull request Nov 2, 2019
* Skip test that require symlinks, on Windows/Cygwin

* Don't use symlinks for lockfiles on Cygwin

* Seems like objdump has issues on Windows/Cygwin

* Make it possible to run suite in isolation
@jrosdahl jrosdahl changed the title Added remaining changes, to make it run on MSYS Added remaining changes to make it run on MSYS Sep 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

help wanted The ccache maintainers need your help issue: portability Caused by OS or platform differences when building or running ccache

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Windows: unittest hangs on Cygwin, test should support MSYS2

4 participants