Skip to content

Commit 2689247

Browse files
soypatdeadprogram
authored andcommitted
switch uninstall/clone steps; minor cleanups
1 parent 3a67c68 commit 2689247

File tree

3 files changed

+36
-36
lines changed

3 files changed

+36
-36
lines changed

content/docs/guides/build/_index.md

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,11 @@ You'll need [Go](https://go.dev) installed on your machine to build TinyGo. The
1111

1212
A major dependency of TinyGo is [LLVM](https://llvm.org/). You can either use a version of LLVM already on your system or build LLVM manually. Building manually takes a long time (around an hour depending on how fast your system is) so it is recommended to use a version of LLVM already on your system if that's possible. The links provided below show how to install LLVM one way or the other.
1313

14+
After finishing building TinyGo from source remember to refer to the [additional requirements](./additional-requirements.md) page to ensure you have a fully working TinyGo installation.
1415

1516

16-
## Repository cloning (before build)
17-
Start with getting the source code. On Windows, you might want to install the [build dependencies](#build-dependencies) first.
18-
19-
```shell
20-
git clone https://github.com/tinygo-org/tinygo.git
21-
cd tinygo
22-
```
23-
24-
Once cloned, you can can choose which branch to build. The default branch is the latest release, but you can also build the latest development version:
25-
26-
```shell
27-
# If building released version this command is not necessary.
28-
git checkout dev
29-
```
30-
Once the branch is selected, pull submodules:
31-
32-
```shell
33-
git submodule update --init --recursive
34-
```
35-
36-
Now you are ready to build TinyGo- but you must choose whether to build with a [manual LLVM install](./manual-llvm) or with a [system installed LLVM](./bring-your-own-llvm). After building you should also read [additional requirements](./additional-requirements) to make sure you've fulfilled all the requirements for the features of TinyGo you'll be using.
37-
38-
## Uninstalling TinyGo
39-
It's highly suggested you uninstall an existing installation of TinyGo before proceeding.
17+
## Uninstalling TinyGo before build
18+
It's highly suggested you uninstall TinyGo if it is present on your computer before proceeding.
4019

4120
***If you installed TinyGo via a package manager the command will depend on your operating system.***
4221

@@ -72,6 +51,29 @@ scoop uninstall tinygo
7251

7352
You should also check if there's a remaining `tinygo` executable in your path and remove it too.
7453

75-
**Linux and MacOS** run `echo $(which tinygo)` to print the path to the existing TinyGo executable.
54+
**Linux and MacOS** may run `echo $(which tinygo)` to print the path to the existing TinyGo executable.
55+
56+
**Windows** users may run `where tinygo` to see the where any remaining TinyGo executable is located at.
7657

77-
**Windows** users may run `where tinygo` to see the where any remaining TinyGo executable is located at.
58+
59+
## Repository cloning (before build)
60+
Start with getting the source code. On Windows, you might want to install the [build dependencies](#build-dependencies) first.
61+
62+
```shell
63+
git clone https://github.com/tinygo-org/tinygo.git
64+
cd tinygo
65+
```
66+
67+
Once cloned, you can can choose which branch to build. The default branch is the latest release, but you can also build the latest development version:
68+
69+
```shell
70+
# If building released version this command is not necessary.
71+
git checkout dev
72+
```
73+
Once the branch is selected, pull submodules:
74+
75+
```shell
76+
git submodule update --init --recursive
77+
```
78+
79+
Now you are ready to build TinyGo- but you must choose whether to build with a [manual LLVM install](./manual-llvm) or with a [system installed LLVM](./bring-your-own-llvm). After building you should also read [additional requirements](./additional-requirements) to make sure you've fulfilled all the requirements for the features of TinyGo you'll be using.

content/docs/guides/build/bring-your-own-llvm.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ description: >
55
How to build TinyGo with a system-installed version of LLVM.
66
---
77

8-
⚠️ Halt! This is the system installed LLVM guide! Please check the following table and make sure you don't need the [manual LLVM install guide](./manual-llvm) instead!
8+
⚠️ Halt! This is the system installed LLVM guide! Please check the following table and make sure you don't need the [manual LLVM install guide](../manual-llvm) instead!
99

1010

1111
| You need to build LLVM manually in the following cases |
@@ -73,7 +73,7 @@ After LLVM has been installed, installing TinyGo should be as easy as running th
7373
go install
7474
```
7575

76-
You should now have a working TinyGo installation!
76+
You should now have a working TinyGo installation! What's left now is to complete the [additional requirements](../additional-requirements)
7777

7878
Below is an example of running `tinygo version` and example output to check that
7979
TinyGo was installed correctly (copy only what's in front of the `$` sign to your terminal!):
@@ -84,8 +84,6 @@ tinygo version 0.31.0-dev-d4189fec linux/amd64 (using go version go1.21.4 and LL
8484

8585
If not see the [troubleshooting](#troubleshooting) section.
8686

87-
If you have gotten this far, please refer to [Additional requirements](./additional-requirements) to further set up TinyGo.
88-
8987
## Troubleshooting
9088

9189
### `go install` command inner workings

content/docs/guides/build/manual-llvm.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,14 @@ description: >
1818
the dependencies needed to build LLVM will differ.*** Skip over to the command for your Operating System (OS) in this section (OS names are bolded):
1919

2020

21-
**Debian and Ubuntu** users may install all required tools this way:
21+
**Linux Debian and Ubuntu** users may install all required tools this way:
2222
```shell
2323
sudo apt-get install build-essential git cmake ninja-build
2424
```
2525

2626
---
2727

28-
**Fedora** users may install all required tools with:
28+
**Linux Fedora** users may install all required tools with:
2929
```shell
3030
sudo dnf groupinstall "Development Tools"
3131
sudo dnf install cmake ninja-build
@@ -89,15 +89,15 @@ $ ./build/tinygo version
8989
tinygo version 0.31.0-dev-d4189fec linux/amd64 (using go version go1.21.4 and LLVM version 16.0.1)
9090
```
9191

92-
You have successfully built TinyGo from source. Congratulations!
92+
You have successfully built TinyGo from source. Congratulations! What's left now is to complete the [additional requirements](../additional-requirements)
9393

94+
#### Adding tinygo to your path
9495

9596
**Linux** users may choose to run TinyGo from any directory you may want to move the built binary to a location on your path
96-
or add the `./build` directory to your path. The following shell command moves the TinyGo binary to `/user/bin`. You may need root privileges to complete this step.
97+
or add the `./build` directory to your path. The following shell command moves the TinyGo binary to `/user/bin` so that any user can run TinyGo. You may need root privileges to complete this step.
9798
```shell
9899
mv ./build/tinygo /usr/bin/
99100
```
100101
If you ran the above command, **uninstalling** TinyGo is as easy as running `rm /usr/bin/tinygo`.
101102

102-
103-
If you have gotten this far, please refer to [Additional requirements](./additional-requirements) to further set up TinyGo.
103+
If you'd prefer a user-based install you can move TinyGo to your `$HOME/go/bin` directory, where the Go compiler installs binaries by default. The directory should be added to your PATH if it hasn't already been added for this to work.

0 commit comments

Comments
 (0)