diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index 8eacb004f..2ff13fd19 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -41,8 +41,8 @@ Note: In the development environment, the kernel process will not be automatical ### Desktop * `cd kernel` -* Windows: `go build --tags "fts5" -o "../app/kernel/SiYuan-Kernel.exe"` -* Linux/macOS: `go build --tags "fts5" -o "../app/kernel/SiYuan-Kernel"` +* Windows: `go build -tags "fts5" -o "../app/kernel/SiYuan-Kernel.exe"` +* Linux/macOS: `go build -tags "fts5" -o "../app/kernel/SiYuan-Kernel"` * `cd ../app/kernel` * Windows: `./SiYuan-Kernel.exe --wd=.. --mode=dev` * Linux/macOS: `./SiYuan-Kernel --wd=.. --mode=dev` @@ -50,14 +50,14 @@ Note: In the development environment, the kernel process will not be automatical ### iOS * `cd kernel` -* `gomobile bind --tags fts5 -ldflags '-s -w' -v -o ./ios/iosk.xcframework -target=ios ./mobile/` +* `gomobile bind -tags fts5 -ldflags '-s -w' -v -o ./ios/iosk.xcframework -target=ios ./mobile/` * https://github.com/siyuan-note/siyuan-ios ### Android * `cd kernel` * `set JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8` -* `gomobile bind --tags fts5 -ldflags "-s -w" -v -o kernel.aar -target=android/arm64 -androidapi 26 ./mobile/` +* `gomobile bind -tags fts5 -ldflags "-s -w" -v -o kernel.aar -target=android/arm64 -androidapi 26 ./mobile/` * https://github.com/siyuan-note/siyuan-android ### Harmony diff --git a/.github/CONTRIBUTING_zh_CN.md b/.github/CONTRIBUTING_zh_CN.md index 34723b473..e4b189f80 100644 --- a/.github/CONTRIBUTING_zh_CN.md +++ b/.github/CONTRIBUTING_zh_CN.md @@ -41,8 +41,8 @@ NPM 镜像: ### 桌面端 * `cd kernel` -* Windows: `go build --tags "fts5" -o "../app/kernel/SiYuan-Kernel.exe"` -* Linux/macOS: `go build --tags "fts5" -o "../app/kernel/SiYuan-Kernel"` +* Windows: `go build -tags "fts5" -o "../app/kernel/SiYuan-Kernel.exe"` +* Linux/macOS: `go build -tags "fts5" -o "../app/kernel/SiYuan-Kernel"` * `cd ../app/kernel` * Windows: `./SiYuan-Kernel.exe --wd=.. --mode=dev` * Linux/macOS: `./SiYuan-Kernel --wd=.. --mode=dev` @@ -50,14 +50,14 @@ NPM 镜像: ### iOS * `cd kernel` -* `gomobile bind --tags fts5 -ldflags '-s -w' -v -o ./ios/iosk.xcframework -target=ios ./mobile/` +* `gomobile bind -tags fts5 -ldflags '-s -w' -v -o ./ios/iosk.xcframework -target=ios ./mobile/` * https://github.com/siyuan-note/siyuan-ios ### Android * `cd kernel` * `set JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8` -* `gomobile bind --tags fts5 -ldflags "-s -w" -v -o kernel.aar -target=android/arm64 -androidapi 26 ./mobile/` +* `gomobile bind -tags fts5 -ldflags "-s -w" -v -o kernel.aar -target=android/arm64 -androidapi 26 ./mobile/` * https://github.com/siyuan-note/siyuan-android ### Harmony diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 8219f4683..242b0634b 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -213,7 +213,7 @@ jobs: working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/kernel - name: Building Kernel - run: go build --tags fts5 -o "${{ matrix.config.kernel_path }}" -v -ldflags "${{ matrix.config.build_args_prefix }} github.com/${{ github.repository }}/kernel/util.${{ matrix.config.build_args_suffix }}" + run: go build -tags fts5 -o "${{ matrix.config.kernel_path }}" -v -ldflags "${{ matrix.config.build_args_prefix }} github.com/${{ github.repository }}/kernel/util.${{ matrix.config.build_args_suffix }}" working-directory: ${{ github.workspace }}/go/src/github.com/${{ github.repository }}/kernel env: GO111MODULE: on diff --git a/Dockerfile b/Dockerfile index fad8d1389..6b176f34d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -37,7 +37,7 @@ RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/g ADD kernel/ . RUN --mount=type=cache,target=/root/.cache/go-build --mount=type=cache,target=/go/pkg \ - go build --tags fts5 -v -ldflags "-s -w" + go build -tags fts5 -v -ldflags "-s -w" FROM alpine:latest LABEL maintainer="Liang Ding<845765@qq.com>" diff --git a/kernel/harmony/build-win.sh b/kernel/harmony/build-win.sh index d8846b954..d8b968358 100755 --- a/kernel/harmony/build-win.sh +++ b/kernel/harmony/build-win.sh @@ -24,4 +24,4 @@ export GOARCH=amd64 export CGO_CFLAGS="-I${LOG_ADAPTOR_HOME}/include -g -O2 `$LLVMCONFIG --cflags` --target=x86_64-linux-ohos --sysroot=$OHOS_NDK_HOME/native/sysroot" export CGO_LDFLAGS="--target=x86_64-linux-ohos -fuse-ld=lld -L${LOG_ADAPTOR_HOME}/dist/x86_64" -go build --tags fts5 -ldflags "-s -w" -buildmode=c-shared -v -o libkernel.so . +go build -tags fts5 -ldflags "-s -w" -buildmode=c-shared -v -o libkernel.so . diff --git a/kernel/harmony/build.sh b/kernel/harmony/build.sh index 290c2998d..c4b26c2e8 100755 --- a/kernel/harmony/build.sh +++ b/kernel/harmony/build.sh @@ -24,5 +24,5 @@ export GOARCH=arm64 export CGO_CFLAGS="-I${LOG_ADAPTOR_HOME}/include -g -O2 `$LLVMCONFIG --cflags` --target=aarch64-linux-ohos --sysroot=$OHOS_NDK_HOME/native/sysroot" export CGO_LDFLAGS="--target=aarch64-linux-ohos -fuse-ld=lld -L${LOG_ADAPTOR_HOME}/dist/arm64-v8a" -go build --tags fts5 -ldflags "-s -w" -buildmode=c-shared -v -o libkernel.so . -#go build --tags fts5 -buildmode=c-shared -v -o libkernel.so . +go build -tags fts5 -ldflags "-s -w" -buildmode=c-shared -v -o libkernel.so . +#go build -tags fts5 -buildmode=c-shared -v -o libkernel.so . diff --git a/scripts/darwin-build.sh b/scripts/darwin-build.sh index fd59c1237..1de95e9e1 100755 --- a/scripts/darwin-build.sh +++ b/scripts/darwin-build.sh @@ -70,13 +70,13 @@ if [[ "$TARGET" == 'amd64' || "$TARGET" == 'all' ]]; then echo echo 'Building Kernel amd64' export GOARCH=amd64 - go build --tags fts5 -v -o "../app/kernel-darwin/SiYuan-Kernel" -ldflags "-s -w" . + go build -tags fts5 -v -o "../app/kernel-darwin/SiYuan-Kernel" -ldflags "-s -w" . fi if [[ "$TARGET" == 'arm64' || "$TARGET" == 'all' ]]; then echo echo 'Building Kernel arm64' export GOARCH=arm64 - go build --tags fts5 -v -o "../app/kernel-darwin-arm64/SiYuan-Kernel" -ldflags "-s -w" . + go build -tags fts5 -v -o "../app/kernel-darwin-arm64/SiYuan-Kernel" -ldflags "-s -w" . fi echo diff --git a/scripts/linux-build.sh b/scripts/linux-build.sh index d0d85aa6a..6f514a4ee 100755 --- a/scripts/linux-build.sh +++ b/scripts/linux-build.sh @@ -71,14 +71,14 @@ if [[ "$TARGET" == 'amd64' || "$TARGET" == 'all' ]]; then echo 'Building Kernel amd64' export GOARCH=amd64 export CC=~/x86_64-linux-musl-cross/bin/x86_64-linux-musl-gcc - go build -buildmode=pie --tags fts5 -v -o "../app/kernel-linux/SiYuan-Kernel" -ldflags "-s -w -extldflags -static-pie" . + go build -buildmode=pie -tags fts5 -v -o "../app/kernel-linux/SiYuan-Kernel" -ldflags "-s -w -extldflags -static-pie" . fi if [[ "$TARGET" == 'arm64' || "$TARGET" == 'all' ]]; then echo echo 'Building Kernel arm64' export GOARCH=arm64 export CC=~/aarch64-linux-musl-cross/bin/aarch64-linux-musl-gcc - go build -buildmode=pie --tags fts5 -v -o "../app/kernel-linux-arm64/SiYuan-Kernel" -ldflags "-s -w -extldflags -static-pie" . + go build -buildmode=pie -tags fts5 -v -o "../app/kernel-linux-arm64/SiYuan-Kernel" -ldflags "-s -w -extldflags -static-pie" . fi echo diff --git a/scripts/win-build.bat b/scripts/win-build.bat index 5fde82d18..402ce8698 100755 --- a/scripts/win-build.bat +++ b/scripts/win-build.bat @@ -101,7 +101,7 @@ if defined BUILD_AMD64 ( echo. echo Building Kernel amd64 set GOARCH=amd64 - go build --tags fts5 -v -o "%PROJECT_ROOT%\app\kernel\SiYuan-Kernel.exe" -ldflags "-s -w -H=windowsgui" . + go build -tags fts5 -v -o "%PROJECT_ROOT%\app\kernel\SiYuan-Kernel.exe" -ldflags "-s -w -H=windowsgui" . if errorlevel 1 ( exit /b %errorlevel% ) @@ -112,7 +112,7 @@ if defined BUILD_ARM64 ( set GOARCH=arm64 @REM if you want to build arm64, you need to install aarch64-w64-mingw32-gcc set CC="D:/Program Files/llvm-mingw-20240518-ucrt-x86_64/bin/aarch64-w64-mingw32-gcc.exe" - go build --tags fts5 -v -o "%PROJECT_ROOT%\app\kernel-arm64\SiYuan-Kernel.exe" -ldflags "-s -w -H=windowsgui" . + go build -tags fts5 -v -o "%PROJECT_ROOT%\app\kernel-arm64\SiYuan-Kernel.exe" -ldflags "-s -w -H=windowsgui" . if errorlevel 1 ( exit /b %errorlevel% )