namin / clpsmt-miniKanren

CLP(SMT) on top of miniKanren
MIT License
35 stars 8 forks source link

Unfortunate incompatibility between GNU and BSD sed #1

Closed david-christiansen closed 3 years ago

david-christiansen commented 4 years ago

The invocations of sed in the codebase have a space between -i and ''. This space seems to be mandatory on the BSD sed used in Mac OS, but prohibited in GNU sed. Editing the files to remove the spaces made the code work for me on Fedora 32.

david-christiansen commented 4 years ago

Would you be interested in a pull request that made this work on Racket? I don't know how to do it in Chez, but on Racket, system-type can be used to figure out which version to run.

david-christiansen commented 4 years ago

It seems that replacing sed -i with perl -i -pe works here, as well!

namin commented 4 years ago

I am happy to take a pull request to change sed to perl. Thanks :)

chansey97 commented 3 years ago

system-type can only work in Racket, but clpsmt-miniKanren seemly like compatibility between Scheme and Racket.

There are currently two ways to fix this issue in my mind:

  1. Use perl -i -pe as @david-christiansen said. The disadvantage is forcing users to install perl.

  2. Use sed -i.bak, it can work in both GNU and BSD. The disadvantage is generating a backup file.

The 3rd way is to encode/decode manually like rosette (but that's another story).

I think it's time to commit this patch, choose a solution plz.

I can help to create a pull-request, if you haven't time :)

namin commented 3 years ago

Yes, please create a pull request. I like the perl solution since most systems have perl installed.