Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 6 additions & 22 deletions configure/attributes.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,12 @@ config_setting(
This declares a `cc_binary` that "chooses" its deps based on the flags at the
command line. Specifically, `deps` becomes:

<table>
<tr style="background: #E9E9E9; font-weight: bold">
<td>Command</td>
<td>deps =</td>
</tr>
<tr>
<td><code>bazel build //myapp:mybinary --cpu=arm</code></td>
<td><code>[":arm_lib"]</code></td>
</tr>
<tr>
<td><code>bazel build //myapp:mybinary -c dbg --cpu=x86</code></td>
<td><code>[":x86_dev_lib"]</code></td>
</tr>
<tr>
<td><code>bazel build //myapp:mybinary --cpu=ppc</code></td>
<td><code>[":generic_lib"]</code></td>
</tr>
<tr>
<td><code>bazel build //myapp:mybinary -c dbg --cpu=ppc</code></td>
<td><code>[":generic_lib"]</code></td>
</tr>
</table>
| Command | deps |
| ----------------------------------------------- | ------------------ |
| `bazel build //myapp:mybinary --cpu=arm` | `[":arm_lib"]` |
| `bazel build //myapp:mybinary -c dbg --cpu=x86` | `[":x86_dev_lib"]` |
| `bazel build //myapp:mybinary --cpu=ppc` | `[":generic_lib"]` |
| `bazel build //myapp:mybinary -c dbg --cpu=ppc` | `[":generic_lib"]` |

`select()` serves as a placeholder for a value that will be chosen based on
*configuration conditions*, which are labels referencing [`config_setting`](/reference/be/general#config_setting)
Expand Down
12 changes: 12 additions & 0 deletions copy-upstream-docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ if [ ! -d "$SOURCE_DIR" ]; then
exit 1
fi

(
cd upstream
echo "Patching files"
patch -p1 < ../patches/*.patch
)

echo "Finding all .md files in $SOURCE_DIR..."

# Find all .md files and copy them
Expand Down Expand Up @@ -84,5 +90,11 @@ find "$SOURCE_DIR" -name "*.md" -type f | while read -r source_file; do
awk -f transform-docs.awk "$source_file" > "$target_file"
done

(
cd upstream
echo "Undoing patches"
git reset --hard
)

echo "Successfully copied all .md files to .mdx files in root"
echo "You can now modify the files as needed."
39 changes: 39 additions & 0 deletions patches/attributes.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
diff --git a/site/en/configure/attributes.md b/site/en/configure/attributes.md
index 7b55a6f..945ac81 100644
--- a/site/en/configure/attributes.md
+++ b/site/en/configure/attributes.md
@@ -45,28 +45,12 @@ config_setting(
This declares a `cc_binary` that "chooses" its deps based on the flags at the
command line. Specifically, `deps` becomes:

-<table>
- <tr style="background: #E9E9E9; font-weight: bold">
- <td>Command</td>
- <td>deps =</td>
- </tr>
- <tr>
- <td><code>bazel build //myapp:mybinary --cpu=arm</code></td>
- <td><code>[":arm_lib"]</code></td>
- </tr>
- <tr>
- <td><code>bazel build //myapp:mybinary -c dbg --cpu=x86</code></td>
- <td><code>[":x86_dev_lib"]</code></td>
- </tr>
- <tr>
- <td><code>bazel build //myapp:mybinary --cpu=ppc</code></td>
- <td><code>[":generic_lib"]</code></td>
- </tr>
- <tr>
- <td><code>bazel build //myapp:mybinary -c dbg --cpu=ppc</code></td>
- <td><code>[":generic_lib"]</code></td>
- </tr>
-</table>
+| Command | deps |
+| ----------------------------------------------- | ------------------ |
+| `bazel build //myapp:mybinary --cpu=arm` | `[":arm_lib"]` |
+| `bazel build //myapp:mybinary -c dbg --cpu=x86` | `[":x86_dev_lib"]` |
+| `bazel build //myapp:mybinary --cpu=ppc` | `[":generic_lib"]` |
+| `bazel build //myapp:mybinary -c dbg --cpu=ppc` | `[":generic_lib"]` |

`select()` serves as a placeholder for a value that will be chosen based on
*configuration conditions*, which are labels referencing [`config_setting`](/reference/be/general#config_setting)