Skip to content

Commit

Permalink
Revert "feat: add gcc toolchain example" (#485)
Browse files Browse the repository at this point in the history
Reverts #355

See
#355 (comment).
Discussed in the rules SIG meeting.
  • Loading branch information
Wyverald authored Aug 22, 2024
1 parent a905ed1 commit 6583c1a
Show file tree
Hide file tree
Showing 11 changed files with 1 addition and 220 deletions.
8 changes: 1 addition & 7 deletions cpp-tutorial/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,11 @@ This folder is part of the C++ Bazel Tutorial, found at <https://bazel.build/sta

This package will showcase how to build C++ code in stages.

### Stage 0
The zeroth stage shows how to setup the toolchain so that Bazel doesn't use the system's C++ gcc toolchain.
This provides hermeticity, making the build more portable and reproducible on other computers.

> Note, this is for Linux only. MacOS and Windows still use the system gcc.
### Stage 1
The first stage is really simple and shows you how to compile a binary with a single source file.

### Stage 2
The second stage will showcase how to build an application with multiple source and header files, separated in a library and a binary.

### Stage 3
The third stage showcases how to link multiple build directories by building multiple libraries in different packages and then connecting it up with the main application.
The third stage showcases how to link multiple build directories by building multiple libraries in different packages and then connecting it up with the main application.
7 changes: 0 additions & 7 deletions cpp-tutorial/stage0/.bazelrc

This file was deleted.

Empty file removed cpp-tutorial/stage0/BUILD.bazel
Empty file.
101 changes: 0 additions & 101 deletions cpp-tutorial/stage0/README.md

This file was deleted.

21 changes: 0 additions & 21 deletions cpp-tutorial/stage0/WORKSPACE

This file was deleted.

7 changes: 0 additions & 7 deletions cpp-tutorial/stage1/.bazelrc

This file was deleted.

21 changes: 0 additions & 21 deletions cpp-tutorial/stage1/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,21 +0,0 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "aspect_gcc_toolchain",
sha256 = "3341394b1376fb96a87ac3ca01c582f7f18e7dc5e16e8cf40880a31dd7ac0e1e",
strip_prefix = "gcc-toolchain-0.4.2",
urls = [
"https://github.com/aspect-build/gcc-toolchain/archive/refs/tags/0.4.2.tar.gz",
],
)

load("@aspect_gcc_toolchain//toolchain:repositories.bzl", "gcc_toolchain_dependencies")

gcc_toolchain_dependencies()

load("@aspect_gcc_toolchain//toolchain:defs.bzl", "gcc_register_toolchain", "ARCHS")

gcc_register_toolchain(
name = "gcc_toolchain_x86_64",
target_arch = ARCHS.x86_64,
)
7 changes: 0 additions & 7 deletions cpp-tutorial/stage2/.bazelrc

This file was deleted.

21 changes: 0 additions & 21 deletions cpp-tutorial/stage2/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,21 +0,0 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "aspect_gcc_toolchain",
sha256 = "3341394b1376fb96a87ac3ca01c582f7f18e7dc5e16e8cf40880a31dd7ac0e1e",
strip_prefix = "gcc-toolchain-0.4.2",
urls = [
"https://github.com/aspect-build/gcc-toolchain/archive/refs/tags/0.4.2.tar.gz",
],
)

load("@aspect_gcc_toolchain//toolchain:repositories.bzl", "gcc_toolchain_dependencies")

gcc_toolchain_dependencies()

load("@aspect_gcc_toolchain//toolchain:defs.bzl", "gcc_register_toolchain", "ARCHS")

gcc_register_toolchain(
name = "gcc_toolchain_x86_64",
target_arch = ARCHS.x86_64,
)
7 changes: 0 additions & 7 deletions cpp-tutorial/stage3/.bazelrc

This file was deleted.

21 changes: 0 additions & 21 deletions cpp-tutorial/stage3/WORKSPACE
Original file line number Diff line number Diff line change
@@ -1,21 +0,0 @@
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")

http_archive(
name = "aspect_gcc_toolchain",
sha256 = "3341394b1376fb96a87ac3ca01c582f7f18e7dc5e16e8cf40880a31dd7ac0e1e",
strip_prefix = "gcc-toolchain-0.4.2",
urls = [
"https://github.com/aspect-build/gcc-toolchain/archive/refs/tags/0.4.2.tar.gz",
],
)

load("@aspect_gcc_toolchain//toolchain:repositories.bzl", "gcc_toolchain_dependencies")

gcc_toolchain_dependencies()

load("@aspect_gcc_toolchain//toolchain:defs.bzl", "gcc_register_toolchain", "ARCHS")

gcc_register_toolchain(
name = "gcc_toolchain_x86_64",
target_arch = ARCHS.x86_64,
)

0 comments on commit 6583c1a

Please sign in to comment.