From 20389946a65ab1a2e05e0603db11232beaf525e5 Mon Sep 17 00:00:00 2001 From: Ali <> Date: Wed, 26 Feb 2020 20:12:03 +0400 Subject: [PATCH] Build adjustments --- .bazelrc | 15 +----------- .bazelrc.swp | Bin 12288 -> 0 bytes .gitignore | 1 + Makefile | 22 ++++++++++++++---- build-system/generate-xcode-project.sh | 7 +++++- .../Display/Source/Nodes/ButtonNode.swift | 3 ++- 6 files changed, 27 insertions(+), 21 deletions(-) delete mode 100644 .bazelrc.swp diff --git a/.bazelrc b/.bazelrc index 53cb5e58c7..f11e3aa2f7 100644 --- a/.bazelrc +++ b/.bazelrc @@ -4,19 +4,6 @@ build --cxxopt='-std=c++14' build --copt='-w' build --swiftcopt='-Xcc' build --swiftcopt='-w' -build --features=swift.enable_batch_mode -build --features=swift.use_global_module_cache -build --features=swift.cacheable_swiftmodules build --spawn_strategy=local - -#build --swiftcopt=-wmo -#build --swiftcopt='-num-threads' -#build --swiftcopt='16' -build --swiftcopt=-j14 -#build --jobs 16 - -#build --remote_executor=grpc://localhost:8980 -#build --spawn_strategy=remote -#build --strategy=SwiftCompile=worker -#build --strategy=SwiftCompile=remote build --strategy=SwiftCompile=local + diff --git a/.bazelrc.swp b/.bazelrc.swp deleted file mode 100644 index 4f6e5472b0983b2f3a9c1bc8d29ee06b9697fe34..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12288 zcmeI2zl#$=6vrpFa(bMcb@Yl9$0XVFIAUO%(?cu{1Tk2-%+9|2ayGNf&XQaNt+cc9 zZxF$MLhUWA>@55ztbIF4cH(SZ1*0X);mp);n-&E#klwE zYx{d`_bp=ySTOneIm7u@uB_tps#&)(C zdxOgV|6jfT|GduF7u0*yJJcK{QC-wk)Q@Y7eMWskeL%fN#i$8BZAOb{y2oM1xKm>>Y5g-Ep6#;h*y3ToOO}O@1SQwo7kEf%)y{F@3q`-Gq zs@dMZO$K6Z;XKz=o9B3^yUdk{=_J4w7G14%51K#EMq)V@RD?pO3x6(w7$N4ezM2ah*@HnA@QN5v3a)d>U(3R{HZG3uLP{ z`XFp(AoX3{rWA4rB2*B#IMz|7AT3f=+*u02K``%&c7D<8!N|dmDZQ{V5CE(*-`m)UGH+}#U KgXdj7Rlflgr5tns diff --git a/.gitignore b/.gitignore index f003d00dcb..b0487bbc48 100644 --- a/.gitignore +++ b/.gitignore @@ -59,6 +59,7 @@ bazel-telegram-ios/* bazel-testlogs bazel-testlogs/* */*.swp +*.swp build-input/data build-input/data/* build-input/gen diff --git a/Makefile b/Makefile index 6d02c28e93..e35940b7f0 100644 --- a/Makefile +++ b/Makefile @@ -3,6 +3,8 @@ include Utils.makefile APP_VERSION="5.15.1" +CORE_COUNT=$(shell sysctl -n hw.logicalcpu) +CORE_COUNT_MINUS_ONE=$(shell expr ${CORE_COUNT} \- 1) BUCK_OPTIONS=\ --config custom.appVersion="${APP_VERSION}" \ @@ -44,10 +46,21 @@ BUCK_OPTIONS=\ BAZEL=$(shell which bazel) ifneq ($(BAZEL_CACHE_DIR),) - export BAZEL_CACHE_OPTIONS=\ + export BAZEL_CACHE_FLAGS=\ --disk_cache="${BAZEL_CACHE_DIR}" endif + +BAZEL_COMMON_FLAGS=\ + --features=swift.use_global_module_cache \ +BAZEL_DEBUG_FLAGS=\ + --features=swift.enable_batch_mode \ + --swiftcopt=-j${CORE_COUNT_MINUS_ONE} \ + +BAZEL_OPT_FLAGS=\ + --swiftcopt=-whole-module-optimization \ + --swiftcopt='-num-threads' --swiftcopt='16' \ + build_arm64: check_env $(BUCK) build \ @@ -408,18 +421,17 @@ temp_project: check_env kill_xcode bazel_app_debug_arm64: APP_VERSION="${APP_VERSION}" \ build-system/prepare-build.sh distribution - "${BAZEL}" build Telegram/Telegram \ + "${BAZEL}" build Telegram/Telegram ${BAZEL_CACHE_FLAGS} ${BAZEL_COMMON_FLAGS} ${BAZEL_DEBUG_FLAGS} \ -c dbg \ --ios_multi_cpus=arm64 \ --watchos_cpus=armv7k,arm64_32 \ - --verbose_failures \ - -s + --verbose_failures bazel_app_arm64: APP_VERSION="${APP_VERSION}" \ BAZEL_CACHE_DIR="${BAZEL_CACHE_DIR}" \ build-system/prepare-build.sh distribution - "${BAZEL}" build Telegram/Telegram ${BAZEL_CACHE_OPTIONS} \ + "${BAZEL}" build Telegram/Telegram ${BAZEL_CACHE_FLAGS} ${BAZEL_COMMON_FLAGS} ${BAZEL_OPT_FLAGS} \ -c opt \ --ios_multi_cpus=arm64 \ --watchos_cpus=armv7k,arm64_32 \ diff --git a/build-system/generate-xcode-project.sh b/build-system/generate-xcode-project.sh index 99e1d3d1d2..4fbcc74111 100755 --- a/build-system/generate-xcode-project.sh +++ b/build-system/generate-xcode-project.sh @@ -36,12 +36,17 @@ GEN_DIRECTORY="build-input/gen/project" rm -rf "$GEN_DIRECTORY" mkdir -p "$GEN_DIRECTORY" +CORE_COUNT=$(sysctl -n hw.logicalcpu) +CORE_COUNT_MINUS_ONE=$(expr ${CORE_COUNT} \- 1) + BAZEL_OPTIONS=(\ --features=swift.use_global_module_cache \ --spawn_strategy=standalone \ --strategy=SwiftCompile=standalone \ + --features=swift.enable_batch_mode \ + --swiftcopt=-j${CORE_COUNT_MINUS_ONE} \ ) -set -x + if [ "$BAZEL_CACHE_DIR" != "" ]; then BAZEL_OPTIONS=("${BAZEL_OPTIONS[@]}" --disk_cache="$(echo $BAZEL_CACHE_DIR | sed -e 's/[\/&]/\\&/g')") fi diff --git a/submodules/Display/Source/Nodes/ButtonNode.swift b/submodules/Display/Source/Nodes/ButtonNode.swift index 9b68afc19f..a7d6c8035c 100644 --- a/submodules/Display/Source/Nodes/ButtonNode.swift +++ b/submodules/Display/Source/Nodes/ButtonNode.swift @@ -280,5 +280,6 @@ open class ASButtonNode: ASControlNode { self.highlightedBackgroundImageNode.frame = CGRect(origin: CGPoint(), size: size) } - func f2() {print("test5") } + func f2() { + } }