Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/improve output on errors #482

Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
0cabd97
Remove return/exit distinctions where not used
paulo-ferraz-oliveira Oct 22, 2023
31f1bcf
Update .kerl/otp_releases inplace
paulo-ferraz-oliveira Oct 22, 2023
0f23603
Fail louder
paulo-ferraz-oliveira Oct 22, 2023
403eca4
Error out on assertion site, not call site
paulo-ferraz-oliveira Oct 22, 2023
06c149a
Use less return/exit indirections
paulo-ferraz-oliveira Oct 22, 2023
f385275
Prevent return+exit in same function/scope
paulo-ferraz-oliveira Oct 22, 2023
df81849
Simplify `kerl active`
paulo-ferraz-oliveira Oct 22, 2023
6079a69
Add to current execution logging
paulo-ferraz-oliveira Oct 22, 2023
e139d49
Centralize curl calls to ease debug logging
paulo-ferraz-oliveira Oct 22, 2023
04cc564
Act on self-review: name flag more explicitly
paulo-ferraz-oliveira Oct 22, 2023
479e5d3
Act on self-review: add README note on how otp_releases is built
paulo-ferraz-oliveira Oct 22, 2023
70a37c8
Act on self-review: don't assume files aren't somehow protected
paulo-ferraz-oliveira Oct 22, 2023
fde8ee5
Act on self-review: ease maintenance of do_build function return
paulo-ferraz-oliveira Oct 22, 2023
b2a56c3
Act on local tests: silence tee
paulo-ferraz-oliveira Oct 22, 2023
cf21ba3
Act on self-review: be consistent in punctuation
paulo-ferraz-oliveira Oct 22, 2023
785f984
Act on self-review: run all CI elements with KERL_DEBUG=yes
paulo-ferraz-oliveira Oct 22, 2023
ff6bd1b
Act on local test results: don't output ".:" when outputting errors
paulo-ferraz-oliveira Oct 22, 2023
a256167
Act on CI results: truthy value should be one of [false, true]
paulo-ferraz-oliveira Oct 22, 2023
e71bef8
Act on CI results: don't have CI fail with a new exit code
paulo-ferraz-oliveira Oct 22, 2023
f09a628
Act on CI results: prevent "indication of CI" from breaking script
paulo-ferraz-oliveira Oct 24, 2023
f5150bc
Act on CI results: validate activation in a correct shell scope
paulo-ferraz-oliveira Oct 24, 2023
841284c
Act on CI results: choose warn instead error, sometimes
paulo-ferraz-oliveira Oct 24, 2023
f7fcb26
Act on review comment: Kerl > `kerl`
paulo-ferraz-oliveira Oct 24, 2023
8b1c6ab
Act on review comment: all _curl calls are GETs for now
paulo-ferraz-oliveira Oct 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
33 changes: 19 additions & 14 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ name: CI
'on': [push, pull_request]
env:
ERLC_USE_SERVER: true
KERL_DEBUG: 'yes'
jobs:
ci:
name: CI OTP ${{matrix.otp_vsn}}, on ${{matrix.os}}
Expand Down Expand Up @@ -60,24 +61,26 @@ jobs:
run: |
echo "OpenSSL is $(openssl version)"
export MAKEFLAGS=-j$(($(nproc) + 2))
if ! KERL_DEBUG=yes ./kerl build ${_KERL_PREFIX_GIT} \
${_KERL_PREFIX_GIT_TARGET} \
"${_KERL_VSN}" \
"${_KERL_VSN}"; then
if ! ./kerl build ${_KERL_PREFIX_GIT} \
${_KERL_PREFIX_GIT_TARGET} \
"${_KERL_VSN}" \
"${_KERL_VSN}"; then
## Print build log if it fails
cat ~/.kerl/builds/*/*.log
exit 1
fi
# yamllint disable rule:line-length
- name: Install chosen version
run: KERL_DEBUG=yes ./kerl install "$_KERL_VSN" "install_$_KERL_VSN"
- name: Check installation status
run: ./kerl status
run: ./kerl install "$_KERL_VSN" "install_$_KERL_VSN"
- name: Check installation status (pre- activation)
run: ./kerl status || exit 0
- name: Validate installation
run: |
source $(./kerl path install_"$_KERL_VSN")/activate
erl -s crypto -s init stop
erl_call
- name: Check installation status (post- activation)
run: ./kerl status
- name: Test KERL_RELEASE_TARGET
# yamllint disable rule:line-length
run: |
Expand Down Expand Up @@ -122,19 +125,21 @@ jobs:
- name: Test build+install chosen version
run: |
export MAKEFLAGS="-j$(getconf _NPROCESSORS_ONLN)"
if ! KERL_DEBUG=yes ./kerl build-install ${_KERL_PREFIX_GIT} \
${_KERL_PREFIX_GIT_TARGET} \
"${_KERL_VSN}" \
"${_KERL_VSN}" \
"$PWD/build-install_${_KERL_VSN}"; then
if ! ./kerl build-install ${_KERL_PREFIX_GIT} \
${_KERL_PREFIX_GIT_TARGET} \
"${_KERL_VSN}" \
"${_KERL_VSN}" \
"$PWD/build-install_${_KERL_VSN}"; then
## Print build log if it fails
cat ~/.kerl/builds/*/*.log
exit 1
fi
- name: Check installation status (build+install)
run: ./kerl status
- name: Check installation status (pre- activation)
run: ./kerl status || exit 0
- name: Validate installation (build+install)
run: |
source $(./kerl path build-install_"${_KERL_VSN}")/activate
erl -s crypto -s init stop
erl_call
- name: Check installation status (post- activation)
run: ./kerl status
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,6 @@ You can also install directly from a raw Git repository by using the

List the available releases:

<!-- markdownlint-disable MD007 # line-length -->
```console
$ kerl list releases
17.5.6.10
Expand All @@ -103,7 +102,6 @@ Run './kerl update releases' to update this list.
Run './kerl list releases all' to view all available releases.
Note: * means "currently supported".
```
<!-- markdownlint-enable MD007 # line-length -->

Pick your choice and build it:

Expand Down Expand Up @@ -257,11 +255,11 @@ $ kerl_deactivate
It is possible to build Erlang/OTP from a GitHub fork, by using the `KERL_BUILD_BACKEND=git` and
setting `OTP_GITHUB_URL` to the URL of the fork. For example, to build `<orgname>'s` Erlang/OTP fork:

<!-- markdownlint-disable MD007 # line-length -->
```console
$ export KERL_BUILD_BACKEND=git
$ export OTP_GITHUB_URL='https://github.com/<orgname>/otp'
$ KERL_INCLUDE_RELEASE_CANDIDATES=yes kerl update releases
Getting releases from GitHub...
The available releases are:
24.0-rc1 *
24.0-rc1.1-orgname *
Expand All @@ -276,7 +274,9 @@ The available releases are:
...
26.0.2 *
```
<!-- markdownlint-enable MD007 # line-length -->

**Note**: this list, kept in a file managed by Kerl, is different depending on the build backend
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

kerl no uppercasing please

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure. It was there already, so I took "advantage" of that. Maybe I'll take this chance to lowercase it all, then (?)

Edit: apparently also by me 😄

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you use.

From here (provided the `KERL_BUILD_BACKEND` and `OTP_GITHUB_URL` variables remain in place), it is
possible to use `kerl` as before:
Expand Down