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

Improve build errors reporting #3579

Merged
merged 5 commits into from
Mar 21, 2022
Merged

Improve build errors reporting #3579

merged 5 commits into from
Mar 21, 2022

Conversation

oleg-liatte
Copy link
Member

Issue

Improve build errors reporting

Tasklist

  • Add tests
  • Add #fixes with the issue number that this PR addresses
  • Update the docs with any new request parameters or changes to behavior described
  • Update the changelog
  • If you made changes to the lua files, update the taginfo too.

echo "$1" 1>&2
#exit 1
echo "error: $1" 1>&2
exit 1
Copy link
Member Author

Choose a reason for hiding this comment

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

This comment seems to be committed accidentally.

Copy link
Member

Choose a reason for hiding this comment

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

Sadly it was on purpose.

Copy link
Member

Choose a reason for hiding this comment

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

maybe we can detect the geos version and only exit 1 if it was a newer one?

for example pkg-config geos --modversion returns 3.9.1 on my system and it fails because of double free but the output sqlite is perfectly fine

Copy link
Member

Choose a reason for hiding this comment

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

interestingly on github 3.9 doesnt even exist as a tag... so perhaps thats a sign ;)

Copy link
Member

Choose a reason for hiding this comment

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

in a month we'll have a new ubuntu version so maybe this will be rectified then..

@@ -1,18 +1,16 @@
#!/bin/sh

error_exit() {
echo "$1" 1>&2
#exit 1
echo "error: $1" 1>&2
Copy link
Member Author

Choose a reason for hiding this comment

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

Add "error" to emphasize that this is a critical error (and to highlight it where applicable)

Copy link
Member

Choose a reason for hiding this comment

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

The reason this is commented is because of recent versions of libgeos double freeing some memory. In others words, on some platforms this breaks the build. The double free happens at the end of the operation so it's harmless but erroring caused everything else to fail

@@ -114,7 +114,8 @@ set_target_properties(logging PROPERTIES COMPILE_DEFINITIONS LOGGING_LEVEL_ALL)

add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/test/data/tz.sqlite
COMMAND ${CMAKE_COMMAND} -E make_directory test/data/
COMMAND ${VALHALLA_SOURCE_DIR}/scripts/valhalla_build_timezones 2>/dev/null > ${CMAKE_BINARY_DIR}/test/data/tz.sqlite
COMMAND ${VALHALLA_SOURCE_DIR}/scripts/valhalla_build_timezones > ${CMAKE_BINARY_DIR}/test/data/tz.sqlite.tmp
Copy link
Member Author

Choose a reason for hiding this comment

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

Don't hide stderr

@@ -114,7 +114,8 @@ set_target_properties(logging PROPERTIES COMPILE_DEFINITIONS LOGGING_LEVEL_ALL)

add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/test/data/tz.sqlite
COMMAND ${CMAKE_COMMAND} -E make_directory test/data/
COMMAND ${VALHALLA_SOURCE_DIR}/scripts/valhalla_build_timezones 2>/dev/null > ${CMAKE_BINARY_DIR}/test/data/tz.sqlite
COMMAND ${VALHALLA_SOURCE_DIR}/scripts/valhalla_build_timezones > ${CMAKE_BINARY_DIR}/test/data/tz.sqlite.tmp
COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_BINARY_DIR}/test/data/tz.sqlite.tmp ${CMAKE_BINARY_DIR}/test/data/tz.sqlite
Copy link
Member Author

@oleg-liatte oleg-liatte Mar 18, 2022

Choose a reason for hiding this comment

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

Create output file only in case of success. Otherwise subsequent builds will consider tz.sqlite fresh and won't attempt to recreate it

@nilsnolde nilsnolde self-requested a review March 18, 2022 07:41
nilsnolde
nilsnolde previously approved these changes Mar 18, 2022
Copy link
Member

@nilsnolde nilsnolde left a comment

Choose a reason for hiding this comment

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

makes sense to me, thanks:)

Co-authored-by: Kevin Kreiser <kevinkreiser@gmail.com>
kevinkreiser
kevinkreiser previously approved these changes Mar 18, 2022
@oleg-liatte oleg-liatte merged commit 420becd into master Mar 21, 2022
@oleg-liatte oleg-liatte deleted the ol-better-build-errors branch March 21, 2022 16:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants