From 268a25f59cd4790ef5896ddd237f0bc48f6fad26 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Mon, 25 Sep 2023 09:53:59 +0200 Subject: [PATCH 1/5] Indent each line of an error message By indenting each line instead of just the first, we simplify the work of the gf-lsp parser, so we can see which errors are the same --- src/compiler/GF/Compile/GetGrammar.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/compiler/GF/Compile/GetGrammar.hs b/src/compiler/GF/Compile/GetGrammar.hs index 191c3aff92..a7fd3de72b 100644 --- a/src/compiler/GF/Compile/GetGrammar.hs +++ b/src/compiler/GF/Compile/GetGrammar.hs @@ -42,11 +42,12 @@ getSourceModule opts file0 = raw <- liftIO $ keepTemp tmp --ePutStrLn $ "1 "++file0 (optCoding,parsed) <- parseSource opts pModDef raw + let indentLines = unlines . map (" "++) . lines case parsed of Left (Pn l c,msg) -> do file <- liftIO $ writeTemp tmp cwd <- getCurrentDirectory let location = makeRelative cwd file++":"++show l++":"++show c - raise (location++":\n "++msg) + raise (location++":\n" ++ indentLines msg) Right (i,mi0) -> do liftIO $ removeTemp tmp let mi =mi0 {mflags=mflags mi0 `addOptions` opts, msrc=file0} From ea3cef46b0f86a87207e512e8413929567ba9c4a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Mon, 25 Sep 2023 12:01:56 +0200 Subject: [PATCH 2/5] Update test to match new error --- testsuite/compiler/update/ArrityCheck.gfs.gold | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/testsuite/compiler/update/ArrityCheck.gfs.gold b/testsuite/compiler/update/ArrityCheck.gfs.gold index 7e0ff3d44d..bfe3808ab7 100644 --- a/testsuite/compiler/update/ArrityCheck.gfs.gold +++ b/testsuite/compiler/update/ArrityCheck.gfs.gold @@ -2,7 +2,8 @@ testsuite/compiler/update/ArrityCheck.gf:6:1: conflicting information in module ArrityCheck - fun f : Int -> Int -> Int ; - def f 0 = \x -> x ; -and - def f 1 1 = 0 ; + fun f : Int -> Int -> Int ; + def f 0 = \x -> x ; + and + def f 1 1 = 0 ; + From 30c13762329d406c4dc155d72767ee407ab590e0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Mon, 25 Sep 2023 12:43:19 +0200 Subject: [PATCH 3/5] Don't build twice for tests in CI --- .github/workflows/build-all-versions.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/build-all-versions.yml b/.github/workflows/build-all-versions.yml index f6f1b82a7d..2bd856b7ce 100644 --- a/.github/workflows/build-all-versions.yml +++ b/.github/workflows/build-all-versions.yml @@ -95,8 +95,7 @@ jobs: - name: Build run: | - stack build --system-ghc --stack-yaml stack-ghc${{ matrix.ghc }}.yaml - # stack build --system-ghc --test --bench --no-run-tests --no-run-benchmarks + stack build --test --no-run-tests --system-ghc --stack-yaml stack-ghc${{ matrix.ghc }}.yaml - name: Test run: | From 37f06a4ae845471009610d79d616eab0bdd903d3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Mon, 25 Sep 2023 12:48:56 +0200 Subject: [PATCH 4/5] gh-actions: Don't use ubuntu-18 and macos-10.15 There are no longer any gihub actions runners available for these Note that this means we can't build for ubuntu-18 anymore, but that should hopefully no longer be relevant, since it's over 5 years old now. --- .github/workflows/build-binary-packages.yml | 2 +- .github/workflows/build-python-package.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-binary-packages.yml b/.github/workflows/build-binary-packages.yml index 493d5e7747..d476aa1616 100644 --- a/.github/workflows/build-binary-packages.yml +++ b/.github/workflows/build-binary-packages.yml @@ -14,8 +14,8 @@ jobs: strategy: matrix: os: - - ubuntu-18.04 - ubuntu-20.04 + - ubuntu-22.04 runs-on: ${{ matrix.os }} diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index 67cbba6dd7..0f6e3c0504 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -13,7 +13,7 @@ jobs: strategy: fail-fast: true matrix: - os: [ubuntu-18.04, macos-10.15] + os: [ubuntu-latest, macos-latest] steps: - uses: actions/checkout@v1 From cf1ef40789fc6761e46ecac1215cdb018972f2ae Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=A4llberg?= Date: Mon, 25 Sep 2023 12:53:55 +0200 Subject: [PATCH 5/5] gh-actions: Bump the python version cibuildwheel requires python >= 3.8 --- .github/workflows/build-python-package.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-python-package.yml b/.github/workflows/build-python-package.yml index 0f6e3c0504..5e484bdd03 100644 --- a/.github/workflows/build-python-package.yml +++ b/.github/workflows/build-python-package.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/setup-python@v1 name: Install Python with: - python-version: '3.7' + python-version: '3.x' - name: Install cibuildwheel run: | @@ -59,7 +59,7 @@ jobs: - uses: actions/setup-python@v2 name: Install Python with: - python-version: '3.7' + python-version: '3.x' - name: Build sdist run: cd src/runtime/python && python setup.py sdist