From 80e184154bfd14488c0c0b99e303699d43be2392 Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 12 Feb 2024 10:41:37 -0500 Subject: [PATCH 1/3] Use LL_BUILD_RELEASE for macOS and Linux as well as Windows. On all platforms, use NickyD's tactic for segregating build products from source code. --- build-cmd.sh | 31 +++++++++++++------------------ 1 file changed, 13 insertions(+), 18 deletions(-) diff --git a/build-cmd.sh b/build-cmd.sh index 1900f04..881af9e 100644 --- a/build-cmd.sh +++ b/build-cmd.sh @@ -27,6 +27,9 @@ source_environment_tempfile="$stage/source_environment.sh" "$autobuild" source_environment > "$source_environment_tempfile" . "$source_environment_tempfile" +# remove_cxxstd +source "$(dirname "$AUTOBUILD_VARIABLES_FILE")/functions" + LUAU_VERSION="0.609" build=${AUTOBUILD_BUILD_ID:=0} @@ -41,15 +44,18 @@ pushd "$top/luau" cp -v luacode.h "$stage/include/luau/" popd + # Don't litter the source directory with build artifacts + mkdir -p ../build + cd ../build case "$AUTOBUILD_PLATFORM" in windows*) set -o igncr opts="$LL_BUILD_RELEASE /EHsc" cmake -G "$AUTOBUILD_WIN_CMAKE_GEN" -A "$AUTOBUILD_WIN_VSPLATFORM" \ -DCMAKE_INSTALL_PREFIX="$(cygpath -m "$stage")" \ - -DCMAKE_C_FLAGS="$opts" \ + -DCMAKE_C_FLAGS="$(remove_cxxstd $opts)" \ -DCMAKE_CXX_FLAGS="$opts" \ - . + ../luau cmake --build . -- /p:Configuration=Release cmake --build . --target Luau.Repl.CLI -- /p:Configuration=Release @@ -63,8 +69,11 @@ pushd "$top/luau" cp -v Release/luau.exe "$stage/bin/" ;; - darwin*) - cmake . -DCMAKE_INSTALL_PREFIX:STRING="${stage}" + darwin*|linux64*) + cmake -DCMAKE_INSTALL_PREFIX:STRING="${stage}" \ + -DCMAKE_CXX_FLAGS="$LL_BUILD_RELEASE" \ + -DCMAKE_C_FLAGS="$(remove_cxxstd $LL_BUILD_RELEASE)" \ + ../luau cmake --build . --target Luau.Repl.CLI cp -v "libLuau.Ast.a" "$stage/lib/release" @@ -73,20 +82,6 @@ pushd "$top/luau" cp -v "libLuau.Config.a" "$stage/lib/release" cp -v "libLuau.VM.a" "$stage/lib/release" ;; - linux64) - # Don't litter the source directory with build artifacts - mkdir -p ../build - pushd ../build - cmake ../luau -DCMAKE_INSTALL_PREFIX:STRING="${stage}" - cmake --build . --target Luau.Repl.CLI - - cp -v "libLuau.Ast.a" "$stage/lib/release" - cp -v "libLuau.CodeGen.a" "$stage/lib/release" - cp -v "libLuau.Compiler.a" "$stage/lib/release" - cp -v "libLuau.Config.a" "$stage/lib/release" - cp -v "libLuau.VM.a" "$stage/lib/release" - popd - ;; esac popd From 59393c9a25caa3b9ca227383cad2d31fc774899f Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 12 Feb 2024 10:53:24 -0500 Subject: [PATCH 2/3] Try to conform more closely to semantic versioning convention. --- build-cmd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build-cmd.sh b/build-cmd.sh index 881af9e..fa0e9e4 100644 --- a/build-cmd.sh +++ b/build-cmd.sh @@ -85,6 +85,6 @@ pushd "$top/luau" esac popd -echo "$LUAU_VERSION.$build" > "$stage/VERSION.txt" +echo "$LUAU_VERSION-$build" > "$stage/VERSION.txt" mkdir -p "$stage/LICENSES" cp "$top/LICENSE" "$stage/LICENSES/luau.txt" From 9c7d705132ace6958cd671a38e051d81fbb0712d Mon Sep 17 00:00:00 2001 From: Nat Goodspeed Date: Mon, 12 Feb 2024 10:57:55 -0500 Subject: [PATCH 3/3] Allow tag builds for v0.609-hash, et al. --- .github/workflows/build.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index f18697c..802b735 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -4,7 +4,7 @@ on: pull_request: push: branches: [main] - tags: ["v*.*.*"] + tags: ["v*.*"] jobs: build: