Use Appveyor's MSYS2/Cygwin installation rather than my own snapshots

It's simpler to just rely on what Appveyor already provides in its system
images. Appveyor doesn't provide a 32-bit msys2 build, but AFAIK, anyone
needing that can compile it themselves.

Avoid listing gcc-g++ in the Cygwin setup commands because it apparently
breaks the Cygwin toolchain (i.e. missing stddef.h error):
https://ci.appveyor.com/project/rprichard/winpty/builds/19875792
This commit is contained in:
Ryan Prichard 2018-10-29 03:49:13 -07:00
parent d49712c548
commit afacf7792f
2 changed files with 32 additions and 76 deletions

View File

@ -1,7 +1,14 @@
image: Visual Studio 2015 image: Visual Studio 2015
init:
- C:\msys64\usr\bin\bash --login -c "pacman -S --needed --noconfirm --noprogressbar msys/make msys/tar msys/gcc mingw-w64-cross-toolchain"
- C:\cygwin\setup-x86 -q -P mingw64-i686-gcc-g++,mingw64-x86_64-gcc-g++,make
- C:\cygwin64\setup-x86_64 -q -P mingw64-i686-gcc-g++,mingw64-x86_64-gcc-g++,make
build_script: build_script:
- C:\Python27-x64\python.exe ship\ship.py - C:\Python27-x64\python.exe ship\ship.py --kind msys2 --arch x64 --syspath C:\msys64
- C:\Python27-x64\python.exe ship\ship.py --kind cygwin --arch ia32 --syspath C:\cygwin
- C:\Python27-x64\python.exe ship\ship.py --kind cygwin --arch x64 --syspath C:\cygwin64
- C:\Python27-x64\python.exe ship\make_msvc_package.py - C:\Python27-x64\python.exe ship\make_msvc_package.py
artifacts: artifacts:

View File

@ -26,6 +26,7 @@
import common_ship import common_ship
from optparse import OptionParser
import multiprocessing import multiprocessing
import os import os
import shutil import shutil
@ -42,87 +43,28 @@ def dllVersion(path):
os.chdir(common_ship.topDir) os.chdir(common_ship.topDir)
#URL_BASE = "file://c:/rprichard/proj/winpty-cygwin-prebuilts-1.0.20/"
URL_BASE = "https://github.com/rprichard/winpty/raw/winpty-cygwin-prebuilts-1.0.20/"
# Determine other build parameters. # Determine other build parameters.
BUILD_TARGETS = [ BUILD_KINDS = {
{ "cygwin": {
"systemName": "msys32",
"systemArchive": "msys32-20181015-dll2.11.1-msysgcc7.3.0-wingcc7.3.0.7z",
"systemArchiveUrl": URL_BASE + "msys32-20181015-dll2.11.1-msysgcc7.3.0-wingcc7.3.0.7z",
"systemArchiveSha": "82e92486b7891bf98a783d0acd50d2955a9d5abdd9f69f58701dbc242d2edd7a",
"packageName": "msys2-{dllver}-ia32",
"rebase": ["usr\\bin\\ash.exe", "/usr/bin/rebaseall", "-v"],
"dll": "usr\\bin\\msys-2.0.dll",
"path": ["opt\\bin", "usr\\bin"],
},
{
"systemName": "msys64",
"systemArchive": "msys64-20181015-dll2.11.1-msysgcc7.3.0-wingcc7.3.0.7z",
"systemArchiveUrl": URL_BASE + "msys64-20181015-dll2.11.1-msysgcc7.3.0-wingcc7.3.0.7z",
"systemArchiveSha": "e118f8877faf45b83759dc5a5a537c9dea81e025265a3817b3cf5047c1916726",
"packageName": "msys2-{dllver}-x64",
"rebase": ["usr\\bin\\ash.exe", "/usr/bin/rebaseall", "-v"],
"dll": "usr\\bin\\msys-2.0.dll",
"path": ["opt\\bin", "usr\\bin"],
},
{
"systemName": "cygwin32",
"systemArchive": "cygwin32-20181015-dll2.11.1-cyggcc7.3.0-wingcc6.4.0.7z",
"systemArchiveUrl": URL_BASE + "cygwin32-20181015-dll2.11.1-cyggcc7.3.0-wingcc6.4.0.7z",
"systemArchiveSha": "6fc0c2a07e2f3aeb041cce46e5152911d973c185ef0c606095871fe17fd0f7fa",
"packageName": "cygwin-{dllver}-ia32",
"rebase": ["bin\\ash.exe", "/bin/rebaseall", "-v"],
"dll": "bin\\cygwin1.dll",
"path": ["bin"], "path": ["bin"],
},
{
"systemName": "cygwin64",
"systemArchive": "cygwin64-20181015-dll2.11.1-cyggcc7.3.0-wingcc6.4.0.7z",
"systemArchiveUrl": URL_BASE + "cygwin64-20181015-dll2.11.1-cyggcc7.3.0-wingcc6.4.0.7z",
"systemArchiveSha": "6bc948ce19ae1a14d1450d0f791d9a510cfa61a3007d9d3052396328a15b816d",
"packageName": "cygwin-{dllver}-x64",
"rebase": ["bin\\ash.exe", "/bin/rebaseall", "-v"],
"dll": "bin\\cygwin1.dll", "dll": "bin\\cygwin1.dll",
"path": ["bin"],
}, },
] "msys2": {
"path": ["opt\\bin", "usr\\bin"],
"dll": "usr\\bin\\msys-2.0.dll",
},
}
def targetSystemDir(target): def buildTarget(kind, syspath, arch):
return os.path.abspath(os.path.join("ship", "tmp", target["systemName"]))
binPaths = [os.path.join(syspath, p) for p in BUILD_KINDS[kind]["path"]]
def setup_cyg_system(target):
common_ship.mkdir("ship/tmp")
systemDir = targetSystemDir(target)
systemArchivePath = os.path.abspath(os.path.join("ship", "tmp", target["systemArchive"]))
binPaths = [os.path.join(systemDir, p) for p in target["path"]]
binPaths += common_ship.defaultPathEnviron.split(";") binPaths += common_ship.defaultPathEnviron.split(";")
newPath = ";".join(binPaths) newPath = ";".join(binPaths)
if not os.path.exists(systemDir): dllver = dllVersion(os.path.join(syspath, BUILD_KINDS[kind]["dll"]))
if not os.path.exists(systemArchivePath): packageName = "winpty-{}-{}-{}-{}".format(common_ship.winptyVersion, kind, dllver, arch)
subprocess.check_call(["curl.exe", "-fL", "-o", systemArchivePath, target["systemArchiveUrl"]])
assert os.path.exists(systemArchivePath)
common_ship.checkSha256(systemArchivePath, target["systemArchiveSha"])
subprocess.check_call(["7z.exe", "x", systemArchivePath], cwd=os.path.dirname(systemDir))
with common_ship.ModifyEnv(PATH=newPath):
rebaseCmd = target["rebase"]
rebaseCmd[0] = os.path.join(systemDir, rebaseCmd[0])
subprocess.check_call(rebaseCmd)
assert os.path.exists(systemDir)
return newPath
def buildTarget(target):
newPath = setup_cyg_system(target)
dllver = dllVersion(os.path.join(targetSystemDir(target), target["dll"]))
packageName = "winpty-" + common_ship.winptyVersion + "-" + target["packageName"].format(dllver=dllver)
if os.path.exists("ship\\packages\\" + packageName): if os.path.exists("ship\\packages\\" + packageName):
shutil.rmtree("ship\\packages\\" + packageName) shutil.rmtree("ship\\packages\\" + packageName)
@ -144,11 +86,18 @@ def buildTarget(target):
def main(): def main():
targets = list(BUILD_TARGETS) parser = OptionParser()
if len(sys.argv) != 1: parser.add_option("--kind", type="choice", choices=["cygwin", "msys2"])
targets = [t for t in targets if t["systemName"] in sys.argv[1:]] parser.add_option("--syspath")
for t in targets: parser.add_option("--arch", type="choice", choices=["ia32", "x64"])
buildTarget(t) (args, extra) = parser.parse_args()
args.kind or parser.error("--kind must be specified")
args.arch or parser.error("--arch must be specified")
args.syspath or parser.error("--syspath must be specified")
extra and parser.error("unexpected positional argument(s)")
buildTarget(args.kind, args.syspath, args.arch)
if __name__ == "__main__": if __name__ == "__main__":