5

I use CompUnit::PrecompilationStore::File in a module, which passes all my tests under Rakudo v2022.02 (on my local machine I have not yet upgraded Raku).

Under Rakudo v2022.06, zef test . in the module directory causes a deprecation error (see details below) (reported to me in an issue on the module's github repo).

Simply replacing File with FileSystem in the relevant line locally now causes errors under Rakudo v2022.02.

What is the best way of handling this situation in the Module?

Details of error

Pod::From::Cache] Saw 1 occurrence of deprecated code.
[Pod::From::Cache] ================================================================================
[Pod::From::Cache] Use of the 'CompUnit::PrecompilationStore::File' class seen at:
[Pod::From::Cache]   /Users/coke/sandbox/raku-pod-from-cache/lib/Pod/From/Cache.rakumod (Pod::From::Cache), line 46
[Pod::From::Cache] Please use the 'CompUnit::PrecompilationStore::FileSystem' class instead.
[Pod::From::Cache] --------------------------------------------------------------------------------
[Pod::From::Cache] Please contact the author to have these occurrences of deprecated code
[Pod::From::Cache] adapted, so that this message will disappear!
Richard Hainsworth
  • 1,585
  • 7
  • 9

1 Answers1

3

Run your code with the RAKUDO_NO_DEPRECATIONS environment variable set.

%*ENV<RAKUDO_NO_DEPRECATIONS> = 1;
CompUnit::PrecompilationStore::File.new(:prefix(".".IO));
Elizabeth Mattijsen
  • 25,654
  • 3
  • 75
  • 105
  • how to have code specific for a compiler version, eg, rakudo >= v2022.06 ? – Richard Hainsworth Jul 15 '22 at 12:15
  • `Compiler.new.version >= v2022.06` – Elizabeth Mattijsen Jul 15 '22 at 14:19
  • 1
    As I understand it, this doesn't fix the issue, but masks it, so that when a rakudo is released that removes the deprecated item, the code will start breaking. I think you need to resolve the issue by updating the code otherwise this is just pushing the problem down the road. – Coke Jul 18 '22 at 14:24