Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Imison <nosami@users.noreply.github.com>2019-04-10 19:35:44 +0300
committerAlexis Christoforides <alexis@thenull.net>2019-04-10 19:35:44 +0300
commitc16b4cff44e6580e650c31b0b00b6865f4e4b8da (patch)
tree48387baa20a5963fe143fd59458c5a056faff003 /packaging
parent08a8880dddbed33538030a8e71e53502889ef361 (diff)
[MacSDK] Bump F# to 4.5 (#10919)
* Use a custom prefix instead of trying to infer it, which doesn't work under bockbuild. The following line is problematic in the scope of building the Mac SDK package (using bockbuild): https://github.com/fsharp/fsharp/blob/ccfccbacfdb16b2ab143cf83f5ece20f738fd864/mono/config.make#L5 It's problematic because where `mono` lives in this case would be something like `/macsdk-staging-dir/bin/mono` which is not the actual prefix (prefix here being the final destination, `/Library/Frameworks/Mono.framework/...`) but a staging area that bockbuild uses (this is how we build on system prefixes without installing on CI) For the F# build, bockbuild expects things to end up in `/fsharp-staging-dir/$(prefix)` (because that's what most `make install`s do when given `DESTDIR=/fsharp-staging-dir/`). If things end up in _any other_ directory in `/fsharp-staging-dir/` (like `/fsharp-staging-dir/macsdk-staging-dir` in our case) that would cause us to miss packaging those files (this has happened before, with packages that have broken or different use of `DESTDIR`). So there is an added write-protection for anywhere in `/fsharp-staging-dir` that *isn't* `/fsharp-staging-dir/$(prefix)` , because a write-protection error, while obtuse, is much preferable to missing the fact that some files are not packaged (as would have happened here) So the fix is to stop trying to infer the prefix, and return to providing it explicitly to the build system (this used to be the case via the `configure` step) * Also, if we are doing an override of the 'make' command, we need to take care of passing DESTDIR ourselves too * Since now we perform 'make install' on the make step, make the 'install' step into a no-operation. * Look for sn where mono is, not in the final destination (which again, may not be the same)
Diffstat (limited to 'packaging')
-rw-r--r--packaging/MacSDK/fsharp.py24
-rw-r--r--packaging/MacSDK/patches/fsharp-custom-prefix.patch26
-rw-r--r--packaging/MacSDK/patches/fsharp-debug-pinvoke-fix.patch24
-rw-r--r--packaging/MacSDK/patches/fsharp-debug.patch17
-rw-r--r--packaging/MacSDK/patches/fsharp-msbuild-16-0.patch13
-rw-r--r--packaging/MacSDK/patches/fsharp-noinstall.patch13
-rw-r--r--packaging/MacSDK/patches/fsharp-path-overloads.patch22
-rw-r--r--packaging/MacSDK/patches/fsharp-string-switchName.patch13
8 files changed, 78 insertions, 74 deletions
diff --git a/packaging/MacSDK/fsharp.py b/packaging/MacSDK/fsharp.py
index 64d84ba8856..2916fe63831 100644
--- a/packaging/MacSDK/fsharp.py
+++ b/packaging/MacSDK/fsharp.py
@@ -2,19 +2,18 @@ class FsharpPackage(GitHubTarballPackage):
def __init__(self):
GitHubTarballPackage.__init__(self,
'fsharp', 'fsharp',
- '4.1.34',
- '662492595a63dffff8fac84939614743fd6d34f9',
- configure='./configure --prefix="%{package_prefix}"',
- override_properties={ 'make': 'make' })
+ '4.5.0',
+ '3de387432de8d11a89f99d1af87aa9ce194fe21b',
+ configure='',
+ override_properties={ 'make': 'make all install PREFIX="%{package_prefix}" DESTDIR=%{stage_root}' })
self.extra_stage_files = ['lib/mono/xbuild/Microsoft/VisualStudio/v/FSharp/Microsoft.FSharp.Targets']
- self.sources.extend(['patches/fsharp-portable-pdb.patch',
- 'patches/fsharp-string-switchName.patch',
- 'patches/fsharp-path-overloads.patch',
- 'patches/fsharp-debug-pinvoke-fix.patch',
- 'patches/fsharp-IsPathRooted-type-inference.patch',
+ self.sources.extend(['patches/fsharp-IsPathRooted-type-inference.patch',
+ 'patches/fsharp-portable-pdb.patch',
+ 'patches/fsharp-noinstall.patch',
'patches/fsharp-GetFileNameWithoutExtension-type-inference.patch',
- 'patches/fsharp-msbuild-16-0.patch'])
+ 'patches/fsharp-msbuild-16-0.patch',
+ 'patches/fsharp-custom-prefix.patch'])
def prep(self):
Package.prep(self)
@@ -23,8 +22,9 @@ class FsharpPackage(GitHubTarballPackage):
self.sh('patch -p1 < "%{local_sources[' + str(p) + ']}"')
def build(self):
- self.sh('autoreconf')
- Package.configure(self)
Package.make(self)
+ def install(self):
+ pass
+
FsharpPackage()
diff --git a/packaging/MacSDK/patches/fsharp-custom-prefix.patch b/packaging/MacSDK/patches/fsharp-custom-prefix.patch
new file mode 100644
index 00000000000..63401e18446
--- /dev/null
+++ b/packaging/MacSDK/patches/fsharp-custom-prefix.patch
@@ -0,0 +1,26 @@
+diff --git a/mono/config.make b/mono/config.make
+index 00bd4a091..d7090a877 100644
+--- a/mono/config.make
++++ b/mono/config.make
+@@ -4,7 +4,12 @@ DEFAULT: all
+
+ monocmd = $(shell which mono)
+ monocmddir = $(dir $(monocmd))
++ifeq (x-$(PREFIX)-,x--)
+ prefix = $(shell (cd $(monocmddir)/..; pwd))
++else
++prefix = $(PREFIX)
++endif
++
+ thisdir = $(dir $(realpath $(lastword $(MAKEFILE_LIST))))
+ topdir = $(thisdir)../
+ builddir = $(topdir)
+@@ -147,7 +152,7 @@ install-sdk-lib:
+ @mkdir -p $(DESTDIR)$(monodir)/fsharp
+ @if test "x$(DELAY_SIGN)" = "x1"; then \
+ echo "Signing $(outdir)$(ASSEMBLY) with Mono key"; \
+- $(monobindir)sn -q -R $(outdir)$(ASSEMBLY) $(topdir)mono/mono.snk; \
++ $(monocmddir)sn -q -R $(outdir)$(ASSEMBLY) $(topdir)mono/mono.snk; \
+ fi
+ @if test x-$(NAME) = x-FSharp.Compiler.Private; then \
+ echo "Installing extra dependency System.Collections.Immutable.dll to $(DESTDIR)$(monodir)/fsharp/"; \
diff --git a/packaging/MacSDK/patches/fsharp-debug-pinvoke-fix.patch b/packaging/MacSDK/patches/fsharp-debug-pinvoke-fix.patch
deleted file mode 100644
index 1a80f87ba46..00000000000
--- a/packaging/MacSDK/patches/fsharp-debug-pinvoke-fix.patch
+++ /dev/null
@@ -1,24 +0,0 @@
-diff --git a/src/absil/ilwrite.fs b/src/absil/ilwrite.fs
-index 8ea9dec..74b3d9d 100755
---- a/src/absil/ilwrite.fs
-+++ b/src/absil/ilwrite.fs
-@@ -2594,7 +2594,8 @@ let GenMethodDefAsRow cenv env midx (md: ILMethodDef) =
- SequencePoints=seqpoints }
- cenv.AddCode code
- addr
-- | MethodBody.Abstract ->
-+ | MethodBody.Abstract
-+ | MethodBody.PInvoke _ ->
- // Now record the PDB record for this method - we write this out later.
- if cenv.generatePdb then
- cenv.pdbinfo.Add
-@@ -2607,8 +2608,7 @@ let GenMethodDefAsRow cenv env midx (md: ILMethodDef) =
- SequencePoints = [| |] }
- 0x0000
- | MethodBody.Native ->
-- failwith "cannot write body of native method - Abstract IL cannot roundtrip mixed native/managed binaries"
-- | _ -> 0x0000)
-+ failwith "cannot write body of native method - Abstract IL cannot roundtrip mixed native/managed binaries")
-
- UnsharedRow
- [| ULong codeAddr
diff --git a/packaging/MacSDK/patches/fsharp-debug.patch b/packaging/MacSDK/patches/fsharp-debug.patch
new file mode 100644
index 00000000000..d454dfaf163
--- /dev/null
+++ b/packaging/MacSDK/patches/fsharp-debug.patch
@@ -0,0 +1,17 @@
+diff --git a/mono/config.make b/mono/config.make
+index 00bd4a0..136c644 100644
+--- a/mono/config.make
++++ b/mono/config.make
+@@ -144,6 +144,12 @@ NO_DIST = .gitignore lib/debug lib/proto lib/release
+ #
+ install-sdk-lib:
+ @echo "Installing $(ASSEMBLY)"
++ @echo "Dest dir"
++ @ls -la $(DESTDIR)
++ @chmod +w $(DESTDIR)
++ @ls -la $(DESTDIR)
++ @echo "Mono dir"
+ @mkdir -p $(DESTDIR)$(monodir)/fsharp
++ @ls -la $(DESTDIR)$(monodir)
+ @if test "x$(DELAY_SIGN)" = "x1"; then \
+ echo "Signing $(outdir)$(ASSEMBLY) with Mono key"; \
diff --git a/packaging/MacSDK/patches/fsharp-msbuild-16-0.patch b/packaging/MacSDK/patches/fsharp-msbuild-16-0.patch
index e9a766683fa..7077e0760ca 100644
--- a/packaging/MacSDK/patches/fsharp-msbuild-16-0.patch
+++ b/packaging/MacSDK/patches/fsharp-msbuild-16-0.patch
@@ -1,7 +1,7 @@
-diff --git a/mono/config.make.in b/mono/config.make.in
+diff --git a/mono/config.make b/mono/config.make
index 3106ab99f..8af247ffd 100644
---- a/mono/config.make.in
-+++ b/mono/config.make.in
+--- a/mono/config.make
++++ b/mono/config.make
@@ -148,6 +148,7 @@ install-sdk-lib:
echo " --> $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v12.0/FSharp/"; \
echo " --> $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v14.0/FSharp/"; \
@@ -45,6 +45,13 @@ index 3106ab99f..8af247ffd 100644
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v14.0/FSharp/; \
$(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v15.0/FSharp/; \
+ $(INSTALL_LIB) $(outdir)Microsoft.FSharp.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v16.0/FSharp/; \
+ \
+ $(INSTALL_LIB) $(outdir)Microsoft.FSharp.Overrides.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v/FSharp/; \
+ $(INSTALL_LIB) $(outdir)Microsoft.FSharp.Overrides.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v11.0/FSharp/; \
+ $(INSTALL_LIB) $(outdir)Microsoft.FSharp.Overrides.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v12.0/FSharp/; \
+ $(INSTALL_LIB) $(outdir)Microsoft.FSharp.Overrides.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v14.0/FSharp/; \
+ $(INSTALL_LIB) $(outdir)Microsoft.FSharp.Overrides.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v15.0/FSharp/; \
++ $(INSTALL_LIB) $(outdir)Microsoft.FSharp.Overrides.NetSdk.targets $(DESTDIR)$(monodir)/xbuild/Microsoft/VisualStudio/v16.0/FSharp/; \
fi
@if test x-$(outsuffix) = x-net40; then \
if test -e $(outdir)$(NAME).dll; then \
diff --git a/packaging/MacSDK/patches/fsharp-noinstall.patch b/packaging/MacSDK/patches/fsharp-noinstall.patch
new file mode 100644
index 00000000000..133726cb1b3
--- /dev/null
+++ b/packaging/MacSDK/patches/fsharp-noinstall.patch
@@ -0,0 +1,13 @@
+diff --git a/mono/build-mono.sh b/mono/build-mono.sh
+index 12e49fa..85145a9 100755
+--- a/mono/build-mono.sh
++++ b/mono/build-mono.sh
+@@ -3,6 +3,6 @@
+ # Bootstrap the compiler
+ # Install the compiler
+ ./mono/prepare-mono.sh && \
+-make && \
+-sudo make install
++make && make install
++
+
diff --git a/packaging/MacSDK/patches/fsharp-path-overloads.patch b/packaging/MacSDK/patches/fsharp-path-overloads.patch
deleted file mode 100644
index 87b11450edb..00000000000
--- a/packaging/MacSDK/patches/fsharp-path-overloads.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-diff --git a/src/scripts/scriptlib.fsx b/src/scripts/scriptlib.fsx
-index cc797e305..ae8a6d3cc 100644
---- a/src/scripts/scriptlib.fsx
-+++ b/src/scripts/scriptlib.fsx
-@@ -59,12 +59,12 @@ module Scripting =
-
- let (++) a b = Path.Combine(a,b)
-
-- let getBasename a = Path.GetFileNameWithoutExtension a
-- let getFullPath a = Path.GetFullPath a
-- let getFilename a = Path.GetFileName a
-- let getDirectoryName a = Path.GetDirectoryName a
-+ let getBasename (path: string) = Path.GetFileNameWithoutExtension path
-+ let getFullPath (path: string) = Path.GetFullPath path
-+ let getFilename (path: string) = Path.GetFileName path
-+ let getDirectoryName (path: string) = Path.GetDirectoryName path
-
-- let copyFile source dir =
-+ let copyFile (source: string) dir =
- let dest =
- if not (Directory.Exists dir) then Directory.CreateDirectory dir |>ignore
- let result = Path.Combine(dir, Path.GetFileName source)
diff --git a/packaging/MacSDK/patches/fsharp-string-switchName.patch b/packaging/MacSDK/patches/fsharp-string-switchName.patch
deleted file mode 100644
index 7668e28856b..00000000000
--- a/packaging/MacSDK/patches/fsharp-string-switchName.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/src/scripts/scriptlib.fsx b/src/scripts/scriptlib.fsx
-index cc797e305..5a7be7d2b 100644
---- a/src/scripts/scriptlib.fsx
-+++ b/src/scripts/scriptlib.fsx
-@@ -36,7 +36,7 @@ module Scripting =
- #if INTERACTIVE
- let argv = Microsoft.FSharp.Compiler.Interactive.Settings.fsi.CommandLineArgs |> Seq.skip 1 |> Seq.toArray
-
-- let getCmdLineArgOptional switchName =
-+ let getCmdLineArgOptional (switchName: string) =
- argv |> Array.filter(fun t -> t.StartsWith(switchName)) |> Array.map(fun t -> t.Remove(0, switchName.Length).Trim()) |> Array.tryHead
-
- let getCmdLineArg switchName defaultValue =