chipsalliance / chipsalliance/rocket-chip

Missing ROCKETCHIP_ADDONS support for wake builds

Open
#2,307 1 comment 0 reactions 2 assignees Claimed by @jackkoenig View on GitHub
build proposal
Dominant language
Scala
Stars
3.9k
Forks
1.3k
Avg merge
5d 13m
Merged PRs (30d)
1

Description

If you have `ROCKETCHIP_ADDONS` (SBT unmanaged source directories) I can't seem to build the project using wake. Specifically, if the Rocket Chip sources are modified to require files inside the unmanaged sources, wake will fail to build the project due to not found errors.

**Type of issue**: bug report

**Impact**: no functional change

**Development Phase**: request

**Other information**

None.

**If the current behavior is a bug, please provide the steps to reproduce the problem:**

There's a complete example on a fork: https://github.com/chipsalliance/rocket-chip/compare/master...seldridge:wake-ROCKETCHIP_ADDONS

Add a Rocket Chip addon which defines a method/class necessary to build Rocket Chip, e.g., create: `foo/src/main/scala/foo/Bar.scala` with contents:
```scala
package foo

class Bar
```

Patch Rocket in the following way:

```diff
diff --git a/src/main/scala/system/ExampleRocketSystem.scala b/src/main/scala/system/ExampleRocketSystem.scala
index fc6c8bac..6d58c86c 100644
--- a/src/main/scala/system/ExampleRocketSystem.scala
+++ b/src/main/scala/system/ExampleRocketSystem.scala
@@ -19,6 +19,7 @@ class ExampleRocketSystem(implicit p: Parameters) extends RocketSubsystem
with CanHaveSlaveAXI4Port
with HasPeripheryBootROM {
override lazy val module = new ExampleRocketSystemModuleImp(this)
+ val bar = new foo.Bar
}

class ExampleRocketSystemModuleImp[+L <: ExampleRocketSystem](_outer: L) extends RocketSubsystemModuleImp(_outer)
```

Try to build the project:

```bash
cd $rocketChipDir
wit --repo-path $PWD/.. init workspace -a rocket-chip
cd workspace
env WAKE_PATH=$PATH wake --init .
env ROCKETCHIP_ADDONS=Foo WAKE_PATH=$PATH wake -dv 'compileScalaModule rocketchipScalaModule | getPathResult'
```

**What is the current behavior?**

This dies because it can't find `foo.Bar`:

```
[E] [E1] ../../rocket-chip/src/main/scala/system/ExampleRocketSystem.scala:22:17
[E] not found: value foo
[E] L22: val bar = new foo.Bar
```

**What is the expected behavior?**

You should be able to use `ROCKETCHIP_ADDONS` in wake builds.

**Please tell us about your environment:**

- version: 5e506e39 (master at the time of filing the issue)

**What is the use case for changing the behavior?**

This would enable parity between sbt and wake builds. Also, if running local Travis regressions on internal projects that require `ROCKETCHIP_ADDONS`, you wouldn't need to patch or disable wake checks.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.