From 937be3f65b164015bda157d3b0fc5bd5d56cf0ea Mon Sep 17 00:00:00 2001 From: Anton-4 <17049058+Anton-4@users.noreply.github.com> Date: Sat, 24 Dec 2022 15:30:12 +0100 Subject: [PATCH] progress towards bundling --- .github/workflows/basic_cli_build_release.yml | 20 +++++++++++++++---- .../test_nightly_macos_apple_silicon.yml | 2 +- ci/build_basic_cli.sh | 6 ++++++ 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/.github/workflows/basic_cli_build_release.yml b/.github/workflows/basic_cli_build_release.yml index 0151e94c01..5bf8987683 100644 --- a/.github/workflows/basic_cli_build_release.yml +++ b/.github/workflows/basic_cli_build_release.yml @@ -17,9 +17,9 @@ jobs: - run: cat roc_releases.json - - run: ./ci/build_basic_cli.sh linux_x86_64 + # does a build with the surgical linker and also with the legacy linker + - run: ./ci/build_basic_cli.sh linux_x86_64 "--linker legacy" - #TODO add linux-x86_64.o? - name: Save .rh1 and .rm1 files uses: actions/upload-artifact@v3 with: @@ -27,6 +27,7 @@ jobs: path: | basic-cli/src/linux-x86_64.rh1 basic-cli/src/metadata_linux-x86_64.rm1 + basic-cli/src/linux-x86_64.o build-macos-x86_64-files: runs-on: [macos-11] # I expect the generated files to work on macOS 12 @@ -76,14 +77,25 @@ jobs: steps: - uses: actions/checkout@v3 + - name: remove all folders except the ci folder + run: shopt -s extglob && rm -r ./!(ci)/ + - name: fetch releases data and save to file run: curl https://api.github.com/repos/roc-lang/roc/releases > roc_releases.json - - run: ./ci/get_latest_release_url.sh linux_x86_64 + - run: echo "ROC_RELEASE_URL=$(./ci/get_latest_release_url.sh linux_x86_64)" >> $GITHUB_ENV - #- run: git clone https://github.com/roc-lang/basic-cli.git + - name: Get the archive from the url. + run: curl -OL ${{ env.ROC_RELEASE_URL }} + + - name: decompress the tar + run: ls | grep "roc_nightly.*tar\.gz" | xargs tar -xzvf + + - run: git clone https://github.com/roc-lang/basic-cli.git - name: Download the previously uploaded files uses: actions/download-artifact@v3 - run: ls + + - run: ls linux-x86_64-files diff --git a/.github/workflows/test_nightly_macos_apple_silicon.yml b/.github/workflows/test_nightly_macos_apple_silicon.yml index bcff14d4f9..d84f818bda 100644 --- a/.github/workflows/test_nightly_macos_apple_silicon.yml +++ b/.github/workflows/test_nightly_macos_apple_silicon.yml @@ -16,7 +16,7 @@ jobs: run: curl https://api.github.com/repos/roc-lang/roc/releases > roc_releases.json - name: get the url of today`s release for macos apple silicon - run: echo "RELEASE_URL=$(./ci/get_loday_release_url.sh silicon)" >> $GITHUB_ENV + run: echo "RELEASE_URL=$(./ci/get_today_release_url.sh silicon)" >> $GITHUB_ENV - name: Get the archive from the url. run: curl -OL ${{ env.RELEASE_URL }} diff --git a/ci/build_basic_cli.sh b/ci/build_basic_cli.sh index 5b59e27d65..3235ff9186 100755 --- a/ci/build_basic_cli.sh +++ b/ci/build_basic_cli.sh @@ -16,4 +16,10 @@ ls | grep "roc_nightly.*tar\.gz" | xargs tar -xzvf # build the basic cli platform ./roc build ../basic-cli/examples/file.roc + +# In some rare cases it's nice to be able to use the legacy linker, so we produce the .o file to be able to do that +if [ -n "$2" ]; then + ./roc build $2 ../basic-cli/examples/file.roc +fi + cd ..