Skip to content

Commit

Permalink
Merge pull request #5659 from sylvestre/build-gnu
Browse files Browse the repository at this point in the history
build-gnu.sh: build in debug by default. Easier for local dev
  • Loading branch information
cakebaker committed Dec 16, 2023
2 parents 2811140 + ba0c89f commit be9b675
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/GnuTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
run: |
## Build binaries
cd '${{ steps.vars.outputs.path_UUTILS }}'
bash util/build-gnu.sh
bash util/build-gnu.sh --release-build
- name: Run GNU tests
shell: bash
run: |
Expand Down Expand Up @@ -354,7 +354,7 @@ jobs:
run: |
## Build binaries
cd uutils
UU_MAKE_PROFILE=debug bash util/build-gnu.sh
bash util/build-gnu.sh
- name: Run GNU tests
run: bash uutils/util/run-gnu-test.sh
- name: Generate coverage data (via `grcov`)
Expand Down
4 changes: 2 additions & 2 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ To run uutils against the GNU test suite locally, run the following commands:

```shell
bash util/build-gnu.sh
# Build uutils without release optimizations
UU_MAKE_PROFILE=debug bash util/build-gnu.sh
# Build uutils with release optimizations
bash util/build-gnu.sh --release-build
bash util/run-gnu-test.sh
# To run a single test:
bash util/run-gnu-test.sh tests/touch/not-owner.sh # for example
Expand Down
17 changes: 13 additions & 4 deletions util/build-gnu.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash
# `build-gnu.bash` ~ builds GNU coreutils (from supplied sources)
#
# UU_MAKE_PROFILE == 'debug' | 'release' ## build profile for *uutils* build; may be supplied by caller, defaults to 'release'

# spell-checker:ignore (paths) abmon deref discrim eacces getlimits getopt ginstall inacc infloop inotify reflink ; (misc) INT_OFLOW OFLOW baddecode submodules ; (vars/env) SRCDIR vdir rcexp xpart dired

Expand All @@ -11,6 +10,19 @@ ME="${0}"
ME_dir="$(dirname -- "$(readlink -fm -- "${ME}")")"
REPO_main_dir="$(dirname -- "${ME_dir}")"

# Default profile is 'debug'
UU_MAKE_PROFILE='debug'

for arg in "$@"
do
if [ "$arg" == "--release-build" ]; then
UU_MAKE_PROFILE='release'
break
fi
done

echo "UU_MAKE_PROFILE='${UU_MAKE_PROFILE}'"

### * config (from environment with fallback defaults); note: GNU is expected to be a sibling repo directory

path_UUTILS=${path_UUTILS:-${REPO_main_dir}}
Expand Down Expand Up @@ -56,9 +68,6 @@ echo "path_GNU='${path_GNU}'"

###

UU_MAKE_PROFILE=${UU_MAKE_PROFILE:-release}
echo "UU_MAKE_PROFILE='${UU_MAKE_PROFILE}'"

UU_BUILD_DIR="${path_UUTILS}/target/${UU_MAKE_PROFILE}"
echo "UU_BUILD_DIR='${UU_BUILD_DIR}'"

Expand Down

0 comments on commit be9b675

Please sign in to comment.