#1550 closed defect (fixed)

chicken-install will generate scripts that may fail randomly when using types or inline files

Reported by: sjamaan Owned by:
Priority: major Milestone: 5.0
Component: extensions Version: 5.0.0rc3
Keywords: chicken-install, types file, inline file Cc:
Estimated difficulty: medium

Description

I noticed this while porting sql-de-lite, which has a pretty hairy setup script. But that's irrelevant, the issue is caused by the (types-file) in sql-de-lite-cache.

You can see it here: https://bitbucket.org/sjamaan/sql-de-lite/src

Running "chicken-install" will sometimes work. If you then run "hg clean" and "chicken-install" again, it may fail, depending on whether chicken-do decides to compile the static extension first.

This is due to the comment that starts on line 394: "if compiling both static + dynamic, override types-file: + inline-file: properties to avoid generating things twice".

Change History (6)

comment:1 Changed 10 months ago by felix winkelmann

I'm currently trying to reproduce this problem. Note that the custom build scripts don't work (at least) on my OpenBSD installation (sh is ksh there), set -e seems to abort failing commands in conditionals and so use-internal-sqlite3 always fails.

Another remark: chicken-do never orders dependencies or build steps, it only decides whether a build step is to be done or not. The logic in chicken-install should make sure that if the static variant of an extension is built, then .types and .inline files must already exist, as the dynamic variant must have been built before that. The only case where your scenario comes up could be if the types/inline files are removed, but the dynamic extension is not, which would confuse the egg build and would be an intentional breaking of the dependency chain.

What we could do would be to add a dependency of the static extension on the dynamic one, but this feels like working around external attempts to subvert the egg build.

Last edited 10 months ago by felix winkelmann (previous) (diff)

comment:2 in reply to:  1 ; Changed 10 months ago by evhan

Replying to felix:

What we could do would be to add a dependency of the static extension on the dynamic one, but this feels like working around external attempts to subvert the egg build.

Would that still work when (linkage static) is used? In that case the dynamic extension won't be built, but maybe that is taken care of already somehow.

comment:3 Changed 10 months ago by sjamaan

Milestone: someday5.0

comment:4 in reply to:  2 Changed 10 months ago by felix winkelmann

Replying to evhan:

Would that still work when (linkage static) is used? In that case the dynamic extension won't be built, but maybe that is taken care of already somehow.

Yes, it checks for having a dynamic build before deciding on the options.

comment:5 Changed 10 months ago by felix winkelmann

A patch for this has been posted on chicken-hackers.

comment:6 Changed 10 months ago by sjamaan

Resolution: fixed
Status: newclosed

Fixed with 21ccd9b442f72700bb737fe095b4cf17c6eef4df

Note: See TracTickets for help on using tickets.