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

Build error: "export could not write export file" #142

Closed
mikepurvis opened this issue Oct 12, 2016 · 6 comments
Closed

Build error: "export could not write export file" #142

mikepurvis opened this issue Oct 12, 2016 · 6 comments

Comments

@mikepurvis
Copy link

See:

16:30:56 Errors << octomap:cmake /tmp/buildd/workspace/debian/tmp/build/logs-autonomy/octomap/build.cmake.000.log
16:30:56 
16:30:56 
16:30:56 CMake Error: cannot write to file "/tmp/buildd/workspace/octomap-6d7c31ae4df2c93cb8a954e44d442338b58d3558/octomap/lib/cmake/octomap/octomap-targets.cmake": No such file or directory
16:30:56 CMake Error at /tmp/buildd/workspace/octomap-6d7c31ae4df2c93cb8a954e44d442338b58d3558/octomap/src/math/CMakeLists.txt:20 (export):
16:30:56   export could not write export file.
16:30:56 
16:30:56 
16:30:56 CMake Error: cannot write to file "/tmp/buildd/workspace/octomap-6d7c31ae4df2c93cb8a954e44d442338b58d3558/octomap/lib/cmake/octomap/octomap-targets.cmake": No such file or directory
16:30:56 CMake Error at /tmp/buildd/workspace/octomap-6d7c31ae4df2c93cb8a954e44d442338b58d3558/octomap/src/CMakeLists.txt:24 (export):
16:30:56   export could not write export file.
16:30:56 

Reverting to before #140 merged resolves the issue.

@ahornung
Copy link
Member

Strange, maybe @jamiesnape has an idea?

@jamiesnape
Copy link
Contributor

Does the directory
/tmp/buildd/workspace/octomap-6d7c31ae4df2c93cb8a954e44d442338b58d3558/octomap/lib/cmake/octomap/ exist and is it writeable by the user performing the build?

@mikepurvis
Copy link
Author

mikepurvis commented Oct 12, 2016

Looks like this is at least partly down to a bug in old CMake. On Ubuntu Trusty (CMake 2.8.12.2):

mkdir src
git clone https://github.com/OctoMap/octomap src/octomap --depth 1
catkin config --install --isolate-devel
catkin build octomap

Error is:

CMake Error: cannot write to file "<ws>/src/octomap/octomap/lib/cmake/octomap/octomap-targets.cmake": No such file or directory
CMake Error at <ws>/src/octomap/octomap/src/math/CMakeLists.txt:20 (export):
  export could not write export file.

However, doing the exact same under Homebrew (CMake 3.6.2) succeeds just fine, and the following three files are created:

./build/octomap/src/CMakeFiles/Export/share/octomap/octomap-targets.cmake
./install/share/octomap/octomap-targets.cmake
./src/octomap/octomap/lib/cmake/octomap/octomap-targets.cmake

So first of all, I don't think it's correct behaviour to be generating these into the source folder— they should go in the build tree. But the larger issue is that export() on new-CMake creates the folder, which old-CMake doesn't do.

Would we entertain a PR that pre-creates the missing path if it doesn't exist?

@jamiesnape
Copy link
Contributor

jamiesnape commented Oct 12, 2016

So first of all, I don't think it's correct behaviour to be generating these into the source folder— they should go in the build tree.

Definitely, see #133. I needed to be consistent with the existing layout when adding the exports.

@ahornung
Copy link
Member

Yes, #133 needs to be handled, but for a future minor release (not patch level).

It's strange though that the other generated files (package and version config) are written fine. At this point, I think there should be either a workaround, or revert of #140 and postponing it until #133 is resolved.

@jamiesnape
Copy link
Contributor

I will PR a workaround shortly.

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

No branches or pull requests

3 participants