Merge pull request #5659 from sylvestre/build-gnu

build-gnu.sh: build in debug by default. Easier for local dev
This commit is contained in:
Daniel Hofstetter 2023-12-16 16:23:15 +01:00 committed by GitHub
commit be9b675ec1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 8 deletions

View file

@ -116,7 +116,7 @@ jobs:
run: | run: |
## Build binaries ## Build binaries
cd '${{ steps.vars.outputs.path_UUTILS }}' cd '${{ steps.vars.outputs.path_UUTILS }}'
bash util/build-gnu.sh bash util/build-gnu.sh --release-build
- name: Run GNU tests - name: Run GNU tests
shell: bash shell: bash
run: | run: |
@ -354,7 +354,7 @@ jobs:
run: | run: |
## Build binaries ## Build binaries
cd uutils cd uutils
UU_MAKE_PROFILE=debug bash util/build-gnu.sh bash util/build-gnu.sh
- name: Run GNU tests - name: Run GNU tests
run: bash uutils/util/run-gnu-test.sh run: bash uutils/util/run-gnu-test.sh
- name: Generate coverage data (via `grcov`) - name: Generate coverage data (via `grcov`)

View file

@ -226,8 +226,8 @@ To run uutils against the GNU test suite locally, run the following commands:
```shell ```shell
bash util/build-gnu.sh bash util/build-gnu.sh
# Build uutils without release optimizations # Build uutils with release optimizations
UU_MAKE_PROFILE=debug bash util/build-gnu.sh bash util/build-gnu.sh --release-build
bash util/run-gnu-test.sh bash util/run-gnu-test.sh
# To run a single test: # To run a single test:
bash util/run-gnu-test.sh tests/touch/not-owner.sh # for example bash util/run-gnu-test.sh tests/touch/not-owner.sh # for example

View file

@ -1,7 +1,6 @@
#!/bin/bash #!/bin/bash
# `build-gnu.bash` ~ builds GNU coreutils (from supplied sources) # `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 # 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
@ -11,6 +10,19 @@ ME="${0}"
ME_dir="$(dirname -- "$(readlink -fm -- "${ME}")")" ME_dir="$(dirname -- "$(readlink -fm -- "${ME}")")"
REPO_main_dir="$(dirname -- "${ME_dir}")" 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 ### * config (from environment with fallback defaults); note: GNU is expected to be a sibling repo directory
path_UUTILS=${path_UUTILS:-${REPO_main_dir}} path_UUTILS=${path_UUTILS:-${REPO_main_dir}}
@ -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}" UU_BUILD_DIR="${path_UUTILS}/target/${UU_MAKE_PROFILE}"
echo "UU_BUILD_DIR='${UU_BUILD_DIR}'" echo "UU_BUILD_DIR='${UU_BUILD_DIR}'"