Summary
chicken-install will generate scripts that may fail randomly when using types or inline files
Metadata
- Id: 769fa38574015a010485bbd215c4447070dcabc8
- Trac id: 1550
- Type: defect
- Reporter: sjamaan
- Owner:
- Cc:
- Status: closed
- Component: extensions
- Estimated difficulty: medium
- Resolution: fixed
- Priority: major
- Milestone: 5.0
- Version: 5.0.0rc3
- Changetime: 2018-10-29 15:45:01 UTC
- Created: 2018-10-12 17:48:31 UTC
- Keywords: chicken-install, types file, inline file
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".
Changes and comments
[2018-10-13 12:24:49 UTC] felix wrote:
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.
[2018-10-13 12:24:49 UTC] felix wrote:
1539426335825757
[2018-10-16 02:18:26 UTC] evhan wrote:
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.
[2018-10-17 14:21:11 UTC] sjamaan changed milestone from someday to 5.0
[2018-10-19 11:13:25 UTC] felix wrote:
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.
[2018-10-22 17:51:10 UTC] felix wrote:
A patch for this has been posted on chicken-hackers.
[2018-10-29 15:45:01 UTC] sjamaan changed status from new to closed
[2018-10-29 15:45:01 UTC] sjamaan set resolution to fixed
[2018-10-29 15:45:01 UTC] sjamaan wrote:
Fixed with 21ccd9b442f72700bb737fe095b4cf17c6eef4df