fix: fix the 'apt' cmd in setup script

This commit is contained in:
maksyuki committed 2025-12-17 16:16:55 +08:00
1 parent 544d9451ce
commit 5a257b2e5b
2 files changed
+17 -14

No files matched your search

+5 -5
View File
@@ -12,19 +12,19 @@ jobs:
runs-on: ubuntu-22.04 runs-on: ubuntu-22.04
steps: steps:
- name: Checkout repository - name: Checkout Repository
uses: actions/checkout@v4 uses: actions/checkout@v4
- name: Setup environment - name: Setup Environment
run: python3 setup.py run: python3 setup.py
- name: Run tests - name: Run Tests
run: echo "No tests defined yet" run: echo "No tests defined yet"
- name: Build project - name: Build Project
run: echo "Build placeholder" run: echo "Build placeholder"
- name: Success notification - name: Success Notification
run: echo "Workflow completed successfully" run: echo "Workflow completed successfully"
# jobs: # jobs:
+12 -9
View File
@@ -50,26 +50,27 @@ def install_dependencies():
# Update package list # Update package list
print("Updating package list...") print("Updating package list...")
run_command("sudo apt update") run_command("sudo apt-get update")
# Install dependencies (according to Verilator official documentation) # Install dependencies (according to Verilator official documentation)
dependencies = [ dependencies = [
"git", "make", "autoconf", "g++", "flex", "bison", "git", "help2man", "perl", "python3", "make", "autoconf", "g++", "flex", "bison", "ccache",
"libfl-dev", "libgoogle-perftools-dev", "perl", "libgoogle-perftools-dev", "numactl", "perl-doc",
"python3", "zlib1g-dev", "libgz", "libfl2", "libfl-dev" "libfl2",
"libfl-dev",
"zlibc", "zlib1g", "zlib1g-dev"
] ]
# Additional packages for newer Ubuntu versions # Additional packages for newer Ubuntu versions
extra_deps = [ extra_deps = [
"gtkwave", # Optional: waveform viewer "gtkwave", # Optional: waveform viewer
"ccache" # Optional: compilation cache accelerator
] ]
all_deps = dependencies + extra_deps all_deps = dependencies + extra_deps
print(f"Installing dependencies: {', '.join(dependencies)}") print(f"Installing dependencies: {', '.join(dependencies)}")
cmd = f"sudo apt install -y {' '.join(all_deps)}" cmd = f"sudo apt-get install -y {' '.join(all_deps)}"
result = run_command(cmd) result = run_command(cmd)
if result.returncode == 0: if result.returncode == 0:
@@ -97,13 +98,15 @@ def install_verilator_from_source():
print("Cloning Verilator source code...") print("Cloning Verilator source code...")
run_command("git clone https://github.com/verilator/verilator") run_command("git clone https://github.com/verilator/verilator")
run_command("unset VERILATOR_ROOT")
os.chdir("verilator") os.chdir("verilator")
# Switch to stable version (e.g., latest stable tag) # Switch to stable version (e.g., latest stable tag)
print("Switching to stable version...") print("Switching to stable version...")
# Get latest stable tag # Get latest stable tag
result = run_command("git tag -l 'v[0-9]*' | sort -V | tail -1") result = run_command("git tag -l 'v[0-9]*' | sort -V | tail -1")
latest_stable = result.stdout.strip() latest_stable = result.stdout.strip()
# latest_stable = "v5.038"
if latest_stable: if latest_stable:
run_command(f"git checkout {latest_stable}") run_command(f"git checkout {latest_stable}")
@@ -146,11 +149,11 @@ def install_verilator_from_ppa():
# Add PPA repository # Add PPA repository
print("Adding Verilator PPA...") print("Adding Verilator PPA...")
run_command("sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test") run_command("sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test")
run_command("sudo apt update") run_command("sudo apt-get update")
# Install Verilator # Install Verilator
print("Installing Verilator...") print("Installing Verilator...")
run_command("sudo apt install -y verilator") run_command("sudo apt-get install -y verilator")
# Verify installation # Verify installation
result = run_command("verilator --version", check=False) result = run_command("verilator --version", check=False)