ingydotnet / inline-c-pm

10 stars 19 forks source link

clean_after_build breaks with multiple config calls #87

Closed jimav closed 5 years ago

jimav commented 5 years ago

Hi, The pod for Inline says that multiple config-only calls (use Inline config => ...) accumulate and apply to the next call which supplies source code.

But that doesn't seem to work, at least the _clean_afterbuild option seems to be forced to TRUE for each call, preventing the desired effect. So the following:

use Inline C => config => clean_after_build => 0;
use Inline C => config => <anything else>
use Inline C => <<'END_C';
  <C code>
END_C

cleans the build directory anyway. I'm using Inline version 0.81 and Inline::C version 0.78

Attached is a demo script. demo2.pl.txt

sisyphus commented 5 years ago

Hi Jim, This is the same as Issue #82. (How do we join #82 and #87 together ?)

I originally thought that Inline::C used to honour this "accumulation", but the other day I checked and found that it hasn't done so for a long time - perhaps it never did. (Inline-0.50 is the oldest version that I tried.)

Note that "use Inline Config => ..." seems to be cumulative (as documented), it's just "use Inline C => Config => ...." that's not playing the game. There's also a syntactic difference between those 2 calls. The latter requires a fat comma before "Config", the former requires that no fat comma appear before "Config".

Anyway - a quick workaround seems to be to "use Inline Config => ..." in one's Inline::C scripts, and totally avoid "use Inline C => Config => ...".

I'm not sure where this leaves us. My feeling is that this aspect of Inline::C's behaviour should be brought into line with that of Inline (especially if it turns out to be fairly easy to implement). But then, if Inline::C has never adhered to such behaviour, perhaps there's a case for a different point of view.

Cheers, Rob

On Tue, Apr 2, 2019 at 6:56 AM Jim Avera notifications@github.com wrote:

Hi, The pod for Inline says that multiple config-only calls (use Inline config => ...) accumulate and apply to the next call which supplies source code.

But that doesn't seem to work, at least the clean_after_build option seems to be forced to false for each call, preventing the desired effect. So the following:

use Inline C => config => clean_after_build => 0; use Inline C => config => use Inline C => <<'END_C';

END_C cleans the build directory anyway. I'm using Inline version 0.81 and Inline::C version 0.78 . demo.pl.txt Attached is a demo script. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or mute the thread .
jimav commented 5 years ago

If not fix(able), then best to document it.

On 4/1/19 4:18 PM, sisyphus wrote:

Hi Jim, This is the same as Issue #82. (How do we join #82 and #87 together ?)

I originally thought that Inline::C used to honour this "accumulation", but the other day I checked and found that it hasn't done so for a long time - perhaps it never did. (Inline-0.50 is the oldest version that I tried.)

Note that "use Inline Config => ..." seems to be cumulative (as documented), it's just "use Inline C => Config => ...." that's not playing the game. There's also a syntactic difference between those 2 calls. The latter requires a fat comma before "Config", the former requires that no fat comma appear before "Config".

Anyway - a quick workaround seems to be to "use Inline Config => ..." in one's Inline::C scripts, and totally avoid "use Inline C => Config => ...".

I'm not sure where this leaves us. My feeling is that this aspect of Inline::C's behaviour should be brought into line with that of Inline (especially if it turns out to be fairly easy to implement). But then, if Inline::C has never adhered to such behaviour, perhaps there's a case for a different point of view.

Cheers, Rob

On Tue, Apr 2, 2019 at 6:56 AM Jim Avera notifications@github.com wrote:

Hi, The pod for Inline says that multiple config-only calls (use Inline config => ...) accumulate and apply to the next call which supplies source code.

But that doesn't seem to work, at least the clean_after_build option seems to be forced to false for each call, preventing the desired effect. So the following:

use Inline C => config => clean_after_build => 0; use Inline C => config => use Inline C => <<'END_C';

END_C cleans the build directory anyway. I'm using Inline version 0.81 and Inline::C version 0.78 . demo.pl.txt Attached is a demo script. — You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub , or mute the thread .

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/ingydotnet/inline-c-pm/issues/87#issuecomment-478781251, or mute the thread https://github.com/notifications/unsubscribe-auth/ABNCwHKWNQFnOsPZdsrZSE36zFqpQ8Caks5vcpO-gaJpZM4cWhIG.

mohawk2 commented 5 years ago

Entirely fixable, and will be fixed when https://github.com/ingydotnet/inline-pm/pull/71 is merged and released. @perlpunk A quick win here?

perlpunk commented 5 years ago

fixed by https://github.com/ingydotnet/inline-pm/pull/71