From 67276250a845ed3e038e07771c81e2edfdbbb9b1 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Wed, 8 Jul 2020 17:52:06 -0400 Subject: [PATCH 01/40] Let's see if a Bazel build works. --- .github/workflows/bazel.yml | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 .github/workflows/bazel.yml diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml new file mode 100644 index 000000000..10c0fe9c5 --- /dev/null +++ b/.github/workflows/bazel.yml @@ -0,0 +1,36 @@ +name: Haskell CI + +on: + # Trigger the workflow on push or pull request, + # but only for the master branch + push: + branches: + - master + pull_request: + +jobs: + build: + name: ghc ${{ matrix.ghc }} + runs-on: ubuntu-latest + strategy: + + steps: + - uses: actions/checkout@v2 + if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' + + - uses: actions/cache@v1 + id: cache-cabal + name: Cache Cabal artifacts + with: + path: .bazel-cache + key: ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-cabal-cache-${{ hashFiles('semantic-*/**/*.hs') }}-${{ hashFiles('**/BUILD.bazel') }} + restore-keys: | + ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-cabal-cache- + ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}- + ${{ runner.os }}-${{ matrix.ghc }}- + ${{ runner.os }}- + + - name: Build & test + run: | + bazel build //... + bazel test //... From 7833f3ff1770b33ec98020a4268a18744adf5316 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Wed, 8 Jul 2020 17:54:56 -0400 Subject: [PATCH 02/40] Better caching strategy --- .github/workflows/bazel.yml | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 10c0fe9c5..1dc065c0f 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -10,7 +10,7 @@ on: jobs: build: - name: ghc ${{ matrix.ghc }} + name: Bazel runs-on: ubuntu-latest strategy: @@ -20,15 +20,12 @@ jobs: - uses: actions/cache@v1 id: cache-cabal - name: Cache Cabal artifacts + name: Cache Bazel artifacts with: path: .bazel-cache - key: ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-cabal-cache-${{ hashFiles('semantic-*/**/*.hs') }}-${{ hashFiles('**/BUILD.bazel') }} + key: ${{ runner.os }}-bazel-${{ hashFiles('semantic-*/**/*.hs') }}-${{ hashFiles('**/BUILD.bazel') }} restore-keys: | - ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}-cabal-cache- - ${{ runner.os }}-${{ matrix.ghc }}-${{ matrix.cabal }}- - ${{ runner.os }}-${{ matrix.ghc }}- - ${{ runner.os }}- + ${{ runner.os }}-bazel- - name: Build & test run: | From e83e13907c7079ce6de336c5ddc7011f7cc8778a Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Wed, 8 Jul 2020 17:56:46 -0400 Subject: [PATCH 03/40] better naming --- .github/workflows/bazel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 1dc065c0f..256e34349 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -1,4 +1,4 @@ -name: Haskell CI +name: Bazel CI on: # Trigger the workflow on push or pull request, From 88b91ba0af9edcfca95b94cb0c842a65421adfc2 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Thu, 9 Jul 2020 09:45:52 -0400 Subject: [PATCH 04/40] can't have an empty strategy --- .github/workflows/bazel.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 256e34349..55e0eda96 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -12,7 +12,6 @@ jobs: build: name: Bazel runs-on: ubuntu-latest - strategy: steps: - uses: actions/checkout@v2 From 97432817f5c5617e0d90bc2482f8893aee99fd81 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Thu, 9 Jul 2020 10:25:21 -0400 Subject: [PATCH 05/40] dummy commit to force rebuild --- docs/build.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/build.md b/docs/build.md index 87a0d9530..28151f0c2 100644 --- a/docs/build.md +++ b/docs/build.md @@ -42,6 +42,7 @@ If this seems complicated, don't worry: most of the time you'll be able to skip 3. **Some packages come with GHC and are not loaded from Stackage**. These include `base`, `containers`, and [others](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/8.10.1-notes.html?highlight=bytestring#included-libraries). To depend on those packages, you use `//:base`, `//:containers`, etc. They are specified in the `BAZEL.build` at the project root. You probably won't need to add any more. 4. **Getting weird errors from the C compiler?** Try setting `export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1` in your `.profile` or whatnot. + ## Quick reference links * **Bazel manual**: https://docs.bazel.build/versions/3.3.0/bazel-overview.html From cc97854a9bb9a9524e0cf9c840e44b730ee0ce43 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Thu, 9 Jul 2020 10:34:17 -0400 Subject: [PATCH 06/40] Store bazel-repo in the cache as well. --- .bazelrc | 2 +- .github/workflows/bazel.yml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.bazelrc b/.bazelrc index c2907ea7a..666114167 100644 --- a/.bazelrc +++ b/.bazelrc @@ -5,7 +5,7 @@ common:ci --color=no test:ci --test_output=errors build --disk_cache=.bazel-cache/bazel-disk -build --repository_cache=tmp/bazel-repo +build --repository_cache=.bazel-cache/bazel-repo build --color=yes build --jobs=8 build --compilation_mode=fastbuild diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 55e0eda96..d0925471e 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -28,5 +28,5 @@ jobs: - name: Build & test run: | - bazel build //... - bazel test //... + bazel build --config=ci //... + bazel test --config=ci //... From 4e06d55d26f988e790fd5ccf34c5fc66d7e69d32 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Thu, 9 Jul 2020 10:43:34 -0400 Subject: [PATCH 07/40] Revert "dummy commit to force rebuild" This reverts commit 97432817f5c5617e0d90bc2482f8893aee99fd81. --- docs/build.md | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/build.md b/docs/build.md index 28151f0c2..87a0d9530 100644 --- a/docs/build.md +++ b/docs/build.md @@ -42,7 +42,6 @@ If this seems complicated, don't worry: most of the time you'll be able to skip 3. **Some packages come with GHC and are not loaded from Stackage**. These include `base`, `containers`, and [others](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/8.10.1-notes.html?highlight=bytestring#included-libraries). To depend on those packages, you use `//:base`, `//:containers`, etc. They are specified in the `BAZEL.build` at the project root. You probably won't need to add any more. 4. **Getting weird errors from the C compiler?** Try setting `export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1` in your `.profile` or whatnot. - ## Quick reference links * **Bazel manual**: https://docs.bazel.build/versions/3.3.0/bazel-overview.html From c3b9579bfb2866585e8c9ab9b12b6b96c90029bb Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Thu, 9 Jul 2020 10:45:53 -0400 Subject: [PATCH 08/40] should use something hashable --- semantic/src/Semantic/Api/Symbols.hs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/semantic/src/Semantic/Api/Symbols.hs b/semantic/src/Semantic/Api/Symbols.hs index fdcee9cfa..ac76b536a 100644 --- a/semantic/src/Semantic/Api/Symbols.hs +++ b/semantic/src/Semantic/Api/Symbols.hs @@ -41,6 +41,8 @@ import Serializing.Format (Format) import Source.Loc as Loc import Tags.Tagging.Precise +-- dummy commit + parseSymbolsBuilder :: (Has Distribute sig m, Has (Error SomeException) sig m, Has Parse sig m, Has (Reader Config) sig m, Traversable t) => Format ParseTreeSymbolResponse -> t Blob -> m Builder parseSymbolsBuilder format blobs = parseSymbols blobs >>= serialize format From ce54883c44093bb378dafe0ed4fbbcde787da364 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Thu, 9 Jul 2020 10:47:37 -0400 Subject: [PATCH 09/40] Revert "should use something hashable" This reverts commit c3b9579bfb2866585e8c9ab9b12b6b96c90029bb. --- semantic/src/Semantic/Api/Symbols.hs | 2 -- 1 file changed, 2 deletions(-) diff --git a/semantic/src/Semantic/Api/Symbols.hs b/semantic/src/Semantic/Api/Symbols.hs index ac76b536a..fdcee9cfa 100644 --- a/semantic/src/Semantic/Api/Symbols.hs +++ b/semantic/src/Semantic/Api/Symbols.hs @@ -41,8 +41,6 @@ import Serializing.Format (Format) import Source.Loc as Loc import Tags.Tagging.Precise --- dummy commit - parseSymbolsBuilder :: (Has Distribute sig m, Has (Error SomeException) sig m, Has Parse sig m, Has (Reader Config) sig m, Traversable t) => Format ParseTreeSymbolResponse -> t Blob -> m Builder parseSymbolsBuilder format blobs = parseSymbols blobs >>= serialize format From d150bb59866218c80f6f9ef891c31ea8f97ee7ca Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Thu, 9 Jul 2020 10:59:30 -0400 Subject: [PATCH 10/40] This will absolutely blow the cache. It better. --- .github/workflows/bazel.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index d0925471e..ba2a38e51 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -22,8 +22,10 @@ jobs: name: Cache Bazel artifacts with: path: .bazel-cache - key: ${{ runner.os }}-bazel-${{ hashFiles('semantic-*/**/*.hs') }}-${{ hashFiles('**/BUILD.bazel') }} + key: ${{ runner.os }}-bazel-${{ hashFiles('semantic-*/**/*.hs') }}-${{ hashFiles('**/*.bazel') }}-${{ hashFiles('**/*.bzl') }} restore-keys: | + ${{ runner.os }}-bazel-${{ hashFiles('semantic-*/**/*.hs') }}-${{ hashFiles('**/*.bazel') }}- + ${{ runner.os }}-bazel-${{ hashFiles('semantic-*/**/*.hs') }}- ${{ runner.os }}-bazel- - name: Build & test From ae87e2f875c5c8b2a594f9587d9554cf134203c7 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Thu, 9 Jul 2020 11:19:35 -0400 Subject: [PATCH 11/40] one more dummy commit --- docs/build.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/build.md b/docs/build.md index 87a0d9530..d8071f157 100644 --- a/docs/build.md +++ b/docs/build.md @@ -42,6 +42,8 @@ If this seems complicated, don't worry: most of the time you'll be able to skip 3. **Some packages come with GHC and are not loaded from Stackage**. These include `base`, `containers`, and [others](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/8.10.1-notes.html?highlight=bytestring#included-libraries). To depend on those packages, you use `//:base`, `//:containers`, etc. They are specified in the `BAZEL.build` at the project root. You probably won't need to add any more. 4. **Getting weird errors from the C compiler?** Try setting `export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1` in your `.profile` or whatnot. + + ## Quick reference links * **Bazel manual**: https://docs.bazel.build/versions/3.3.0/bazel-overview.html From 9056a8ca225384343c87944d53bf4c46d7093e85 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Thu, 9 Jul 2020 11:40:20 -0400 Subject: [PATCH 12/40] Revert "one more dummy commit" This reverts commit ae87e2f875c5c8b2a594f9587d9554cf134203c7. --- docs/build.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/docs/build.md b/docs/build.md index d8071f157..87a0d9530 100644 --- a/docs/build.md +++ b/docs/build.md @@ -42,8 +42,6 @@ If this seems complicated, don't worry: most of the time you'll be able to skip 3. **Some packages come with GHC and are not loaded from Stackage**. These include `base`, `containers`, and [others](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/8.10.1-notes.html?highlight=bytestring#included-libraries). To depend on those packages, you use `//:base`, `//:containers`, etc. They are specified in the `BAZEL.build` at the project root. You probably won't need to add any more. 4. **Getting weird errors from the C compiler?** Try setting `export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1` in your `.profile` or whatnot. - - ## Quick reference links * **Bazel manual**: https://docs.bazel.build/versions/3.3.0/bazel-overview.html From 60a9baf79931bf0876922bb598f6d1b01f9c6642 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 10:14:50 -0400 Subject: [PATCH 13/40] Cut down on Bazel time --- .github/workflows/bazel.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index ba2a38e51..f9bbae23f 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -30,5 +30,6 @@ jobs: - name: Build & test run: | - bazel build --config=ci //... - bazel test --config=ci //... + bazel build --config=ci //semantic:all + bazel test --config=ci --test_tag_filters=language-test //... + bazel test //semantic-source //semantic:spec From cc1d463d86c877e85ad8d9909e3224e926c6ada1 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 10:18:20 -0400 Subject: [PATCH 14/40] maybe this will be even smarter --- .github/workflows/bazel.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index f9bbae23f..40808d68f 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -22,14 +22,12 @@ jobs: name: Cache Bazel artifacts with: path: .bazel-cache - key: ${{ runner.os }}-bazel-${{ hashFiles('semantic-*/**/*.hs') }}-${{ hashFiles('**/*.bazel') }}-${{ hashFiles('**/*.bzl') }} + key: ${{ runner.os }}-bazel-${{ hashFiles('**/*.hs') }}-${{ hashFiles('**/*.{bazel,bzl}') }}-${{ hashFiles('{WORKSPACE,.bazelrc}') }} restore-keys: | - ${{ runner.os }}-bazel-${{ hashFiles('semantic-*/**/*.hs') }}-${{ hashFiles('**/*.bazel') }}- - ${{ runner.os }}-bazel-${{ hashFiles('semantic-*/**/*.hs') }}- ${{ runner.os }}-bazel- - name: Build & test run: | bazel build --config=ci //semantic:all bazel test --config=ci --test_tag_filters=language-test //... - bazel test //semantic-source //semantic:spec + bazel test --config=ci //semantic-source //semantic:spec From 4335c643ac833d4603d68ac28b439b052d77ce18 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 10:28:22 -0400 Subject: [PATCH 15/40] if this doesn't help, I don't know what will --- .github/workflows/bazel.yml | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 40808d68f..3a8244d59 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -17,13 +17,16 @@ jobs: - uses: actions/checkout@v2 if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' - - uses: actions/cache@v1 - id: cache-cabal + - uses: actions/cache@v2 name: Cache Bazel artifacts with: - path: .bazel-cache - key: ${{ runner.os }}-bazel-${{ hashFiles('**/*.hs') }}-${{ hashFiles('**/*.{bazel,bzl}') }}-${{ hashFiles('{WORKSPACE,.bazelrc}') }} + path: | + .bazel-cache + tmp/bazel-repo + key: ${{ runner.os }}-bazel-${{ hashFiles('{WORKSPACE,.bazelrc}') }}-${{ hashFiles('**/*.{bazel,bzl}') }}-${{ hashFiles('semantic-*/**/*.hs') }} restore-keys: | + ${{ runner.os }}-bazel-${{ hashFiles('{WORKSPACE,.bazelrc}') }}-${{ hashFiles('**/*.{bazel,bzl}') }}- + ${{ runner.os }}-bazel-${{ hashFiles('{WORKSPACE,.bazelrc}') }}- ${{ runner.os }}-bazel- - name: Build & test From cdafffc02f32c448c65dc0324f866c5d67692104 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 10:37:00 -0400 Subject: [PATCH 16/40] I guess you can't use alternation in hashFile patterns --- .github/workflows/bazel.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 3a8244d59..b2a29e714 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -23,10 +23,11 @@ jobs: path: | .bazel-cache tmp/bazel-repo - key: ${{ runner.os }}-bazel-${{ hashFiles('{WORKSPACE,.bazelrc}') }}-${{ hashFiles('**/*.{bazel,bzl}') }}-${{ hashFiles('semantic-*/**/*.hs') }} + key: ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE'} }}-${{ hashFiles('.bazelrc'} }}-${{ hashFiles('**/*.b?z?l') }}-${{ hashFiles('semantic-*/**/*.hs') }} restore-keys: | - ${{ runner.os }}-bazel-${{ hashFiles('{WORKSPACE,.bazelrc}') }}-${{ hashFiles('**/*.{bazel,bzl}') }}- - ${{ runner.os }}-bazel-${{ hashFiles('{WORKSPACE,.bazelrc}') }}- + ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE'} }}-${{ hashFiles('.bazelrc'} }}-${{ hashFiles('**/*.b?z?l') }}- + ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE'} }}-${{ hashFiles('.bazelrc'} }}- + ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE'} }}- ${{ runner.os }}-bazel- - name: Build & test From 505418d385c099908391bf197b92401ffcf5667e Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 10:49:06 -0400 Subject: [PATCH 17/40] Did I forget this id or something? --- .github/workflows/bazel.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index b2a29e714..f300ac964 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -18,6 +18,7 @@ jobs: if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' - uses: actions/cache@v2 + id: caching-stage name: Cache Bazel artifacts with: path: | @@ -25,9 +26,6 @@ jobs: tmp/bazel-repo key: ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE'} }}-${{ hashFiles('.bazelrc'} }}-${{ hashFiles('**/*.b?z?l') }}-${{ hashFiles('semantic-*/**/*.hs') }} restore-keys: | - ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE'} }}-${{ hashFiles('.bazelrc'} }}-${{ hashFiles('**/*.b?z?l') }}- - ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE'} }}-${{ hashFiles('.bazelrc'} }}- - ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE'} }}- ${{ runner.os }}-bazel- - name: Build & test From e6fc72f1d72594229892c3b7644f5ab855240f72 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 10:50:22 -0400 Subject: [PATCH 18/40] syntax TERROR --- .github/workflows/bazel.yml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index f300ac964..fef8c0c3a 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -24,8 +24,11 @@ jobs: path: | .bazel-cache tmp/bazel-repo - key: ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE'} }}-${{ hashFiles('.bazelrc'} }}-${{ hashFiles('**/*.b?z?l') }}-${{ hashFiles('semantic-*/**/*.hs') }} + key: ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('.bazelrc'} }}-${{ hashFiles('**/*.b?z?l') }}-${{ hashFiles('semantic-*/**/*.hs') }} restore-keys: | + ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE'} }}-${{ hashFiles('.bazelrc'} }}-${{ hashFiles('**/*.b?z?l') }}- + ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE'} }}-${{ hashFiles('.bazelrc'} }}- + ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE'} }}- ${{ runner.os }}-bazel- - name: Build & test From e17ec90274fdbc40a71d80a83ae0ffcc106f02a2 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 10:51:44 -0400 Subject: [PATCH 19/40] one more try --- .github/workflows/bazel.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index fef8c0c3a..2937e3edb 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -26,9 +26,9 @@ jobs: tmp/bazel-repo key: ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('.bazelrc'} }}-${{ hashFiles('**/*.b?z?l') }}-${{ hashFiles('semantic-*/**/*.hs') }} restore-keys: | - ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE'} }}-${{ hashFiles('.bazelrc'} }}-${{ hashFiles('**/*.b?z?l') }}- - ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE'} }}-${{ hashFiles('.bazelrc'} }}- - ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE'} }}- + ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('.bazelrc'} }}-${{ hashFiles('**/*.b?z?l') }}- + ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('.bazelrc'} }}- + ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE') }}- ${{ runner.os }}-bazel- - name: Build & test From 18bd87cd5c997700f0e7c3de462631f94e8f0d18 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 10:53:26 -0400 Subject: [PATCH 20/40] again with the parentheses --- .github/workflows/bazel.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 2937e3edb..b2898ae5a 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -24,10 +24,10 @@ jobs: path: | .bazel-cache tmp/bazel-repo - key: ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('.bazelrc'} }}-${{ hashFiles('**/*.b?z?l') }}-${{ hashFiles('semantic-*/**/*.hs') }} + key: ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('.bazelrc') }}-${{ hashFiles('**/*.b?z?l') }}-${{ hashFiles('semantic-*/**/*.hs') }} restore-keys: | - ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('.bazelrc'} }}-${{ hashFiles('**/*.b?z?l') }}- - ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('.bazelrc'} }}- + ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('.bazelrc') }}-${{ hashFiles('**/*.b?z?l') }}- + ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('.bazelrc') }}- ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE') }}- ${{ runner.os }}-bazel- From 16408bac5a962b7ff4a6038d237f08cd9aca4629 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 11:12:28 -0400 Subject: [PATCH 21/40] silence the shallow_since errors --- .github/workflows/bazel.yml | 5 +++++ WORKSPACE | 3 ++- build/example_repos.bzl | 12 ++++++------ 3 files changed, 13 insertions(+), 7 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index b2898ae5a..42116457e 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -17,6 +17,11 @@ jobs: - uses: actions/checkout@v2 if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' + - name: Info + run: | + which bazel + which bazelisk + - uses: actions/cache@v2 id: caching-stage name: Cache Bazel artifacts diff --git a/WORKSPACE b/WORKSPACE index b75ec7f43..09e393262 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -31,8 +31,9 @@ load( # ) git_repository( name = "rules_haskell", - remote = "https://github.com/tweag/rules_haskell", commit = "abaec6502a4474f10b3c367fb5e90173ee0e349c", + remote = "https://github.com/tweag/rules_haskell", + shallow_since = "1594376866 +0000", ) load( diff --git a/build/example_repos.bzl b/build/example_repos.bzl index 46ae6b869..468a87319 100644 --- a/build/example_repos.bzl +++ b/build/example_repos.bzl @@ -11,7 +11,7 @@ _all_example_repos = { ], "commit": "058851c5cfc98f50f11237b1c13d77cfd1f40475", "repo": "numpy/numpy", - "since": "", + "since": "1536047875 +0300", "excludes": [], }, "python": { @@ -35,7 +35,7 @@ _all_example_repos = { ], "commit": "0b5b4a66ef99c8b91569dd9b9b34911834689d3f", "repo": "pallets/flask", - "since": "", + "since": "1548424614 -0800", "excludes": [], }, "httpie": { @@ -44,7 +44,7 @@ _all_example_repos = { ], "commit": "358342d1c915d6462a080a77aefbb20166d0bd5d", "repo": "jakubroztocil/httpie", - "since": "", + "since": "1547033444 +0100", "excludes": [], }, "keras": { @@ -62,7 +62,7 @@ _all_example_repos = { ], "commit": "64bde6582d9b49e9345d9b8df16aaa26dc372d13", "repo": "requests/requests", - "since": "", + "since": "1548096627 -0600", "excludes": [], }, "scikit-learn": { @@ -71,7 +71,7 @@ _all_example_repos = { ], "commit": "d0f63a760d9993a7f68cfc5e1a075700d67c53d3", "repo": "scikit-learn/scikit-learn", - "since": "", + "since": "1549039144 +0100", "excludes": [], }, "scrapy": { @@ -107,7 +107,7 @@ _all_example_repos = { ], "commit": "c3e6b9017926f44a76e2b966c4dd35fa84c4cd3b", "repo": "ruby/spec", - "since": "", + "since": "1501155617 +0200", "excludes": [], }, "desktop": { From 541f3eb86c7509671f35acd390e7ce874294202f Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 12:59:56 -0400 Subject: [PATCH 22/40] Simpler caching strategy. --- .github/workflows/bazel.yml | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 42116457e..f8c6ec96b 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -17,11 +17,6 @@ jobs: - uses: actions/checkout@v2 if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' - - name: Info - run: | - which bazel - which bazelisk - - uses: actions/cache@v2 id: caching-stage name: Cache Bazel artifacts @@ -29,13 +24,16 @@ jobs: path: | .bazel-cache tmp/bazel-repo - key: ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('.bazelrc') }}-${{ hashFiles('**/*.b?z?l') }}-${{ hashFiles('semantic-*/**/*.hs') }} + key: ${{ runner.os }}-bazel-${{ github.run_id }} restore-keys: | - ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('.bazelrc') }}-${{ hashFiles('**/*.b?z?l') }}- - ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE') }}-${{ hashFiles('.bazelrc') }}- - ${{ runner.os }}-bazel-${{ hashFiles('WORKSPACE') }}- ${{ runner.os }}-bazel- + - name: Info + run: | + which bazel + which bazelisk + ls .bazel-cache + - name: Build & test run: | bazel build --config=ci //semantic:all From 93f0c90980f72cf940f6e773c4f65bb126f0eb63 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 13:10:19 -0400 Subject: [PATCH 23/40] Download our own Bazel and see if that works better. --- .github/workflows/bazel.yml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index f8c6ec96b..32e43b40d 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -17,25 +17,26 @@ jobs: - uses: actions/checkout@v2 if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' + - name: Download/cache bazel bersion + run: | + curl -LO "https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-linux-x86_64" + mkdir "bin/" + mv bazel-3.0.0-linux-x86_64 "bin/bazel" + chmod +x "bin/bazel" + - uses: actions/cache@v2 id: caching-stage name: Cache Bazel artifacts with: path: | .bazel-cache - tmp/bazel-repo + bin key: ${{ runner.os }}-bazel-${{ github.run_id }} restore-keys: | ${{ runner.os }}-bazel- - - name: Info - run: | - which bazel - which bazelisk - ls .bazel-cache - - name: Build & test run: | - bazel build --config=ci //semantic:all - bazel test --config=ci --test_tag_filters=language-test //... - bazel test --config=ci //semantic-source //semantic:spec + bin/bazel build --config=ci //semantic:all + bin/bazel test --config=ci --test_tag_filters=language-test //... + bin/bazel test --config=ci //semantic-source //semantic:spec From c8f387c1485de7fd8c4e639137fb2017f6482e2f Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 13:11:41 -0400 Subject: [PATCH 24/40] don't die --- .github/workflows/bazel.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 32e43b40d..aac5faf5e 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -20,7 +20,7 @@ jobs: - name: Download/cache bazel bersion run: | curl -LO "https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-linux-x86_64" - mkdir "bin/" + mkdir "bin/" || true mv bazel-3.0.0-linux-x86_64 "bin/bazel" chmod +x "bin/bazel" From d89940ffc238ae8a92a7f89d672cfc94f54f1271 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 13:13:08 -0400 Subject: [PATCH 25/40] let's assume there's a bin directory here --- .github/workflows/bazel.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index aac5faf5e..0745500d6 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -17,11 +17,10 @@ jobs: - uses: actions/checkout@v2 if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' - - name: Download/cache bazel bersion + - name: Download/cache bazel version run: | curl -LO "https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-linux-x86_64" - mkdir "bin/" || true - mv bazel-3.0.0-linux-x86_64 "bin/bazel" + mv bazel-3.1.0-linux-x86_64 "bin/bazel" chmod +x "bin/bazel" - uses: actions/cache@v2 From eb9db7640638364445c6c0583b5cff2d00ac73f3 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 13:56:22 -0400 Subject: [PATCH 26/40] Try not building all and see if it helps --- .github/workflows/bazel.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 0745500d6..cf7790b11 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -36,6 +36,5 @@ jobs: - name: Build & test run: | - bin/bazel build --config=ci //semantic:all bin/bazel test --config=ci --test_tag_filters=language-test //... bin/bazel test --config=ci //semantic-source //semantic:spec From d4d54910bd9064ab957bb266ba69a6d75147f434 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 14:18:55 -0400 Subject: [PATCH 27/40] Dummy commit. --- docs/build.md | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/build.md b/docs/build.md index 87a0d9530..28151f0c2 100644 --- a/docs/build.md +++ b/docs/build.md @@ -42,6 +42,7 @@ If this seems complicated, don't worry: most of the time you'll be able to skip 3. **Some packages come with GHC and are not loaded from Stackage**. These include `base`, `containers`, and [others](https://downloads.haskell.org/~ghc/latest/docs/html/users_guide/8.10.1-notes.html?highlight=bytestring#included-libraries). To depend on those packages, you use `//:base`, `//:containers`, etc. They are specified in the `BAZEL.build` at the project root. You probably won't need to add any more. 4. **Getting weird errors from the C compiler?** Try setting `export BAZEL_USE_CPP_ONLY_TOOLCHAIN=1` in your `.profile` or whatnot. + ## Quick reference links * **Bazel manual**: https://docs.bazel.build/versions/3.3.0/bazel-overview.html From f8409856d88aa2068dda7f3d43fa8e7bd2858fe7 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 14:22:35 -0400 Subject: [PATCH 28/40] Don't redownload Bazel if it's in the cache. --- .github/workflows/bazel.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index cf7790b11..60d7a21ea 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -17,12 +17,6 @@ jobs: - uses: actions/checkout@v2 if: github.event.action == 'opened' || github.event.action == 'synchronize' || github.event.ref == 'refs/heads/master' - - name: Download/cache bazel version - run: | - curl -LO "https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-linux-x86_64" - mv bazel-3.1.0-linux-x86_64 "bin/bazel" - chmod +x "bin/bazel" - - uses: actions/cache@v2 id: caching-stage name: Cache Bazel artifacts @@ -34,6 +28,13 @@ jobs: restore-keys: | ${{ runner.os }}-bazel- + - name: Download/cache bazel version + if: steps.caching-stage.outputs.cache-hit != 'true' + run: | + curl -LO "https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-linux-x86_64" + mv bazel-3.1.0-linux-x86_64 "bin/bazel" + chmod +x "bin/bazel" + - name: Build & test run: | bin/bazel test --config=ci --test_tag_filters=language-test //... From 80dc211d6f9952b9e30e8f558462aafc8e0465dc Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 14:28:08 -0400 Subject: [PATCH 29/40] This keeps downloading no matter what we do. --- .github/workflows/bazel.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 60d7a21ea..6afe02f6e 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -31,9 +31,11 @@ jobs: - name: Download/cache bazel version if: steps.caching-stage.outputs.cache-hit != 'true' run: | - curl -LO "https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-linux-x86_64" - mv bazel-3.1.0-linux-x86_64 "bin/bazel" - chmod +x "bin/bazel" + if [ ! -f bin/bazel ]; then + curl -LO "https://github.com/bazelbuild/bazel/releases/download/3.1.0/bazel-3.1.0-linux-x86_64" + mv bazel-3.1.0-linux-x86_64 "bin/bazel" + chmod +x "bin/bazel" + fi - name: Build & test run: | From 140fd0338e51b23812a31cd114863c346a686bf5 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 14:30:58 -0400 Subject: [PATCH 30/40] Try caching the .cache folder in the home directory Even though that shouldn't even work. --- .github/workflows/bazel.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 6afe02f6e..0c74e8985 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -24,6 +24,7 @@ jobs: path: | .bazel-cache bin + /home/runner/.cache key: ${{ runner.os }}-bazel-${{ github.run_id }} restore-keys: | ${{ runner.os }}-bazel- From 10ea57ab4dfd6cab5cd121731b5da2600f095d35 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 15:34:01 -0400 Subject: [PATCH 31/40] confirm that this is what's slowing the builds --- build/example_repos.bzl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/build/example_repos.bzl b/build/example_repos.bzl index 468a87319..0aecb4ce6 100644 --- a/build/example_repos.bzl +++ b/build/example_repos.bzl @@ -134,8 +134,10 @@ filegroup( ) """.format(data, excludes), commit = commit, + sha256 = sha256, remote = "https://github.com/{}.git".format(repo), shallow_since = since, + verbose = True, ) def declare_example_repos(): From 32d7ef7e42c9f3e0d825303a8dce3ed40dc7afbc Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 15:50:03 -0400 Subject: [PATCH 32/40] Use http_archive to download the example repositories. --- .github/workflows/bazel.yml | 1 - build/example_repos.bzl | 31 +++++++++++++++++++++++-------- semantic/BUILD.bazel | 1 - 3 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 0c74e8985..6afe02f6e 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -24,7 +24,6 @@ jobs: path: | .bazel-cache bin - /home/runner/.cache key: ${{ runner.os }}-bazel-${{ github.run_id }} restore-keys: | ${{ runner.os }}-bazel- diff --git a/build/example_repos.bzl b/build/example_repos.bzl index 0aecb4ce6..fa3949f0a 100644 --- a/build/example_repos.bzl +++ b/build/example_repos.bzl @@ -3,6 +3,10 @@ load( "git_repository", "new_git_repository", ) +load( + "@bazel_tools//tools/build_defs/repo:http.bzl", + "http_archive", +) _all_example_repos = { "numpy": { @@ -11,8 +15,7 @@ _all_example_repos = { ], "commit": "058851c5cfc98f50f11237b1c13d77cfd1f40475", "repo": "numpy/numpy", - "since": "1536047875 +0300", - "excludes": [], + "sha256": "8e60c567cbab3309afa9508ee61dfd207089ebb0056214fe60e863d81e098824", }, "python": { "data": [ @@ -20,6 +23,8 @@ _all_example_repos = { ], "commit": "c6be53e1c43f870f5364eef1499ee1b411c966fb", "repo": "thealgorithms/python", + "prefix": "Python", + "sha256": "bef087151bea1e479701d0ceed831809c1b916f513752dee914e9c7876b46ea9", "since": "1548508158 +0800", "excludes": [ "**/data structures/*", @@ -35,6 +40,7 @@ _all_example_repos = { ], "commit": "0b5b4a66ef99c8b91569dd9b9b34911834689d3f", "repo": "pallets/flask", + "sha256": "224d406f11b13cc8e4c7defd8dc94e0df957c1c90977172cfaa2ee88d8f85e77", "since": "1548424614 -0800", "excludes": [], }, @@ -44,6 +50,7 @@ _all_example_repos = { ], "commit": "358342d1c915d6462a080a77aefbb20166d0bd5d", "repo": "jakubroztocil/httpie", + "sha256": "2b3172369954d883a2a609dc6bc34a944ce9817afb14733d87f208a40529899c", "since": "1547033444 +0100", "excludes": [], }, @@ -53,6 +60,7 @@ _all_example_repos = { ], "commit": "e59570ae26670f788d6c649191031e4a8824f955", "repo": "keras-team/keras", + "sha256": "2bda5bfd2a2b43d9f4d191e4ed980740429bb86d75e16355b1d33faf9d974ffd", "since": "1548927621 +0530", "excludes": [], }, @@ -61,6 +69,7 @@ _all_example_repos = { "**/*.py", ], "commit": "64bde6582d9b49e9345d9b8df16aaa26dc372d13", + "sha256": "8f9466ad314b2741c826b164b46bcedb260d424f717fd9553fea5164f493bd20", "repo": "requests/requests", "since": "1548096627 -0600", "excludes": [], @@ -71,6 +80,7 @@ _all_example_repos = { ], "commit": "d0f63a760d9993a7f68cfc5e1a075700d67c53d3", "repo": "scikit-learn/scikit-learn", + "sha256": "4f337b87d45cabd7db9cd3883fd5168accad7f78bc48df3ae633832b4d0f30d0", "since": "1549039144 +0100", "excludes": [], }, @@ -79,6 +89,7 @@ _all_example_repos = { "**/*.py", ], "commit": "65d631329a1434ec013f24341e4b8520241aec70", + "sha256": "27b2dc9b1a55c356eeec651c76fe82be082c0e8980b2e4d9b99a4f63c733685b", "repo": "scrapy/scrapy", "since": "1548908933 -0300", "excludes": [], @@ -89,6 +100,7 @@ _all_example_repos = { ], "commit": "c865d46736db4afff51690a712e35ed8e3899490", "repo": "pytorch/pytorch", + "sha256": "7b54b7a3c40aaf68bb9bd7dcc509389d29c5c37241f29c003bd04cd0dafb60ce", "since": "1549068372 -0800", "excludes": [], }, @@ -97,6 +109,7 @@ _all_example_repos = { "**/*.py", ], "commit": "bb8222200a8cbd39a3ce9584ce6dfed6c5d05228", + "sha256": "3477f4c04897f7874249e6362567384246f409c62e1ff18c4d6fa54813f484c2", "repo": "certbot/certbot", "since": "1549052531 -0800", "excludes": [], @@ -116,6 +129,7 @@ _all_example_repos = { ], "commit": "d1324f56d02dd9afca5d2e9da545905a7d41d671", "repo": "desktop/desktop", + "sha256": "cfd1c6d313ff4e756b59da83f3f7799e021e0d0fe94ee4a93638c9b1aa19b5ca", "since": "1523834029 +1000", "excludes": [], }, @@ -123,8 +137,11 @@ _all_example_repos = { SEMANTIC_EXTERNAL_TEST_REPOSITORIES = ["@" + k + "//:src" for (k, v) in _all_example_repos.items()] -def _example_repo(name, data, excludes, commit, repo, since): - new_git_repository( +def _example_repo(name, data, repo, commit, since = "", excludes = [], sha256 = "", prefix = ""): + if prefix == "": + prefix = name + + http_archive( name = name, build_file_content = """ filegroup( @@ -133,11 +150,9 @@ filegroup( visibility = ["//visibility:public"] ) """.format(data, excludes), - commit = commit, + strip_prefix = prefix + "-" + commit, sha256 = sha256, - remote = "https://github.com/{}.git".format(repo), - shallow_since = since, - verbose = True, + urls = ["https://github.com/{repo}/archive/{commit}.tar.gz".format(repo = repo, commit = commit)], ) def declare_example_repos(): diff --git a/semantic/BUILD.bazel b/semantic/BUILD.bazel index fae0d0846..e81eb9c25 100644 --- a/semantic/BUILD.bazel +++ b/semantic/BUILD.bazel @@ -182,7 +182,6 @@ haskell_test( haskell_test( name = "parse-examples", - timeout = "long", srcs = [ "test/Examples.hs", ], From e9255b2e6d3e80d9959eda7bc656f66e3d1a88cb Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 15:51:44 -0400 Subject: [PATCH 33/40] Simplify the dictionary here. --- build/example_repos.bzl | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/build/example_repos.bzl b/build/example_repos.bzl index fa3949f0a..3edc4c403 100644 --- a/build/example_repos.bzl +++ b/build/example_repos.bzl @@ -25,7 +25,6 @@ _all_example_repos = { "repo": "thealgorithms/python", "prefix": "Python", "sha256": "bef087151bea1e479701d0ceed831809c1b916f513752dee914e9c7876b46ea9", - "since": "1548508158 +0800", "excludes": [ "**/data structures/*", "**/binary tree/*", @@ -41,8 +40,6 @@ _all_example_repos = { "commit": "0b5b4a66ef99c8b91569dd9b9b34911834689d3f", "repo": "pallets/flask", "sha256": "224d406f11b13cc8e4c7defd8dc94e0df957c1c90977172cfaa2ee88d8f85e77", - "since": "1548424614 -0800", - "excludes": [], }, "httpie": { "data": [ @@ -51,8 +48,6 @@ _all_example_repos = { "commit": "358342d1c915d6462a080a77aefbb20166d0bd5d", "repo": "jakubroztocil/httpie", "sha256": "2b3172369954d883a2a609dc6bc34a944ce9817afb14733d87f208a40529899c", - "since": "1547033444 +0100", - "excludes": [], }, "keras": { "data": [ @@ -61,8 +56,6 @@ _all_example_repos = { "commit": "e59570ae26670f788d6c649191031e4a8824f955", "repo": "keras-team/keras", "sha256": "2bda5bfd2a2b43d9f4d191e4ed980740429bb86d75e16355b1d33faf9d974ffd", - "since": "1548927621 +0530", - "excludes": [], }, "requests": { "data": [ @@ -71,8 +64,6 @@ _all_example_repos = { "commit": "64bde6582d9b49e9345d9b8df16aaa26dc372d13", "sha256": "8f9466ad314b2741c826b164b46bcedb260d424f717fd9553fea5164f493bd20", "repo": "requests/requests", - "since": "1548096627 -0600", - "excludes": [], }, "scikit-learn": { "data": [ @@ -81,8 +72,6 @@ _all_example_repos = { "commit": "d0f63a760d9993a7f68cfc5e1a075700d67c53d3", "repo": "scikit-learn/scikit-learn", "sha256": "4f337b87d45cabd7db9cd3883fd5168accad7f78bc48df3ae633832b4d0f30d0", - "since": "1549039144 +0100", - "excludes": [], }, "scrapy": { "data": [ @@ -91,8 +80,6 @@ _all_example_repos = { "commit": "65d631329a1434ec013f24341e4b8520241aec70", "sha256": "27b2dc9b1a55c356eeec651c76fe82be082c0e8980b2e4d9b99a4f63c733685b", "repo": "scrapy/scrapy", - "since": "1548908933 -0300", - "excludes": [], }, "pytorch": { "data": [ @@ -101,8 +88,6 @@ _all_example_repos = { "commit": "c865d46736db4afff51690a712e35ed8e3899490", "repo": "pytorch/pytorch", "sha256": "7b54b7a3c40aaf68bb9bd7dcc509389d29c5c37241f29c003bd04cd0dafb60ce", - "since": "1549068372 -0800", - "excludes": [], }, "certbot": { "data": [ @@ -111,8 +96,6 @@ _all_example_repos = { "commit": "bb8222200a8cbd39a3ce9584ce6dfed6c5d05228", "sha256": "3477f4c04897f7874249e6362567384246f409c62e1ff18c4d6fa54813f484c2", "repo": "certbot/certbot", - "since": "1549052531 -0800", - "excludes": [], }, "spec": { "data": [ @@ -120,8 +103,6 @@ _all_example_repos = { ], "commit": "c3e6b9017926f44a76e2b966c4dd35fa84c4cd3b", "repo": "ruby/spec", - "since": "1501155617 +0200", - "excludes": [], }, "desktop": { "data": [ @@ -130,8 +111,6 @@ _all_example_repos = { "commit": "d1324f56d02dd9afca5d2e9da545905a7d41d671", "repo": "desktop/desktop", "sha256": "cfd1c6d313ff4e756b59da83f3f7799e021e0d0fe94ee4a93638c9b1aa19b5ca", - "since": "1523834029 +1000", - "excludes": [], }, } From 04a7a8f976fd1299cc6d5fad3141f80bb9fd38ca Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 15:56:58 -0400 Subject: [PATCH 34/40] Load everything via http_archive. --- WORKSPACE | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 09e393262..83cb2ded5 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -29,11 +29,11 @@ load( # strip_prefix = "rules_haskell-0.12", # urls = ["https://github.com/tweag/rules_haskell/archive/v0.12.tar.gz"], # ) -git_repository( +http_archive( name = "rules_haskell", - commit = "abaec6502a4474f10b3c367fb5e90173ee0e349c", - remote = "https://github.com/tweag/rules_haskell", - shallow_since = "1594376866 +0000", + sha256 = "78d017aa732b430c0681fff4514503af78a8d8c44df165e603a9433745b16e5e", + strip_prefix = "rules_haskell-abaec6502a4474f10b3c367fb5e90173ee0e349c", + urls = ["https://github.com/tweag/rules_haskell/archive/abaec6502a4474f10b3c367fb5e90173ee0e349c.tar.gz"], ) load( @@ -251,11 +251,11 @@ tree_sitter_node_types_hackage( # Download lingo (which has its own Bazel build instructions). -git_repository( +http_archive( name = "lingo", - commit = "6614b9afe1a519364491c170d6b06ff5cd96153a", - remote = "https://github.com/tclem/lingo-haskell.git", - shallow_since = "1593202797 -0400", + sha256 = "32a5e2d66e4620ff7004acab4802dc948b852ce26725012283a85d41af97275f", + strip_prefix = "lingo-haskell-6614b9afe1a519364491c170d6b06ff5cd96153a", + urls = ["https://github.com/tclem/lingo-haskell/archive/6614b9afe1a519364491c170d6b06ff5cd96153a.tar.gz"], ) load("//:build/example_repos.bzl", "declare_example_repos") From 6616babc64c53218984a6dabec70ba5c7c9aa435 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 16:07:34 -0400 Subject: [PATCH 35/40] add a sha to ruby/spec --- build/example_repos.bzl | 1 + 1 file changed, 1 insertion(+) diff --git a/build/example_repos.bzl b/build/example_repos.bzl index 3edc4c403..f9543c585 100644 --- a/build/example_repos.bzl +++ b/build/example_repos.bzl @@ -103,6 +103,7 @@ _all_example_repos = { ], "commit": "c3e6b9017926f44a76e2b966c4dd35fa84c4cd3b", "repo": "ruby/spec", + "sha256": "33206954ff6fdbf5b872298efc2697c18ad5371eb55007d54f95c08ec7f46bb4", }, "desktop": { "data": [ From af8972105f08b86262957ad175d295b1f3963f3a Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 16:19:05 -0400 Subject: [PATCH 36/40] fewer loads --- WORKSPACE | 7 ------- build/common.bzl | 4 ---- build/example_repos.bzl | 5 ----- 3 files changed, 16 deletions(-) diff --git a/WORKSPACE b/WORKSPACE index 83cb2ded5..a10563baf 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -8,13 +8,6 @@ workspace(name = "semantic") # Load the repository rule to download an http archive. load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") -# Load the ability to check out a git repository. -load( - "@bazel_tools//tools/build_defs/repo:git.bzl", - "git_repository", - "new_git_repository", -) - # Download rules_haskell and make it accessible as "@rules_haskell". # # Note: the git_repository clause is a workaround until rules_haskell#1349 [1] diff --git a/build/common.bzl b/build/common.bzl index 3b591ff75..5fd0ea115 100644 --- a/build/common.bzl +++ b/build/common.bzl @@ -9,10 +9,6 @@ load( "@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", ) -load( - "@bazel_tools//tools/build_defs/repo:git.bzl", - "new_git_repository", -) DEVELOPMENT_GHC_FLAGS = ["-O0"] RELEASE_GHC_FLAGS = ["-O1"] diff --git a/build/example_repos.bzl b/build/example_repos.bzl index f9543c585..c006fcad5 100644 --- a/build/example_repos.bzl +++ b/build/example_repos.bzl @@ -1,8 +1,3 @@ -load( - "@bazel_tools//tools/build_defs/repo:git.bzl", - "git_repository", - "new_git_repository", -) load( "@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive", From 950880d655f60a47b158222dbffb01d171b5c3e6 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 16:19:15 -0400 Subject: [PATCH 37/40] can we cache even harder? --- .github/workflows/bazel.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 6afe02f6e..a6d495e9c 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -24,6 +24,7 @@ jobs: path: | .bazel-cache bin + bazel-out/k8-fastbuild/bin key: ${{ runner.os }}-bazel-${{ github.run_id }} restore-keys: | ${{ runner.os }}-bazel- From 5de187af73174e5c29958bd0b65fab15acce0959 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 17:12:18 -0400 Subject: [PATCH 38/40] Revert "can we cache even harder?" This reverts commit 950880d655f60a47b158222dbffb01d171b5c3e6. --- .github/workflows/bazel.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index a6d495e9c..6afe02f6e 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -24,7 +24,6 @@ jobs: path: | .bazel-cache bin - bazel-out/k8-fastbuild/bin key: ${{ runner.os }}-bazel-${{ github.run_id }} restore-keys: | ${{ runner.os }}-bazel- From f3e70bee258254cf1e2381b2cfc1d6a826f9ddea Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Fri, 10 Jul 2020 14:30:58 -0400 Subject: [PATCH 39/40] Cache the home directory's build folder for now. It means that we can't keep more than a couple around, but... one should suffice, right? The Cabal cache is pretty small. --- .github/workflows/bazel.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/bazel.yml b/.github/workflows/bazel.yml index 6afe02f6e..0c74e8985 100644 --- a/.github/workflows/bazel.yml +++ b/.github/workflows/bazel.yml @@ -24,6 +24,7 @@ jobs: path: | .bazel-cache bin + /home/runner/.cache key: ${{ runner.os }}-bazel-${{ github.run_id }} restore-keys: | ${{ runner.os }}-bazel- From b7eb63f7cbb03718d1ee14853df08b8a847a9ff5 Mon Sep 17 00:00:00 2001 From: Patrick Thomson Date: Wed, 15 Jul 2020 15:59:52 -0400 Subject: [PATCH 40/40] This file is no longer needed. --- build/tree_sitter.bzl | 10 ---------- 1 file changed, 10 deletions(-) delete mode 100644 build/tree_sitter.bzl diff --git a/build/tree_sitter.bzl b/build/tree_sitter.bzl deleted file mode 100644 index 94938f61f..000000000 --- a/build/tree_sitter.bzl +++ /dev/null @@ -1,10 +0,0 @@ -# To provide access to node-types.json files and the contents -# of the packages's corpus/ directory, we define a BUILD file -# that will be injected, via the build_file_contents, into -# the repositories that we download. - -package(default_visibility = ["//visibility:public"]) - -exports_files(glob(["**/node-types.json"])) - -filegroup(name = "corpus", srcs = glob(["**/corpus/*.txt"]))