Skip to content

Commit

Permalink
Reorganize scripts/ directory
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkewley committed Jul 4, 2024
1 parent 9433da0 commit 9558dff
Show file tree
Hide file tree
Showing 18 changed files with 66 additions and 29 deletions.
9 changes: 3 additions & 6 deletions scripts/build_debian-buster.sh
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
#!/usr/bin/env bash

# Ubuntu 20 (Groovy) / Debian Buster: end-2-end build
#
# - this script should run to completion on a clean install of the
# OSes and produce a ready-to-use osc build
# `build_debian-buster.sh`: performs an end-to-end build of OpenSim Creator
# on Debian platforms
#
# - run this from the repo root (opensim-creator) dir

# usage (must be ran in repository root): `bash build_debian-buster.sh`

# error out of this script if it fails for any reason
set -xeuo pipefail
Expand Down
6 changes: 6 additions & 0 deletions scripts/build_emscripten.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/usr/bin/env bash
#
# `build_emscripten.sh`: performs an end-to-end build of the `hellotriangle` demo
# of OpenSim Creator using the Emscripten SDK (`emmake`, `emcc`, etc.) toolchain
# to build a wasm version of the binary
#
# usage (must be ran in repository root): `bash build_emscripten.sh`

set -xeuo pipefail

Expand Down
9 changes: 6 additions & 3 deletions scripts/build_linux_debugging.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/usr/bin/env bash

# build OSC with all the necessary debugging bells and whistles
# that are used during a release
#
# `build_linux_debugging.sh`: performs an end-to-end build of OpenSim Creator with
# as many debugging options enabled as possible. This is usaully used to verify a
# release, or lint the source code
#
# usage (must be ran in repository root): `bash build_linux_debugging.sh`

set -xeuo pipefail
OSC_BUILD_CONCURRENCY=$(nproc)
Expand Down
7 changes: 5 additions & 2 deletions scripts/build_linux_valgrind-compat.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
#!/usr/bin/env bash

# throwaway script for building and OSC that's compatible with valgrind
# debugging on Ubuntu20
# `build_linux_valgrind-compat`: performs an end-to-end build of OpenSim Creator
# with build flags that make it valgrind-compatible. This is handy for debugging
# things like memory accesses, segfaults, etc.
#
# usage (must be ran in repository root): `bash build_linux_valgrind-compat.sh`

set -xeuo pipefail

Expand Down
8 changes: 3 additions & 5 deletions scripts/build_mac.sh
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
#!/usr/bin/env bash

# Mac Catalina: end-2-end build
# `build_mac`: performs an end-to-end build of OpenSim Creator on the
# mac platform
#
# - this script should run to completion on a relatively clean
# Catalina (OSX 10.5) machine with xcode, CMake, etc. installed
#
# - run this from the repo root (opensim-creator) dir
# usage (must be ran in repository root): `bash build_mac.sh`


# error out of this script if it fails for any reason
Expand Down
7 changes: 7 additions & 0 deletions scripts/build_windows.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
#!/usr/bin/env python3

# `build_windows`: performs an end-to-end build of OpenSim Creator on
# the Windows platform
#
# usage (run it from the root of the repository): `python3 build_windows.py`

import argparse
import logging
import multiprocessing
Expand Down
9 changes: 9 additions & 0 deletions scripts/bump_zenodo_details.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
#!/usr/bin/env python3
#
# `bump_zenodo_details`: automatically updates relevant source files in
# the repository (e.g. the README, CITATION.cff) to point at the latest
# Zenodo release
#
# usage: `python bump_zenodo_details.py` (follow the prompts)
# `git diff` (ensure it made sane changes)

import datetime
import re
import subprocess
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
5 changes: 4 additions & 1 deletion scripts/env_libasan.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
# usage (unix only): `source env_libasan.sh`
# `env_libasan.sh`: sets up an environment for running libASAN-enabled
# binaries with aggressive flags
#
# usage (unix only): `source env_libasan.sh`

# - these are libASAN options that I use when debugging OSC
# - it assumes you have compiled OSC with libASAN, e.g.:
Expand Down
6 changes: 3 additions & 3 deletions scripts/env_wsl2.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# usage (unix only): `source env_wsl2.sh`

# environment variables that can be handy in Windows 11's WSL2
# `env_wsl2.sh`: sets up a WSL2 environment to use WSL2 optimally
#
# usage (WSL2 unix terminal only): `source env_wsl2.sh`

# force OSC to render via Mesa (see env_mesa_debugging.sh)
# LIBGL_ALWAYS_SOFTWARE=1
Expand Down
9 changes: 8 additions & 1 deletion scripts/format_sources.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
#!/usr/bin/env python3

# recursively adds trailing newline to any files missing one in the given dir
# `format_sources`: applies basic text formatting to any files found in the
# given (command-line argument) directories
#
# formatting steps:
#
# - ensures files have a trailing newline
# - ensures files have stripped whitespace (i.e. no trailing whitespace)
# - ensures files don't use tabs (it's a race war, or something)

import argparse
import os
Expand Down
8 changes: 4 additions & 4 deletions scripts/generate_icon_files.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#!/usr/bin/env python3

# this is a script for generating icon files that Mac (icns) and Windows (ico)
# use
# `generate_icon_files`: generates icon files from images that are compatible with
# Mac's (icns) and Windows' (ico) icon systems
#
# guide:
# usage:
#
# - open raw icon SVG in editor (e.g. inkscape)
# - save the raw icon SVG as a high (e.g. 1024x1024) resolution PNG file (e.g. logoBIG.png)
Expand All @@ -20,7 +20,7 @@

import argparse
import os
from PIL import Image # pip install Pillow
from PIL import Image # `pip install Pillow`

def convert(input_filename, output_filename):
assert os.path.exists(input_filename)
Expand Down
3 changes: 2 additions & 1 deletion scripts/get_osc_github_download_counts.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#!/usr/bin/env python3

# run this to get the download counters for osc on GitHub
# `get_osc_github_download_counts`: print the GitHub download counters for
# all releases of OpenSim Creator to the standard output

import datetime
import itertools
Expand Down
2 changes: 1 addition & 1 deletion scripts/hellotriangle.html
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<span id='controls'>
<span><input type="checkbox" id="resize">Resize canvas</span>
<span><input type="checkbox" id="pointerLock" checked>Lock/hide mouse pointer &nbsp;&nbsp;&nbsp;</span>
<span><input type="button" value="Fullscreen" onclick="Module.requestFullscreen(document.getElementById('pointerLock').checked,
<span><input type="button" value="Fullscreen" onclick="Module.requestFullscreen(document.getElementById('pointerLock').checked,
document.getElementById('resize').checked)">
</span>
</span>
Expand Down
7 changes: 5 additions & 2 deletions scripts/mac_suppressions.supp
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
# usage: ASAN_OPTIONS=detect_leaks=1 LSAN_OPTIONS=suppressions=suppressions.supp ./osc-build/tests/TestOpenSimCreator/TestOpenSimCreator
# `mac_suppressions.supp`: a list of known leaks/issues in the binaries
# that are spuriously detected by libASAN
#
# usage: ASAN_OPTIONS=detect_leaks=1 LSAN_OPTIONS=suppressions=suppressions.supp ./osc-build/tests/TestOpenSimCreator/TestOpenSimCreator

leak:SDL
leak:NS
leak:dyld4
Expand All @@ -8,4 +12,3 @@ leak:HIView
leak:glDrawElementsInstanced
leak:glDrawElementsBaseVertex
leak:CUICoreThemeRenderer

0 comments on commit 9558dff

Please sign in to comment.