Skip to content

Commit

Permalink
Adds info about rust, wasm-pack, and binaryen to relevant readmes (#3…
Browse files Browse the repository at this point in the history
…7055)

* Adds info about rust, wasm-pack, and binaryen to relevant readme's

* CR

* Capitalizing Linux

* formatting

* Accurately identifies when wasm-opt need be installed manually

https://github.com/rustwasm/wasm-pack/blob/bdc4884fc5dcb50d78e521acfb2f613fb6588b48/src/install/mod.rs#L175-L183
is the internal wasm-pack code that checks for wasm-opt and installs it automatically if it's not found, but
only for certain os/arch combinations.
  • Loading branch information
Isaiah Becker-Mayer authored Feb 22, 2024
1 parent 6ab8026 commit 9afd175
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 23 deletions.
33 changes: 18 additions & 15 deletions BUILD_macos.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ PRs with corrections and updates are welcome!
* Install [Homebrew](https://brew.sh/)
* `Go` version from
[go.mod](https://github.com/gravitational/teleport/blob/master/go.mod#L3)

* Follow [official instructions](https://go.dev/doc/install) to install `Go`
* **On an M1 Mac, download ARM64 installer from https://go.dev/dl/**
* Download the installer for `<version from go.mod>`
* Download the installer for `<version from go.mod>`
* After installing, don't forget to `export PATH="/usr/local/go/bin:$PATH"` in `~/.zprofile`
* If you need other go versions, see https://go.dev/doc/manage-install
* You will need to add `export PATH="$HOME/go/bin:$PATH"` to the `~/.zprofile`
Expand All @@ -22,7 +22,7 @@ PRs with corrections and updates are welcome!
#
# check which version will be installed by running:
# brew info go

brew install go
````

Expand All @@ -36,27 +36,27 @@ PRs with corrections and updates are welcome!
```shell
brew install rustup
```

* Initialize Rustup

```shell
rustup-init
#
# accept defaults
#
# Once command finishes successfully, you might need to add
#
#
# export PATH="$HOME/.cargo/bin:$PATH"
#
#
# into ~/.zprofile and run:
#
#
# . ~/.zprofile
#
#
# or open a new shell
```

* Install the required version

```shell
rustup toolchain install <version from build.assets/versions.mk>
cd <teleport.git>
Expand All @@ -77,9 +77,12 @@ PRs with corrections and updates are welcome!
brew install pkg-config
```

* To install `yarn` for building the UI
* To install tools for building the UI:
* `brew install node yarn`
* Currently, [`yarn`](https://classic.yarnpkg.com/en/docs/install) (< 2.0.0) is required
* The `Rust` and `Cargo` version in [build.assets/Makefile](https://github.com/gravitational/teleport/blob/master/build.assets/versions.mk#L11) (search for `RUST_VERSION`) are required.
* The [`wasm-pack`](https://github.com/rustwasm/wasm-pack) version in [build.assets/Makefile](https://github.com/gravitational/teleport/blob/master/build.assets/versions.mk#L12) (search for `WASM_PACK_VERSION`) is required:
`curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh`

##### Local Tests Dependencies

Expand All @@ -91,7 +94,7 @@ To run a full test suite locally, you will need
brew install helm
helm plugin install https://github.com/quintush/helm-unittest
```

* `bats-core` version from [build.assets/Dockerfile](https://github.com/gravitational/teleport/blob/master/build.assets/Dockerfile#L183) (search for `bats-core`)

```shell
Expand All @@ -106,14 +109,14 @@ To run a full test suite locally, you will need
rm -rf bats-core-1.2.1 bats.tar.gz
```

* `protoc` binary, typically found in `protobuf` package
* `protoc` binary, typically found in `protobuf` package

```shell
brew install protobuf
```

* increased `ulimit -n`

```shell
ulimit -n 2560 # 10x default
```
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,14 +104,14 @@ Teleport Team

### Deploy Teleport

If you wish to deploy Teleport inside a Docker container see the
If you wish to deploy Teleport inside a Docker container see the
[installation guide](https://goteleport.com/docs/installation/#running-teleport-on-docker).

### For Local Testing and Development

Follow the instructions in the [docker/README](docker/README.md) file.

To run a full test suite locally, see [the test dependencies list](BUILD_macos.md#local-tests-dependencies)
To run a full test suite locally, see [the test dependencies list](BUILD_macos.md#local-tests-dependencies)

## Building Teleport

Expand Down Expand Up @@ -147,10 +147,15 @@ Ensure you have installed correct versions of necessary dependencies:
[build.assets/Makefile](https://github.com/gravitational/teleport/blob/master/build.assets/Makefile#L21)
(search for `RUST_VERSION`)
* For `tsh` version > `10.x` with FIDO support, you will need `libfido` and `openssl 1.1` installed locally
* To build the web UI, [`yarn`](https://classic.yarnpkg.com/en/docs/install)(< 2.0.0) is required.
* To build the web UI:
* [`yarn`](https://classic.yarnpkg.com/en/docs/install)(< 2.0.0) is required.
* If you prefer not to install/use yarn, but have docker available, you can run `make docker-ui` instead.
* The `Rust` and `Cargo` version in [build.assets/Makefile](https://github.com/gravitational/teleport/blob/master/build.assets/versions.mk#L11) (search for `RUST_VERSION`) are required.
* The [`wasm-pack`](https://github.com/rustwasm/wasm-pack) version in [build.assets/Makefile](https://github.com/gravitational/teleport/blob/master/build.assets/versions.mk#L12) (search for `WASM_PACK_VERSION`) is required.
* [`binaryen`](https://github.com/WebAssembly/binaryen) (which contains `wasm-opt`) is required to be installed manually
on linux aarch64 (64-bit ARM). You can check if it's already installed on your system by running `which wasm-opt`. If not you can install it like `apt-get install binaryen` (for Debian-based Linux). `wasm-pack` will install this automatically on other platforms.

For an example of Dev Environment setup on a Mac, see [these instructions](BUILD_macos.md).
For an example of Dev Environment setup on a Mac, see [these instructions](BUILD_macos.md).

#### Perform a build

Expand All @@ -161,7 +166,7 @@ For an example of Dev Environment setup on a Mac, see [these instructions](BUILD
without swap will **not** work.
>* This will build the latest version of Teleport, **regardless** of whether it
is stable. If you want to build the latest stable release, run `git checkout`
and `git submodule update --recursive` to the corresponding tag (for example,
and `git submodule update --recursive` to the corresponding tag (for example,
>* run `git checkout v8.0.0`) **before** performing a build.
Get the source
Expand All @@ -171,7 +176,7 @@ git clone https://github.com/gravitational/teleport.git
cd teleport
```

To perform a build
To perform a build

```shell
make full
Expand All @@ -180,7 +185,7 @@ make full
To build `tsh` with Apple TouchID support enabled:

> **Important**
>
>
>`tsh` binaries with Touch ID support are only functional using binaries signed
with Teleport's Apple Developer ID and notarized by Apple. If you are a Teleport
maintainer, ask the team for access.
Expand Down Expand Up @@ -373,7 +378,7 @@ Yes -- Teleport is production-ready and designed to protect and facilitate
access to the most precious and mission-critical applications.
Teleport has completed several security audits from nationally and
internationally recognized technology security companies.
internationally recognized technology security companies.
We publicize some of our audit results, security philosophy and related
information on our [trust page](https://trust.goteleport.com/).
Expand Down
7 changes: 7 additions & 0 deletions web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ Then you need download and initialize these repository dependencies.
$ yarn install
```

You will also need the following tools installed:
* The `Rust` and `Cargo` version in [build.assets/Makefile](https://github.com/gravitational/teleport/blob/master/build.assets/versions.mk#L11) (search for `RUST_VERSION`) are required.
* The [`wasm-pack`](https://github.com/rustwasm/wasm-pack) version in [build.assets/Makefile](https://github.com/gravitational/teleport/blob/master/build.assets/versions.mk#L12) (search for `WASM_PACK_VERSION`) is required:
`curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh`
* [`binaryen`](https://github.com/WebAssembly/binaryen) (which contains `wasm-opt`) is required to be installed manually
on linux aarch64 (64-bit ARM). You can check if it's already installed on your system by running `which wasm-opt`. If not you can install it like `apt-get install binaryen` (for Debian-based Linux). `wasm-pack` will install this automatically on other platforms.

To build the Teleport open source version

```
Expand Down

0 comments on commit 9afd175

Please sign in to comment.