distutils
distutils copied to clipboard
Port code from CygwinCCompiler to UnixCCompiler
https://github.com/python-pillow/Pillow/issues/7158#issuecomment-1546746716 and
https://github.com/pypa/setuptools/blob/e76db4408e40a5c0a218ef6f652454f69c5aca59/setuptools/_distutils/ccompiler.py#L1055-L1058
suggest that Cygwin uses UnixCCompiler
rather than CygwinCCompiler
by default, so UnixCCompiler
would also need to know how to find shared libraries, import libraries, and static libraries on Cygwin.
Port of #139 to UnixCCompiler
UnixCCompiler.find_library_file
now returns library names that are likely to occur on Cygwin, rather than those likely on Linux, which causes the doctest to fail. Should I fix that with # doctest: ELLIPSIS
or something like
>>> result = compiler.find_library_file(dirs, 'abc').replace('\\', '/')
>>> if sys.platform == "cygwin":
... print(result == "/foo/bar/existing/cygabc.dll")
... else:
... print(result == "/foo/bar/existing/libabc.dylib")
True
Given Cygwin seems to use UnixCCompiler
rather than CygwinCCompiler
, should we also drop cygwinccompiler.py
?
Given Cygwin seems to use
UnixCCompiler
rather thanCygwinCCompiler
, should we also dropcygwinccompiler.py
?
#185 similarly feels CygwinCCompiler isn't used, although thinks it should be.
How should I be fixing the doctests to not fail with working code on Cygwin?
The odd doctests suggest having CygwinCCompiler
be a thin wrapper around UnixCCompiler
might be the way to go: the only thing I can think to change would be the doctests in this PR, as everything else seems fine.
Oh, heck. Tests on cygwin are currently disabled because ruff fails to install there.
There's some recent progress on rust-lang/rust#79854; I'm somewhat curious how well the work done to cross-compile from Linux would carry over to cross-compiling from Windows.
I'm somewhat curious how well the work done to cross-compile from Linux would carry over to cross-compiling from Windows.
there wasn't any existing cygwin cross compiler available on mingw or msys, but there is one on fedora linux
i also tried to get a cygwin cross compiler on archlinux: arch-cygwin (unofficial), it uses PKGBUILD (which is the same as what MSYS2 is using), ~~might be useful if someone want to build them and package on msys2~~ EDIT: i made one for cross-compiling on windows
How should I be fixing the doctests to not fail with working code on Cygwin?
I don't see any problem with the doctests. Perhaps they've been resolved.
The only failing test now is the failing coverage test, which is spurious and only there because the coverage is only checked on one platform, so it's ignorable.
How should I be fixing the doctests to not fail with working code on Cygwin?
I don't see any problem with the doctests. Perhaps they've been resolved.
It was a failure on the Cygwin doctests, which I think got disabled because there's no Rust compiler for Cygwin
How should I be fixing the doctests to not fail with working code on Cygwin?
I don't see any problem with the doctests. Perhaps they've been resolved.
It was a failure on the Cygwin doctests, which I think got disabled because there's no Rust compiler for Cygwin
the problem is usually path conversion
https://github.com/thepowersgang/mrustc
you can kinda get rust here on cygwin, but there are many problems with path conversion and cygwin not being linux