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 use of Backward on macOS #67

Merged
merged 8 commits into from
Oct 25, 2021
Merged

Conversation

azeey
Copy link
Contributor

@azeey azeey commented Oct 18, 2021

🦟 Bug fix

Summary

SDFormat CI (eg. https://build.osrfoundation.org/job/sdformat-ci-sdformat10-homebrew-amd64/48/) is failing on macOS because ign fails to find libignition-tools-backward. The problem is that $<TARGET_FILE> yields the full path of the library in the build
directory, which will likely not be available in binary distributions of ign-tools. This instead uses the install path of the library.

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge

`$<TARGET_FILE>` yields the full path of the library in the build
directory, which will likely not be available in binary distributions of
ign-tools. This instead uses the install path of the library.

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey azeey requested a review from caguero as a code owner October 18, 2021 19:04
@github-actions github-actions bot added 🌱 garden Ignition Garden 🏢 edifice Ignition Edifice 🏯 fortress Ignition Fortress 🏰 citadel Ignition Citadel 🔮 dome Ignition Dome labels Oct 18, 2021
@scpeters
Copy link
Member

in downstream packages, we typically configure/generate two cmd*.rb scripts, one for testing and one for installation:

I think we should consider doing that here and adding a test that invokes ign

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey
Copy link
Contributor Author

azeey commented Oct 19, 2021

I think we should consider doing that here and adding a test that invokes ign

I've added tests that use cmake to invoke ign, but I don't know how to tell Jenkins about the test results. Do you have any recommendations? The other option is to add gtest and call the tests from an executable built with gtest.

@scpeters
Copy link
Member

I think we should consider doing that here and adding a test that invokes ign

I've added tests that use cmake to invoke ign, but I don't know how to tell Jenkins about the test results. Do you have any recommendations? The other option is to add gtest and call the tests from an executable built with gtest.

here's an example from ign-cmake2 that configures junit files for pass and failure. It configures the failure case to the test_results folder, then copies the junit_pass file if the test succeeds:

it's a little clunky, but it doesn't need gtest

Copy link
Member

@scpeters scpeters left a comment

Choose a reason for hiding this comment

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

thanks for the quick fix here; I have two small comments about the implementation

src/ign.in Outdated
rescue SharedLibInterface::DLError
puts "Library error: #{backward_library_name} not found. Improved backtrace"\
puts 'Library error: @backward_library_name@ not found. Improved backtrace'\
Copy link
Member

Choose a reason for hiding this comment

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

I think we can use STDERR.puts here, which might also help with the test failures that have expectations on the stdout

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 311d588. I used warn instead because codecheck didn't like STDERR.puts.

set(cmd_script_generated_test "${PROJECT_BINARY_DIR}/test/lib/$<CONFIG>/ruby/ignition/cmd${IGN_DESIGNIATION}_TEST.rb")

configure_file(
"cmd${IGN_DESIGNIATION}_TEST.rb.in"
Copy link
Member

Choose a reason for hiding this comment

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

I don't see any @ symbols in this file that need configuring. I think we can just add it as cmdtools_TEST.rb

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done in 311d588.

OUTPUT "${yaml_output_generated_test}"
INPUT "${yaml_output_configured_test}")

add_test(NAME UNIT_ign_TEST COMMAND ruby ${ign_script_generated_test} tools_TEST)
Copy link
Member

Choose a reason for hiding this comment

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

calling ruby like this will work if it's in the PATH. In some cases, we may need to find_program and refer to the cmake variable here, but we can address that once we see CI failures

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sounds good.

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@azeey
Copy link
Contributor Author

azeey commented Oct 22, 2021

The changes in 311d588 output test results that I thought were consumable by Jenkins based on the examples listed in #67 (comment). But Jenkins still says no tests found.

Also, I see a pending ign_tools-pr-win build as well a completed ignition_tools-ci-pr_any-windows7-amd64 in the list of checks. Is that related to gazebo-tooling/release-tools#537 @scpeters?

Copy link
Member

@scpeters scpeters left a comment

Choose a reason for hiding this comment

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

just one small suggestion; looks good

# Used for the installed version.
if(APPLE)
# On macOS, the full path to the library since DYLD_LIBRARY_PATH may not work.
set(backward_library_name ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR}/$<TARGET_FILE_NAME:backward>)
Copy link
Member

Choose a reason for hiding this comment

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

someone recently submitted gazebosim/gazebo-classic#3076 to change ${CMAKE_INSTALL_PREFIX}/${LIB_INSTALL_DIR} to ${CMAKE_INSTALL_FULL_LIBDIR}, so I think we could do the same here

Signed-off-by: Addisu Z. Taddese <addisu@openrobotics.org>
@scpeters
Copy link
Member

The changes in 311d588 output test results that I thought were consumable by Jenkins based on the examples listed in #67 (comment). But Jenkins still says no tests found.

there's a DSL change needed to expect tests from ign-tools

https://github.com/ignition-tooling/release-tools/blob/master/jenkins-scripts/dsl/ignition.dsl#L41

Also, I see a pending ign_tools-pr-win build as well a completed ignition_tools-ci-pr_any-windows7-amd64 in the list of checks. Is that related to ignition-tooling/release-tools#537 @scpeters?

yes it's related to gazebo-tooling/release-tools#537. I'll enable tests for ign-tools in that PR and then request your review

@scpeters
Copy link
Member

@osrf-jenkins run tests please

@scpeters
Copy link
Member

the ign_tools-pr-win build won't work until gazebo-tooling/release-tools#537 is merged since it can only run off the master branch of release-tools

@scpeters
Copy link
Member

@chapulina chapulina added the macOS macOS support label Oct 25, 2021
@azeey
Copy link
Contributor Author

azeey commented Oct 25, 2021

@osrf-jenkins run tests please

@scpeters
Copy link
Member

there's one more change needed in release-tools: gazebo-tooling/release-tools#540

I had already restarted a CI job and saw its failure

@scpeters
Copy link
Member

there's one more change needed in release-tools: ignition-tooling/release-tools#540

I had already restarted a CI job and saw its failure

this has been merged and CI is now working

@scpeters
Copy link
Member

@osrf-jenkins run tests please

@azeey azeey merged commit 500b760 into gazebosim:ign-tools1 Oct 25, 2021
@azeey azeey deleted the fix_backward_macos branch October 25, 2021 19:02
@Blast545
Copy link

FYI @azeey, the error is still appearing in the buildfarm: build.osrfoundation.org/sdformat-ci-sdformat9-homebrew-amd64#81/. Not sure if I'm missing something.

@azeey
Copy link
Contributor Author

azeey commented Oct 26, 2021

We need to make a patch release for macOS to fix it there. The plan is to make a release for all platforms today pending gazebo-release/gz-tools-release#2. If that doesn't get merged today, we'll do a patch release just for macOS. \cc @j-rivero

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏰 citadel Ignition Citadel 🔮 dome Ignition Dome 🏢 edifice Ignition Edifice 🏯 fortress Ignition Fortress 🌱 garden Ignition Garden macOS macOS support
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants