Skip to content

Commit 35338da

Browse files
1 parent f1a9526 commit 35338da

676 files changed

Lines changed: 12279 additions & 10148 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

buildcop.html

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -198,11 +198,14 @@ <h1 id="process">Process</h1>
198198
revert the commits and verify that the continuous builds triggered by that merge
199199
pass.</p>
200200

201-
<p>In the case of failures in a <code class="language-plaintext highlighter-rouge">dev</code> directory, the build cop should disable the
202-
failing test instead of reverting the entire commit. To disable the test in
203-
certain configurations, add <code class="language-plaintext highlighter-rouge">opt_out_conditions = []</code> to its BUILD rule. If it
204-
fails in the default configuration or in too many configurations to list one by
205-
one, use <code class="language-plaintext highlighter-rouge">tags = ["manual"]</code> to universally disable the test.</p>
201+
<p>In the case of failures in an <code class="language-plaintext highlighter-rouge">experimental</code> or <code class="language-plaintext highlighter-rouge">dev</code> directory, the build
202+
cop should disable the failing test instead of reverting the entire commit. To
203+
disable the test in certain configurations, add <code class="language-plaintext highlighter-rouge">opt_out_conditions = []</code> to
204+
its BUILD rule. If it fails in the default configuration or in too many
205+
configurations to list one by one, use <code class="language-plaintext highlighter-rouge">tags = ["manual"]</code> to universally
206+
disable the test. If the failure is during build instead of test, disable
207+
part(s) of the build until everything is working again. If possible, ping the
208+
code’s author / maintainer in your pull request that disables it.</p>
206209

207210
<p>In the case of intermittent failures of unclear origin or which cannot
208211
reasonably be prevented (for example, network failures of remotely hosted

developers.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ <h2 id="review-process">Review Process</h2>
293293
<li>Data files do not count towards the line limit.</li>
294294
<li>Machine-generated changes do not count towards the line limit.</li>
295295
<li>Files in
296-
<a href="/directory_structure.html#dev-directories">Dev Directories</a>
296+
<a href="/directory_structure.html#experimental-and-dev-directories">Dev Directories</a>
297297
do not count towards the line limit.</li>
298298
<li>This rule may be overridden by agreement of at least two platform reviewers
299299
(listed below).</li>

directory_structure.html

Lines changed: 36 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -156,35 +156,55 @@ <h1>Directory Structure</h1>
156156
<p>The current directory structure in Drake is organized to (1) group functional
157157
components, (2) limit dependencies, and (3) prevent circular dependencies.</p>
158158

159-
<h1 id="dev-directories">Dev Directories</h1>
159+
<h1 id="experimental-and-dev-directories">Experimental and Dev Directories</h1>
160160

161161
<p>All code in Drake must adhere to the code standards described in the notes
162162
<a href="/developers.html#developer-notes">For Developers</a> and must be covered by
163-
tests, unless the code lives in a subdirectory named <code class="language-plaintext highlighter-rouge">dev</code>.</p>
163+
tests, unless the code lives in a subdirectory named <code class="language-plaintext highlighter-rouge">experimental</code> or
164+
<code class="language-plaintext highlighter-rouge">dev</code>.</p>
164165

165166
<p>To promote rapid development of research ideas, experimental code may be placed
166-
in a subdirectory named <code class="language-plaintext highlighter-rouge">dev</code>. We do not enforce code standards nor test
167-
coverage within <code class="language-plaintext highlighter-rouge">dev</code> directories. For pull requests that affect only
168-
<code class="language-plaintext highlighter-rouge">dev</code> directories, one feature review is sufficient; platform review is not
169-
required. If build or test targets in <code class="language-plaintext highlighter-rouge">dev</code> directories break, the response
170-
from the on-call build cop will be to disable the offending targets.</p>
171-
172-
<p>The <code class="language-plaintext highlighter-rouge">BUILD.bazel</code> file for <code class="language-plaintext highlighter-rouge">dev</code> directories must live within the directory
173-
itself, not a parent directory. (For example, <code class="language-plaintext highlighter-rouge">foo/BUILD.bazel</code> must <strong>not</strong>
174-
say <code class="language-plaintext highlighter-rouge">srcs = ["dev/bar.cc"],</code>; instead, <code class="language-plaintext highlighter-rouge">foo/dev/BUILD.bazel</code> must exist and
175-
must say <code class="language-plaintext highlighter-rouge">srcs = ["bar.cc"],</code>.) This ensures that all <code class="language-plaintext highlighter-rouge">dev</code> code has a
176-
package name (<code class="language-plaintext highlighter-rouge">//foo/dev</code>) that clearly denotes it as such.</p>
167+
in a subdirectory named <code class="language-plaintext highlighter-rouge">experimental</code> or <code class="language-plaintext highlighter-rouge">dev</code>. We do not enforce code
168+
standards nor test coverage within those directories. For pull requests that
169+
affect only <code class="language-plaintext highlighter-rouge">experimental</code> or <code class="language-plaintext highlighter-rouge">dev</code> directories, one feature review is
170+
sufficient; platform review is not required.</p>
171+
172+
<p>If build or test targets in <code class="language-plaintext highlighter-rouge">experimental</code> or <code class="language-plaintext highlighter-rouge">dev</code> directories break, the
173+
response from the on-call build cop will be to disable the offending target(s),
174+
up to and including removing them from the build (and install) entirely. See
175+
<a href="/buildcop.html">Build Cop</a> for details.</p>
176+
177+
<p>The <code class="language-plaintext highlighter-rouge">BUILD.bazel</code> file for <code class="language-plaintext highlighter-rouge">experimental</code> and <code class="language-plaintext highlighter-rouge">dev</code> directories must live
178+
within the directory itself, not a parent directory. (For example,
179+
<code class="language-plaintext highlighter-rouge">foo/BUILD.bazel</code> must <strong>not</strong> say <code class="language-plaintext highlighter-rouge">srcs = ["experimental/bar.cc"],</code>;
180+
instead, <code class="language-plaintext highlighter-rouge">foo/experimental/BUILD.bazel</code> must exist and must say
181+
<code class="language-plaintext highlighter-rouge">srcs = ["bar.cc"],</code>.) This ensures that all <code class="language-plaintext highlighter-rouge">experimental</code> code has a
182+
package name (<code class="language-plaintext highlighter-rouge">//foo/experimental</code>) that clearly denotes it as such.</p>
183+
184+
<p>Code in <code class="language-plaintext highlighter-rouge">experimental</code> or <code class="language-plaintext highlighter-rouge">dev</code> may only be depended-on by other code in
185+
such directories. Stable code (outside of <code class="language-plaintext highlighter-rouge">experimental</code> and <code class="language-plaintext highlighter-rouge">dev</code>) must not
186+
<code class="language-plaintext highlighter-rouge">#include</code> nor <code class="language-plaintext highlighter-rouge">import</code> code from <code class="language-plaintext highlighter-rouge">experimental</code> or <code class="language-plaintext highlighter-rouge">dev</code>.</p>
187+
188+
<p>The distinction between <code class="language-plaintext highlighter-rouge">experimental</code> and <code class="language-plaintext highlighter-rouge">dev</code> is that code in
189+
<code class="language-plaintext highlighter-rouge">experimental</code> is installed by CMake, packaged as part of our nightly and
190+
stable release binaries, and has API documentation on our website, but code in
191+
<code class="language-plaintext highlighter-rouge">dev</code> is neither installed, packaged, nor website-documented. (A corollary is
192+
that code in <code class="language-plaintext highlighter-rouge">dev</code> cannot have Python bindings. If you need bindings, place
193+
your code in <code class="language-plaintext highlighter-rouge">experimental</code>, not <code class="language-plaintext highlighter-rouge">dev</code>.)</p>
194+
195+
<p>Code in <code class="language-plaintext highlighter-rouge">experimental</code> must have <code class="language-plaintext highlighter-rouge">experimental</code> as part of its C++ namespace
196+
and Python module name. It also must not be part of <code class="language-plaintext highlighter-rouge">import pydrake.all</code>.</p>
177197

178198
<h1 id="controlling-dependencies">Controlling Dependencies</h1>
179199

180-
<p>We would like to avoid circular dependencies in the source code tree. For
200+
<p>We would like to avoid circular dependencies in the source code tree. For
181201
example, some code in <code class="language-plaintext highlighter-rouge">drake/systems</code> depends on code in <code class="language-plaintext highlighter-rouge">drake/solvers</code>, so
182202
code in <code class="language-plaintext highlighter-rouge">drake/solvers</code> should <em>not</em> depend on <code class="language-plaintext highlighter-rouge">drake/systems</code>.</p>
183203

184204
<p>The <code class="language-plaintext highlighter-rouge">drake/examples</code> directories are logically after all of the core libraries
185-
in <code class="language-plaintext highlighter-rouge">drake</code>. <code class="language-plaintext highlighter-rouge">test</code> directories located throughout the code are logically
205+
in <code class="language-plaintext highlighter-rouge">drake</code>. <code class="language-plaintext highlighter-rouge">test</code> directories located throughout the code are logically
186206
last in the dependency tree – they are allowed to depend on any of the other
187-
directories. For example, <code class="language-plaintext highlighter-rouge">test</code> code <strong>is</strong> allowed to use models/code from
207+
directories. For example, <code class="language-plaintext highlighter-rouge">test</code> code <strong>is</strong> allowed to use models/code from
188208
the <code class="language-plaintext highlighter-rouge">examples</code> directories to test core functionality, as long as that
189209
dependency is explicitly declared in the build system rules for that test.</p>
190210

0 commit comments

Comments
 (0)