Menu

#64 cmake does not allow "=" in SRCDIR which 0compiles uses

open
nobody
0build (4)
5
2014-06-14
2012-02-24
No

I just tried to create a 0compile xml for a program that makes use of cmake.

I try to run the following commands to compile the source:

cd "$SRCDIR" && cmake . && make && make install

Problem is, that SRCDIR contains a "=" in it path:

SRCDIR=/home/foo/.cache/0install.net/implementations/sha1new=0bb6a5eee09ba46816300e3539791fe2efa75c88

which is unsupported by cmake:

The path to the source directory:

/home/foo/.cache/0install.net/implementations/sha1new=0bb6a5eee09ba46816300e3539791fe2efa75c88

contains unsupported character '='.

Please use a different source directory name.

Is there a workaround available?

Discussion

  • Thomas Leonard

    Thomas Leonard - 2012-02-25

    I think this was fixed recently:

    http://www.cmake.org/Bug/view.php?id=12934

     
  • Discodestroyer

    Discodestroyer - 2012-02-25

    Seems you are right.

    Question is at what time the patch will hit a release.

    Also, the author says that cmake only warns about it, and that the limitation comes from make.

    Does 0install really depend on this "=" sign?

    Many Linux distros will ship a too old cmake version for the next several months/years which prevents all the users to compile programs which depend on cmake.

    And even if cmake gets updated, it's not unlikely that make will continue to trouble.

     
  • Anders F Björklund

    I do believe it was fixed recently, and that it will be available in a future release of cmake. Yes, we should move the feed but I don't think it helps in this case unless we apply the patch and rebuild all binaries ?

    I'm thinking that we might need an option in 0compile, to symlink-or-copy the $SRCDIR to a temporary location and use that instead of the store directly. The overhead, at least on Linux/Unix, should be tiny. And it would be better than having to use "dup-src", which always copies and requires making an in-source build.

     
  • Discodestroyer

    Discodestroyer - 2012-02-25

    @cmake from 0install: good point :)

    I like the idea with the symlinks as a workaround if not only cmake but make as well should trouble.

     
  • Discodestroyer

    Discodestroyer - 2012-02-26

    I solved the problem with a symlink as well.

    So if you want to, close this report.

     
  • Thomas Leonard

    Thomas Leonard - 2012-02-26

    OK. Sounds like we have a work-around that can be used until the next cmake release. Thanks,

     
  • Anders F Björklund

    Symlinks are not portable, so goes against using CMake in the first place. The current workaround is to use "dup-src" and "cmake .", to copy everything and make an in-source build. But that's a bit wasteful, and not recommended either. So an alternative would be to introduce a new attribute, "tmp-src" (or something), that would symlink on Unix and copy on Windows. And then the $SRCDIR would also be in tmp (without the '=').

     
  • Thomas Leonard

    Thomas Leonard - 2012-02-26

    Would that be more or less work than making a binary release of the current cmake dev version?

     
  • Anders F Björklund

    Probably more, but might be useful for the cases where '=' actually is a problem (with make) even when it is OK with the cmake Makefile generator. Of course, it does require a new version of 0compile to work.

     
  • Discodestroyer

    Discodestroyer - 2012-02-26

    I suppose that you need the "=" in the path as a delimiter, is that correct?

    If so, how much work would it be to use three underscores instead?

     

Log in to post a comment.