You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/docs/guides/build/_index.md
+28-26Lines changed: 28 additions & 26 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,32 +11,11 @@ You'll need [Go](https://go.dev) installed on your machine to build TinyGo. The
11
11
12
12
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.
13
13
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.
14
15
15
16
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.
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.
40
19
41
20
***If you installed TinyGo via a package manager the command will depend on your operating system.***
42
21
@@ -72,6 +51,29 @@ scoop uninstall tinygo
72
51
73
52
You should also check if there's a remaining `tinygo` executable in your path and remove it too.
74
53
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.
76
57
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.
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.
Copy file name to clipboardExpand all lines: content/docs/guides/build/bring-your-own-llvm.md
+2-4Lines changed: 2 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,7 +5,7 @@ description: >
5
5
How to build TinyGo with a system-installed version of LLVM.
6
6
---
7
7
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!
9
9
10
10
11
11
| 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
73
73
go install
74
74
```
75
75
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)
77
77
78
78
Below is an example of running `tinygo version` and example output to check that
79
79
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
84
84
85
85
If not see the [troubleshooting](#troubleshooting) section.
86
86
87
-
If you have gotten this far, please refer to [Additional requirements](./additional-requirements) to further set up TinyGo.
**Fedora** users may install all required tools with:
28
+
**Linux Fedora** users may install all required tools with:
29
29
```shell
30
30
sudo dnf groupinstall "Development Tools"
31
31
sudo dnf install cmake ninja-build
@@ -89,15 +89,15 @@ $ ./build/tinygo version
89
89
tinygo version 0.31.0-dev-d4189fec linux/amd64 (using go version go1.21.4 and LLVM version 16.0.1)
90
90
```
91
91
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)
93
93
94
+
#### Adding tinygo to your path
94
95
95
96
**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.
97
98
```shell
98
99
mv ./build/tinygo /usr/bin/
99
100
```
100
101
If you ran the above command, **uninstalling** TinyGo is as easy as running `rm /usr/bin/tinygo`.
101
102
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