* Get a Teleport build working without wasm-pack * * seed docker images with wasm-opt, and wasm-bindgen-cli * Replace potentially confusing 'CARGO_TARGET_wasm' variable. * Replace oneoff .gitignore with a corresponding entry in the top level .gitignore. * Replace 'printf' used to create package.json file with a cleaner multiline string. * Remove unnecessary 'NEED_VERSION' * Use awk to find wasm-bindgen version without using 'cargo' since it doesn't seem to be available on ARM64 runners * Move 'WASM_BINDGEN_VERSION' definition out of versions.mk * Pass '--locked' flag to wasm-opt install
4.1 KiB
MacOS Environment Setup
To set up your MacOS environment, follow these steps using Homebrew as the main
package manager. Aim to install versions specified in
build.assets/versions.mk; for others, use the
latest Homebrew version.
The instructions below are provided on a best-effort basis. PRs with corrections and updates are welcome!
-
Install Homebrew
-
Install Go
brew install go -
Install Rust
-
Install rustup
Install rustup with Homebrew:
brew install rustup rustup-init # Accept defaults -
Install and configure Rust toolchain
-
Find the required Rust version in
build.assets/versions.mk(RUST_VERSION). -
Install the Rust toolchain:
# Replace <version> with the value of RUST_VERSION from build.assets/versions.mk (e.g., 1.81.0) rustup toolchain install <version> -
Set the default Rust toolchain globally (applies to all projects):
# Replace <version> with the value of RUST_VERSION from build.assets/versions.mk (e.g., 1.81.0) rustup default <version>Note: Using
rustup default <version>sets the toolchain globally for your user. If you only want to override the toolchain for a specific project directory, userustup override set <version>inside that directory instead. -
Verify the installed version:
rustc --version
-
-
-
Install Node.js
-
Find the required Node version in
build.assets/versions.mk(NODE_VERSION). -
Install Node.js (Homebrew only supports MAJOR version):
# Replace <version> with the MAJOR value of NODE_VERSION from build.assets/versions.mk (e.g., 22) brew install node@<version> -
Install to PATH and apply the changes to your shell:
# Replace <version> with the MAJOR value of NODE_VERSION from build.assets/versions.mk (e.g., 22) echo 'export PATH="/opt/homebrew/opt/node@<version>/bin:$PATH"' >> ~/.zshrc source ~/.zshrc -
Verify the installed version:
node --version
-
-
Install
libfido2:brew install libfido2 -
Install
pkg-config:brew install pkg-config -
Install
helmand thehelm-unittestplugin:brew install helm helm plugin install https://github.com/quintush/helm-unittest --version 0.2.11 -
Install
bats:-
Find the required
bats-coreversion frombuild.assets/Dockerfile(search forbats-core). -
Set the version variable and install
bats-core:# Replace <version> with the required bats-core version (e.g., 1.12.0) BATS_VERSION=1.12.0 curl -L https://github.com/bats-core/bats-core/archive/v${BATS_VERSION}.tar.gz -o ~/Downloads/bats.tar.gz cd ~/Downloads tar xzvf bats.tar.gz sudo mkdir -p /usr/local/libexec sudo chown $USER /usr/local/libexec cd bats-core-${BATS_VERSION} sudo ./install.sh /usr/local cd ../ rm -rf bats-core-${BATS_VERSION} bats.tar.gz -
Verify
batsinstallation:bats --version
-
-
Increase the maximum number of open files:
ulimit -n 2560 # 10x default -
Test the environment by building development artifacts and running tests:
make all test
Congrats! Your MacOS environment is now ready for development 🎉
If you encounter any issues, please refer to the official documentation or open an issue in the repository for assistance.