Skip to content

Commit

Permalink
Merge pull request #474 from bittide/bump-nixos-23.11
Browse files Browse the repository at this point in the history
Bump to NixOS 23.11
  • Loading branch information
martijnbastiaan authored Mar 8, 2024
2 parents 022a654 + ce7bcb5 commit 073c5ef
Show file tree
Hide file tree
Showing 31 changed files with 1,722 additions and 376 deletions.
8 changes: 5 additions & 3 deletions .github/scripts/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,18 +51,20 @@
CLEAR_AFTER=f"{CLEAR_AFTER_DAYS}d00h00m00s"
TOUCH_AFTER=datetime.timedelta(days=1)

GLOBAL_CACHE_BUST = 0

CARGO_CACHE_BUST = 2
CARGO_KEY_PREFIX = f"cargo-{CARGO_CACHE_BUST}-"
CARGO_KEY_PREFIX = f"cargo-g{GLOBAL_CACHE_BUST}-l{CARGO_CACHE_BUST}-"
CARGO_KEY_PATTERNS = ("**/Cargo.lock", "**/Cargo.toml", "**/rust-toolchain.toml")
CARGO_CACHE_PATTERNS = ("~/.cargo",)

CABAL_CACHE_BUST = 2
CABAL_KEY_PREFIX = f"cabal-{CABAL_CACHE_BUST}-"
CABAL_KEY_PREFIX = f"cabal-g{GLOBAL_CACHE_BUST}-l{CABAL_CACHE_BUST}-"
CABAL_KEY_PATTERNS = ("**/cabal.project", "**/cabal.project.freeze")
CABAL_CACHE_PATTERNS = ("~/.cabal-nix",)

BUILD_CACHE_BUST = 2
BUILD_KEY_PREFIX = f"build-products-{BUILD_CACHE_BUST}-"
BUILD_KEY_PREFIX = f"build-products-g{GLOBAL_CACHE_BUST}-l{BUILD_CACHE_BUST}-"
BUILD_CACHE_PATTERNS = (
f"{PWD}/_build/",
f"{PWD}/clash-vexriscv/clash-vexriscv/build_out_dir/",
Expand Down
10 changes: 9 additions & 1 deletion .github/scripts/check_copyright_years.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@

YEAR_RE = re.compile(r"\d{4}")

IGNORE_COMMTIS_STARTSWITH = (
"Squashed 'clash-vexriscv/' changes",
)

IGNORE_STARTSWITH = (
"clash-vexriscv",
)
Expand All @@ -31,14 +35,18 @@ def iter_change_types(diff_index, change_types):
for change_type in change_types:
yield from diff_index.iter_change_type(change_type)

def get_pr_commits(repo, common_ancestor):
def get_pr_commits(repo, common_ancestor, ignore=IGNORE_COMMTIS_STARTSWITH):
"""
Gets all commits from the current one to (but not including) a common ancestor
given as an argument.
"""
for commit in repo.iter_commits():
if commit.binsha == common_ancestor.binsha:
break

if commit.message.startswith(ignore):
continue

yield commit

def get_relevant_files_from_diff_index(diff_index):
Expand Down
34 changes: 17 additions & 17 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ jobs:
run:
shell: git-nix-shell {0} --option connect-timeout 360 --pure --keep "GITHUB_SHA" --keep "S3_PASSWORD"
container:
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30
image: ghcr.io/clash-lang/nixos-bittide-hardware:2024-03-08
options: --memory=11g
steps:
- name: Checkout
Expand Down Expand Up @@ -114,7 +114,7 @@ jobs:
shell: git-nix-shell {0} --option connect-timeout 360 --pure --keep "GITHUB_SHA" --keep "S3_PASSWORD"

container:
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30
image: ghcr.io/clash-lang/nixos-bittide-hardware:2024-03-08
options: --memory=11g

steps:
Expand Down Expand Up @@ -154,7 +154,7 @@ jobs:
shell: git-nix-shell {0} --option connect-timeout 360 --pure --keep "GITHUB_OUTPUT"

container:
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30
image: ghcr.io/clash-lang/nixos-bittide-hardware:2024-03-08
options: --memory=11g

steps:
Expand Down Expand Up @@ -194,7 +194,7 @@ jobs:
fail-fast: false

container:
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30
image: ghcr.io/clash-lang/nixos-bittide-hardware:2024-03-08
options: --memory=11g

steps:
Expand Down Expand Up @@ -259,7 +259,7 @@ jobs:
needs: [build, lint, elastic-buffer-sim-topologies-matrix, elastic-buffer-sim-topologies, bittide-instances-hardware-in-the-loop]

container:
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30
image: ghcr.io/clash-lang/nixos-bittide-hardware:2024-03-08
options: --memory=11g

steps:
Expand Down Expand Up @@ -337,7 +337,7 @@ jobs:
needs: [build, lint]

container:
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30
image: ghcr.io/clash-lang/nixos-bittide-hardware:2024-03-08
options: --memory=11g

steps:
Expand All @@ -364,7 +364,7 @@ jobs:
needs: [build, lint]

container:
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30
image: ghcr.io/clash-lang/nixos-bittide-hardware:2024-03-08
options: --memory=11g

steps:
Expand Down Expand Up @@ -399,7 +399,7 @@ jobs:
run:
shell: git-nix-shell {0} --option connect-timeout 360 --pure --keep "GITHUB_SHA" --keep "S3_PASSWORD"
container:
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30
image: ghcr.io/clash-lang/nixos-bittide-hardware:2024-03-08
options: --memory=11g
needs: [build]

Expand All @@ -424,7 +424,7 @@ jobs:
run:
shell: git-nix-shell {0} --option connect-timeout 360 --pure --keep "GITHUB_SHA" --keep "S3_PASSWORD"
container:
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30
image: ghcr.io/clash-lang/nixos-bittide-hardware:2024-03-08
options: --memory=11g
needs: [build]

Expand Down Expand Up @@ -452,7 +452,7 @@ jobs:
run:
shell: git-nix-shell {0} --option connect-timeout 360 --pure --keep "GITHUB_SHA" --keep "S3_PASSWORD"
container:
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30
image: ghcr.io/clash-lang/nixos-bittide-hardware:2024-03-08
options: --memory=11g
needs: [build]

Expand All @@ -478,7 +478,7 @@ jobs:
run:
shell: git-nix-shell {0} --option connect-timeout 360 --pure --keep "GITHUB_SHA" --keep "S3_PASSWORD"
container:
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30
image: ghcr.io/clash-lang/nixos-bittide-hardware:2024-03-08
options: --memory=11g
needs: [build]

Expand Down Expand Up @@ -511,7 +511,7 @@ jobs:
needs: [build, lint]

container:
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30
image: ghcr.io/clash-lang/nixos-bittide-hardware:2024-03-08
options: --memory=11g

steps:
Expand All @@ -538,7 +538,7 @@ jobs:
needs: [build, lint]

container:
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30
image: ghcr.io/clash-lang/nixos-bittide-hardware:2024-03-08
options: --memory=11g

steps:
Expand All @@ -564,7 +564,7 @@ jobs:
shell: git-nix-shell {0} --option connect-timeout 360 --pure --keep "GITHUB_OUTPUT"

container:
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30
image: ghcr.io/clash-lang/nixos-bittide-hardware:2024-03-08
options: --memory=11g

steps:
Expand Down Expand Up @@ -597,7 +597,7 @@ jobs:
shell: git-nix-shell {0} --option connect-timeout 360 --pure --keep "GITHUB_OUTPUT"

container:
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30
image: ghcr.io/clash-lang/nixos-bittide-hardware:2024-03-08
options: --memory=11g

steps:
Expand Down Expand Up @@ -640,7 +640,7 @@ jobs:
fail-fast: false

container:
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30
image: ghcr.io/clash-lang/nixos-bittide-hardware:2024-03-08
volumes:
- /opt/tools:/opt/tools
options: --init --mac-address="6c:5a:b0:6c:13:0b" --memory=11g
Expand Down Expand Up @@ -713,7 +713,7 @@ jobs:
fail-fast: false

container:
image: ghcr.io/clash-lang/nixos-bittide-hardware:2023-11-30
image: ghcr.io/clash-lang/nixos-bittide-hardware:2024-03-08
volumes:
- /opt/tools:/opt/tools
options: --memory=11g
Expand Down
16 changes: 8 additions & 8 deletions cabal.project
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
-- SPDX-FileCopyrightText: 2022-2023 Google LLC
-- SPDX-FileCopyrightText: 2022-2024 Google LLC
--
-- SPDX-License-Identifier: CC0-1.0

Expand Down Expand Up @@ -62,39 +62,39 @@ index-state: 2023-12-05T05:33:28Z
source-repository-package
type: git
location: https://github.com/clash-lang/clash-compiler.git
tag: 72edd7aabb50537910c306c7efe57cf5f82bf759
tag: aff963fcecf677d6d5fa22fec9c0c7edfccd9579
subdir: clash-prelude

source-repository-package
type: git
location: https://github.com/clash-lang/clash-compiler.git
tag: 72edd7aabb50537910c306c7efe57cf5f82bf759
tag: aff963fcecf677d6d5fa22fec9c0c7edfccd9579
subdir: clash-ghc

source-repository-package
type: git
location: https://github.com/clash-lang/clash-compiler.git
tag: 72edd7aabb50537910c306c7efe57cf5f82bf759
tag: aff963fcecf677d6d5fa22fec9c0c7edfccd9579
subdir: clash-lib

source-repository-package
type: git
location: https://github.com/clash-lang/clash-compiler.git
tag: 72edd7aabb50537910c306c7efe57cf5f82bf759
tag: aff963fcecf677d6d5fa22fec9c0c7edfccd9579
subdir: clash-prelude-hedgehog

source-repository-package
type: git
location: https://github.com/clash-lang/clash-compiler.git
tag: 72edd7aabb50537910c306c7efe57cf5f82bf759
tag: aff963fcecf677d6d5fa22fec9c0c7edfccd9579
subdir: clash-cores

source-repository-package
type: git
location: https://github.com/clash-lang/clash-protocols.git
tag: fcd72e95d06224e7d749451a6646ae1e1b892607
tag: eb76cd1be746ae91beff60c0f16d8c1dd888662c

source-repository-package
type: git
location: https://github.com/cchalmers/circuit-notation.git
tag: 618e37578e699df235f2e7150108b6401731919b
tag: 19b386c4aa3ff690758ae089c7754303f3500cc9
35 changes: 26 additions & 9 deletions clash-vexriscv/.github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: 2022 Google LLC
#
#
# SPDX-License-Identifier: Apache-2.0

name: CI
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --target riscv32imc-unknown-none-elf --all-features

rust-build-programs:
name: Build Programs
runs-on: ubuntu-22.04
Expand All @@ -69,28 +69,32 @@ jobs:
run: |
apt-get update
apt-get install -y curl build-essential
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.67.1 # See Note [Updating Rust versions]
profile: minimal
target: riscv32imc-unknown-none-elf
components: clippy, rustfmt

- name: Caching
uses: Swatinem/rust-cache@v2

- name: Build release binaries
uses: actions-rs/cargo@v1
with:
command: build
args: --release

- name: Build debug binaries
uses: actions-rs/cargo@v1
with:
command: build

- name: Archive Integration Test Binaries
run: |
cd clash-vexriscv-sim; sh bundle_test_binaries.sh
- name: Upload Integration Test Binaries
uses: actions/upload-artifact@v3
with:
Expand All @@ -103,8 +107,16 @@ jobs:
runs-on: ubuntu-22.04
needs: [rust-build-programs]

strategy:
fail-fast: false
matrix:
ghc:
- "9.0.2"
- "9.2.8"
- "9.4.8"

container:
image: ghcr.io/clash-lang/clash-ci-9.0.2:2022-12-13
image: ghcr.io/clash-lang/clash-ci:${{ matrix.ghc }}-20240221

steps:
- name: Checkout
Expand All @@ -120,8 +132,8 @@ jobs:
with:
path: |
~/.cabal/store
key: packages-cachebust-1-${{ hashFiles('cabal.project.freeze', 'cabal.project') }}
restore-keys: packages-cachebust-1-
key: packages-cachebust-2-${{ matrix.ghc }}-${{ hashFiles('cabal.project.freeze', 'cabal.project') }}
restore-keys: packages-cachebust-2-${{ matrix.ghc }}

- name: Install build deps
run: |
Expand Down Expand Up @@ -163,6 +175,11 @@ jobs:
- name: Extract VexRiscv Integration Tests
run: |
tar -x -f vexriscv-test-binaries.tar
- name: Run unittests
- name: Run `clash-vexriscv` unittests
run: |
cabal run clash-vexriscv:unittests
- name: Run `clash-vexriscv-sim` unittests
run: |
cabal run clash-vexriscv-sim:unittests
26 changes: 26 additions & 0 deletions clash-vexriscv/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// SPDX-FileCopyrightText: 2023 Google LLC

// SPDX-License-Identifier: CC0-1.0
{
"files.exclude": {
"**/*.dyn_hi": true,
"**/*.dyn_o": true,
"**/*.hi": true,
"**/*.o": true,
"**/*.o-boot": true,
"**/*.hi-boot": true,
"**/dist-newstyle": true,
"**/.stack-work": true,
"**/.ghc.environment.*": true,
},
"files.insertFinalNewline": true,
"files.trimFinalNewlines": true,
"files.trimTrailingWhitespace": true,
"editor.tabSize": 2,
"[rust]": {
"editor.tabSize": 4
},
"[haskell]": {
"editor.formatOnSave": false
},
}
Loading

0 comments on commit 073c5ef

Please sign in to comment.