Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 24 additions & 3 deletions .devcontainer/post-create
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,31 @@

# Script to set up a development environment.

make install
make init
arch="$(uname -m)"

sudo apt-get update
sudo apt-get install -y gfortran

# On ARM64, pin gcc/g++/gfortran to version 12 to avoid a GCC 16 and binutils version mismatch:
if [ "${arch}" = "aarch64" ]; then
sudo apt-get install -y gfortran-12
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 100
sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-12 100
sudo update-alternatives --install /usr/bin/cc cc /usr/bin/gcc-12 100
sudo update-alternatives --install /usr/bin/gfortran gfortran /usr/bin/gfortran-12 100
else
sudo apt-get install -y gfortran
fi

make install
make init

make install-deps-r

# On ARM64, replace the wrong-architecture shellcheck binary with the correct one:
if [ "${arch}" = "aarch64" ]; then
sc_version="$(shellcheck --version 2>/dev/null | grep '^version:' | awk '{print $2}')"
if [ -n "${sc_version}" ]; then
curl -sL "https://github.com/koalaman/shellcheck/releases/download/v${sc_version}/shellcheck-v${sc_version}.linux.aarch64.tar.xz" \
| sudo tar xJ --strip-components=1 -C /usr/local/bin "shellcheck-v${sc_version}/shellcheck"
fi
fi
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
9f47bbff5624babfa712eb9d64ece14c6c46327122d0c54983f627ae3a30a4ac
4 changes: 1 addition & 3 deletions docs/contributing/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ There are primarily two options for setting up your development environment to c
1. [Manually setting up the development environment][manual-setup]
2. [Setting up the dev container][devcontainer-setup]

Note: The dev container does not yet support ARM64 architectures. For more information, or if you're interested in adding ARM64 support, you can visit this [issue][devcontainer-issue].
Note: The dev container supports both x86-64 and ARM64 architectures (including Apple Silicon).

<a name="install-cppcheck"></a>

Expand Down Expand Up @@ -403,8 +403,6 @@ For more `make` commands, refer to the [documentation][benchmark] on running ben

[devcontainer-setup]: https://github.com/stdlib-js/stdlib/blob/87cbd67623892f90ddeea94e1d4e01eeada417b5/docs/devcontainer_setup.md

[devcontainer-issue]: https://github.com/stdlib-js/stdlib/issues/4934

[install-link]: https://github.com/stdlib-js/stdlib/tree/develop/tools/make/lib/install#install

[ref-discussion]: https://github.com/stdlib-js/stdlib/pull/2298#discussion_r1624765205
Expand Down
6 changes: 1 addition & 5 deletions docs/contributing/setting_up_a_devcontainer.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,7 @@ We appreciate your interest in contributing to stdlib! Below, we've provided a s

Dev containers are Docker containers that are specifically configured to provide a fully featured development environment with the right tooling, extensions, linting and formatting. They allow you to open any folder inside (or mounted into) a container and take advantage of Visual Studio Code's full feature set.

The stdlib repository includes a preconfigured dev container, making it the easiest way to set up your development environment. It ensures proper linting, EditorConfig, and tooling are configured right from the start.

**Note:** The dev container does not yet support ARM64 architectures. For more information, or if you're interested in adding ARM64 support, you can visit this [issue][devcontainer-issue].
The stdlib repository includes a preconfigured dev container, making it the easiest way to set up your development environment. It ensures proper linting, EditorConfig, and tooling are configured right from the start. The dev container supports both x86-64 and ARM64 architectures (including Apple Silicon).

### Prerequisites

Expand Down Expand Up @@ -121,8 +119,6 @@ If you see this when you open the terminal, then the dev container installation

[vscode]: https://code.visualstudio.com/

[devcontainer-issue]: https://github.com/stdlib-js/stdlib/issues/4934

[github-fork]: https://help.github.com/articles/fork-a-repo/

</section>
Expand Down
8 changes: 6 additions & 2 deletions tools/make/lib/install/shellcheck.mk
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,16 @@ ifeq ($(OS), WINNT)
DEPS_SHELLCHECK_URL ?= https://github.com/koalaman/shellcheck/releases/download/v$(DEPS_SHELLCHECK_VERSION)/shellcheck-v$(DEPS_SHELLCHECK_VERSION).zip
else
ifeq ($(DEPS_SHELLCHECK_PLATFORM), darwin)
# TODO: handle arm64; currently, binaries for M1/M2 are not provided. See https://github.com/koalaman/shellcheck/issues/2714
# TODO: handle arm64; currently, darwin.aarch64 binaries are not provided for v0.8.0. See https://github.com/koalaman/shellcheck/issues/2714
DEPS_SHELLCHECK_URL ?= https://github.com/koalaman/shellcheck/releases/download/v$(DEPS_SHELLCHECK_VERSION)/shellcheck-v$(DEPS_SHELLCHECK_VERSION).darwin.x86_64.tar.xz
else
ifeq ($(DEPS_SHELLCHECK_ARCH), arm64)
DEPS_SHELLCHECK_URL ?= https://github.com/koalaman/shellcheck/releases/download/v$(DEPS_SHELLCHECK_VERSION)/shellcheck-v$(DEPS_SHELLCHECK_VERSION).linux.aarch64.tar.xz
else
DEPS_SHELLCHECK_URL ?= https://github.com/koalaman/shellcheck/releases/download/v$(DEPS_SHELLCHECK_VERSION)/shellcheck-v$(DEPS_SHELLCHECK_VERSION).linux.x86_64.tar.xz
endif
endif
endif

# Determine the basename for the download:
deps_shellcheck_basename := $(notdir $(DEPS_SHELLCHECK_URL))
Expand All @@ -48,7 +52,7 @@ ifeq ($(DEPS_SHELLCHECK_PLATFORM), win32)
else
ifeq ($(DEPS_SHELLCHECK_PLATFORM), darwin)
ifeq ($(DEPS_SHELLCHECK_ARCH), arm64)
# FIXME: this is a temporary workaround until M1/M2 shellcheck binaries can be installed locally
# FIXME: darwin.aarch64 binaries are not available for v0.8.0; fall back to system shellcheck
SHELLCHECK ?= shellcheck
else
SHELLCHECK ?= $(DEPS_SHELLCHECK_BUILD_OUT)/shellcheck
Expand Down