diff --git a/.github/install_macos_sdk.sh b/.github/install_macos_sdk.sh deleted file mode 100755 index 0f1ae46b8..000000000 --- a/.github/install_macos_sdk.sh +++ /dev/null @@ -1,22 +0,0 @@ -#!/usr/bin/env bash -# Install an older MacOS SDK - -OSX_SDK_DIR="$(xcode-select -p)/Platforms/MacOSX.platform/Developer/SDKs" -export MACOSX_DEPLOYMENT_TARGET=$1 -export MACOSX_SDK_VERSION=$MACOSX_DEPLOYMENT_TARGET - -export OSX_SYSROOT="${OSX_SDK_DIR}/MacOSX${MACOSX_SDK_VERSION}.sdk" -FILENAME="MacOSX${MACOSX_SDK_VERSION}.sdk.tar.xz" -DOWNLOAD_URL="https://github.com/phracker/MacOSX-SDKs/releases/download/10.15/${FILENAME}" - -if [[ ! -d ${OSX_SYSROOT}} ]]; then - echo "MacOS SDK ${MACOSX_SDK_VERSION} is missing, downloading..." - curl -L -O --connect-timeout 5 --max-time 10 --retry 10 --retry-delay 0 --retry-max-time 40 --retry-connrefused --retry-all-errors \ - ${DOWNLOAD_URL} - tar -xf ${FILENAME} -C "$(dirname ${OSX_SYSROOT})" -fi - -plutil -replace MinimumSDKVersion -string ${MACOSX_SDK_VERSION} $(xcode-select -p)/Platforms/MacOSX.platform/Info.plist -plutil -replace DTSDKName -string macosx${MACOSX_SDK_VERSION}internal $(xcode-select -p)/Platforms/MacOSX.platform/Info.plist - -echo "SDKROOT=${OSX_SYSROOT}" >> ${GITHUB_ENV} \ No newline at end of file diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 4088ef0b4..26d800446 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -61,11 +61,6 @@ jobs: HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 brew install grpcurl HOMEBREW_NO_INSTALLED_DEPENDENTS_CHECK=1 HOMEBREW_NO_AUTO_UPDATE=1 HOMEBREW_NO_INSTALL_CLEANUP=1 brew tap messense/macos-cross-toolchains && brew install x86_64-unknown-linux-musl npm i -g node-gyp - echo "Azaza" - protoc --version - which x86_64-w64-mingw32-gcc - which protoc - echo "Azaza2" if: runner.name != 'mac-mini-org-heart' - name: Checkout uses: actions/checkout@v3 @@ -76,9 +71,6 @@ jobs: key: ${{ runner.os }}-go-${{ matrix.go-version }}-${{ hashFiles('**/go.sum') }} restore-keys: | ${{ runner.os }}-go-${{ matrix.go-version }}- - - name: Install old MacOS SDK (for backward compatibility of CGO) - run: source .github/install_macos_sdk.sh 10.15 - if: runner.name != 'mac-mini-org-heart' - name: Set env vars env: UNSPLASH_KEY: ${{ secrets.UNSPLASH_KEY }} @@ -117,10 +109,10 @@ jobs: echo $FLAGS mkdir -p .release echo $SDKROOT - GOOS="darwin" GOARCH="amd64" CGO_ENABLED="1" go build -tags="envproduction nographviz nowatchdog nosigar nomutexdeadlockdetector" -ldflags="$FLAGS" -o darwin-amd64 github.com/anyproto/anytype-heart/cmd/grpcserver + GOOS="darwin" CGO_CFLAGS="-mmacosx-version-min=11" MACOSX_DEPLOYMENT_TARGET=11.0 GOARCH="amd64" CGO_ENABLED="1" go build -tags="envproduction nographviz nowatchdog nosigar nomutexdeadlockdetector" -ldflags="$FLAGS" -o darwin-amd64 github.com/anyproto/anytype-heart/cmd/grpcserver export SDKROOT=$(xcrun --sdk macosx --show-sdk-path) echo $SDKROOT - GOOS="darwin" GOARCH="arm64" CGO_ENABLED="1" go build -tags="envproduction nographviz nowatchdog nosigar nomutexdeadlockdetector" -ldflags="$FLAGS" -o darwin-arm64 github.com/anyproto/anytype-heart/cmd/grpcserver + GOOS="darwin" CGO_CFLAGS="-mmacosx-version-min=11" MACOSX_DEPLOYMENT_TARGET=11.0 GOARCH="arm64" CGO_ENABLED="1" go build -tags="envproduction nographviz nowatchdog nosigar nomutexdeadlockdetector" -ldflags="$FLAGS" -o darwin-arm64 github.com/anyproto/anytype-heart/cmd/grpcserver GOOS="windows" GOARCH="amd64" CGO_ENABLED="1" CC="x86_64-w64-mingw32-gcc" CXX="x86_64-w64-mingw32-g++" go build -tags="envproduction nographviz nowatchdog nosigar nomutexdeadlockdetector noheic" -ldflags="$FLAGS -linkmode external -extldflags=-static" -o windows-amd64 github.com/anyproto/anytype-heart/cmd/grpcserver GOOS="linux" GOARCH="amd64" CGO_ENABLED="1" CC="x86_64-linux-musl-gcc" go build -tags="envproduction nographviz nowatchdog nosigar nomutexdeadlockdetector noheic" -ldflags="$FLAGS -linkmode external -extldflags '-static -Wl,-z stack-size=1000000'" -o linux-amd64 github.com/anyproto/anytype-heart/cmd/grpcserver ls -lha . @@ -138,14 +130,14 @@ jobs: TEST_MNEMONIC: ${{ secrets.TEST_MNEMONIC }} PROM_KEY: ${{ secrets.PROMETHEUS_USERNAME }} PROM_PASSWORD: ${{ secrets.PROMETHEUS_PASSWORD }} - if: github.event.inputs.perf-test != '0' + if: github.event.inputs.perf-test != '0' || github.event_name == 'schedule' - name: Archive perf tests results uses: actions/upload-artifact@v4 with: name: pprofs path: | *.pprof - if: github.event.inputs.perf-test != '0' + if: github.event.inputs.perf-test != '0' || github.event_name == 'schedule' - name: end run perf tests run: | rm -rf *.pprof @@ -154,7 +146,7 @@ jobs: gh run watch ${{ github.run_id }} env: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - if: github.event.inputs.perf-test != '0' + if: github.event.inputs.perf-test != '0' || github.event_name == 'schedule' - name: Make JS protos run: | make protos-js @@ -224,8 +216,8 @@ jobs: cp pkg/lib/bundle/internalTypes.json ./json - name: Compile ios lib run: | - go install github.com/vektra/mockery/v2@v2.42.2 - go install go.uber.org/mock/mockgen@v0.3.0 + go install github.com/vektra/mockery/v2@v2.47.0 + go install go.uber.org/mock/mockgen@v0.5.0 make test-deps gomobile bind -tags "envproduction nogrpcserver gomobile nowatchdog nosigar nomutexdeadlockdetector timetzdata rasterizesvg" -ldflags "$FLAGS" -v -target=ios -o Lib.xcframework github.com/anyproto/anytype-heart/clientlibrary/service github.com/anyproto/anytype-heart/core || true mkdir -p dist/ios/ && mv Lib.xcframework dist/ios/ diff --git a/.github/workflows/golangci-lint.yml b/.github/workflows/golangci-lint.yml index bb8951895..3efd85138 100644 --- a/.github/workflows/golangci-lint.yml +++ b/.github/workflows/golangci-lint.yml @@ -29,6 +29,8 @@ jobs: run: go get ./... - name: golangci-lint uses: golangci/golangci-lint-action@v6 + env: + GOEXPERIMENT: "rangefunc" with: skip-cache: true version: latest diff --git a/.github/workflows/perftests.yml b/.github/workflows/perftests.yml index 19dd95162..8e698a480 100644 --- a/.github/workflows/perftests.yml +++ b/.github/workflows/perftests.yml @@ -75,7 +75,7 @@ jobs: echo "Running perf tests" RUN_COUNT=${{ github.event.inputs.perf-test }} if [[ "${{ github.event_name }}" == "schedule" ]]; then - RUN_COUNT=100 + RUN_COUNT=10 fi echo $PERF_CONFIG_STAGING > config.json mv .github/staging_fake.yml staging_fake.yml diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 693f490f9..dcbf95f16 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,6 +25,7 @@ jobs: with: go-version: 1.22 cache: false + check-latest: true - name: git config run: git config --global url.https://${{ secrets.ANYTYPE_PAT }}@github.com/.insteadOf https://github.com/ - name: Checkout code @@ -49,11 +50,11 @@ jobs: cd .. gem install license_finder license_finder inherited_decisions add open/decisions.yml - license_finder --enabled-package-managers gomodules + GOEXPERIMENT=rangefunc license_finder --enabled-package-managers gomodules - name: Generate mocks run: | make download-tantivy-all - go install go.uber.org/mock/mockgen@v0.3.0 + go install go.uber.org/mock/mockgen@v0.5.0 CGO_ENABLED=1 CGO_CFLAGS="-Wno-deprecated-declarations -Wno-deprecated-non-prototype -Wno-xor-used-as-pow" go generate ./... - name: Go test env: @@ -71,7 +72,7 @@ jobs: else echo "run without race detector" fi - CGO_CFLAGS="-Wno-deprecated-non-prototype -Wno-unknown-warning-option -Wno-deprecated-declarations -Wno-xor-used-as-pow -Wno-single-bit-bitfield-constant-conversion" gotestsum --junitfile ~/gotestsum-report/gotestsum-report.xml -- -tags "nogrpcserver nographviz" -ldflags="-extldflags=-Wl,-ld_classic" -p 1 $(echo $PACKAGE_NAMES) $(echo $RACE) -coverprofile=coverage.out -covermode=atomic ./... + GOEXPERIMENT=rangefunc CGO_CFLAGS="-Wno-deprecated-non-prototype -Wno-unknown-warning-option -Wno-deprecated-declarations -Wno-xor-used-as-pow -Wno-single-bit-bitfield-constant-conversion" gotestsum --junitfile ~/gotestsum-report/gotestsum-report.xml -- -tags "nogrpcserver nographviz" -p 1 $(echo $PACKAGE_NAMES) $(echo $RACE) -coverprofile=coverage.out -covermode=atomic ./... generated_pattern='^\/\/ Code generated .* DO NOT EDIT\.$' files_list=$(grep -rl "$generated_pattern" . | grep '\.go$' | sed 's/^\.\///') @@ -89,4 +90,4 @@ jobs: with: report_paths: '~/gotestsum-report/gotestsum-report.xml' github_token: ${{ secrets.GITHUB_TOKEN }} - - uses: seriousben/go-patch-cover-action@v1 \ No newline at end of file + - uses: seriousben/go-patch-cover-action@v1 diff --git a/.run/Run.run.xml b/.run/Run.run.xml index 0595d2c20..97af17e13 100644 --- a/.run/Run.run.xml +++ b/.run/Run.run.xml @@ -2,7 +2,7 @@ - + @@ -11,6 +11,7 @@ +