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:
authorKatelyn Gadd <kg@luminance.org>2019-05-29 09:54:44 +0300
committerGitHub <noreply@github.com>2019-05-29 09:54:44 +0300
commitadd2a211b3abd49e33c1bf6496833687d80ec707 (patch)
treee9a407e9030ccf009a07002af27f3b71facf3770
parentedd6c013b0b9e28f85eb9b8a29e6fb7055764825 (diff)
Infrastructure support / fixes for making compiler server the default (#14279)
* Fix enabling the compiler server using autogen, and force it off if mcs is being used * autogen updates * Formatting fixes * Fix vbcs getting turned on if unspecified even if mcs was selected * Dynamically evaluate ENABLE_COMPILER_SERVER each time we compile instead of evaluating it once at some arbitrary point during makefile evaluation * More detailed comment based on testing * Handle the /shared option in genproj so it doesn't fail * Raise basic profile check requirement to 6.2 and hopefully assert that named pipes work * Default compiler server to off for now.
-rw-r--r--configure.ac23
-rw-r--r--mcs/build/common/basic-profile-check.cs4
-rw-r--r--mcs/build/rules.make16
-rwxr-xr-xmcs/build/start-compiler-server.sh3
-rwxr-xr-xmsvc/scripts/genproj.cs3
5 files changed, 38 insertions, 11 deletions
diff --git a/configure.ac b/configure.ac
index 57ee60b7aa2..d5c8ecc09c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -6529,6 +6529,26 @@ if test x$host_darwin = xyes; then
sed -e 's,lock_old_archive_extraction=yes,lock_old_archive_extraction=no,g' < libtool > libtool.new && mv libtool.new libtool && chmod +x libtool
fi
+AC_MSG_CHECKING([compiler server])
+AC_ARG_WITH(compiler-server, [ --with-compiler-server=yes,no,default Enables or disables compiler server],[
+ if test x$withval = xyes; then
+ enable_compiler_server=yes;
+ elif test x$withval = xno; then
+ enable_compiler_server=no;
+ elif test x$withval = xdefault; then
+ enable_compiler_server=no;
+ else
+ AC_MSG_ERROR([You must supply one of "yes", "no" or "default" to the --with-compiler-server option])
+ fi
+],[enable_compiler_server=no])
+
+if test x$enable_compiler_server = xyes; then
+ if test x$csc_compiler = xmcs; then
+ AC_MSG_WARN([mcs does not support the compiler server])
+ enable_compiler_server=no;
+ fi
+fi
+
(
case $prefix in
NONE) prefix=$ac_default_prefix ;;
@@ -6699,8 +6719,9 @@ if test x$buildsgen = xyes; then
fi
echo "
- mcs source: $mcsdir
+ mcs source: $mcsdir
C# Compiler: $csc_compiler
+ CompilerServer:$enable_compiler_server
Engine:
Host: $host
diff --git a/mcs/build/common/basic-profile-check.cs b/mcs/build/common/basic-profile-check.cs
index 6fe2fe7ccf8..f4ac1302ddd 100644
--- a/mcs/build/common/basic-profile-check.cs
+++ b/mcs/build/common/basic-profile-check.cs
@@ -41,9 +41,9 @@ class X
Version min_mono_version;
#if __MonoCS__
- min_mono_version = new Version (5, 19);
+ min_mono_version = new Version (6, 2);
#else
- min_mono_version = new Version (5, 10);
+ min_mono_version = new Version (6, 2);
#endif
if (version < min_mono_version)
diff --git a/mcs/build/rules.make b/mcs/build/rules.make
index b4c9df71575..0aaccdf58a8 100644
--- a/mcs/build/rules.make
+++ b/mcs/build/rules.make
@@ -31,13 +31,15 @@ ifndef BUILD_TOOLS_PROFILE
BUILD_TOOLS_PROFILE = build
endif
-ifeq ("$(ENABLE_COMPILER_SERVER)","1")
-COMPILER_SERVER_ARGS=/shared:$(COMPILER_SERVER_PIPENAME)
-CSC_LOCATION=$(SERVER_CSC_LOCATION)
-else
-COMPILER_SERVER_ARGS:=
-CSC_LOCATION=$(STANDALONE_CSC_LOCATION)
-endif
+# NOTE: We have to use conditional functions to branch on the state of ENABLE_COMPILER_SERVER
+# because the value of this flag can change after rules.make is evaluated. If we use regular ifeq
+# statements our builds will opt to use or not use the compiler server seemingly at random because
+# we include rules.make many times and the last observed value from rules.make does not match the
+# value used when actually executing csc. you can observe this by adding an $ ( info here and an
+# echo above the csc invocation and printing the values.
+COMPILER_SERVER_ENABLED_ARGS = /shared:$(COMPILER_SERVER_PIPENAME)
+COMPILER_SERVER_ARGS = $(if $(findstring 1,$(ENABLE_COMPILER_SERVER)),$(COMPILER_SERVER_ENABLED_ARGS),)
+CSC_LOCATION = $(if $(findstring 1,$(ENABLE_COMPILER_SERVER)),$(SERVER_CSC_LOCATION),$(STANDALONE_CSC_LOCATION))
USE_MCS_FLAGS = $(COMPILER_SERVER_ARGS) /codepage:$(CODEPAGE) /nologo /noconfig /deterministic $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS) $(MCS_FLAGS)
USE_MBAS_FLAGS = $(COMPILER_SERVER_ARGS) /codepage:$(CODEPAGE) $(LOCAL_MBAS_FLAGS) $(PLATFORM_MBAS_FLAGS) $(PROFILE_MBAS_FLAGS) $(MBAS_FLAGS)
diff --git a/mcs/build/start-compiler-server.sh b/mcs/build/start-compiler-server.sh
index 26be16ed000..b7df8cf969f 100755
--- a/mcs/build/start-compiler-server.sh
+++ b/mcs/build/start-compiler-server.sh
@@ -7,7 +7,8 @@ set -e
if [ -s "$VBCS_LOCATION" ]; then
CMD="RoslynCommandLineLogFile=$2 $VBCS_RUNTIME --gc-params=nursery-size=64m \"$VBCS_LOCATION\" -pipename:$3 &"
- echo . > "$2"
+ echo "Log location set to $2"
+ touch "$2"
echo "cd $1; bash -c \"$CMD\""
cd "$1"
bash -c "$CMD"
diff --git a/msvc/scripts/genproj.cs b/msvc/scripts/genproj.cs
index 1849009db00..79d9c4c3c26 100755
--- a/msvc/scripts/genproj.cs
+++ b/msvc/scripts/genproj.cs
@@ -716,6 +716,9 @@ public class MsbuildGenerator {
case "/sourcelink":
return true;
+
+ case "/shared":
+ return true;
}
Console.Error.WriteLine ($"// Failing with : {arg}");