Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected token in primary type expression #1

Open
eserte opened this issue Feb 12, 2020 · 9 comments
Open

Unexpected token in primary type expression #1

eserte opened this issue Feb 12, 2020 · 9 comments

Comments

@eserte
Copy link

eserte commented Feb 12, 2020

On some of my smokers the test suite fails:

Unexpected token in primary type expression; got '=,D,H,I,M,N,P,S,X]]' at /opt/perl-5.26.2D/lib/site_perl/5.26.2/Type/Parser.pm line 280.
Compilation failed in require at t/basic.t line 4.
BEGIN failed--compilation aborted at t/basic.t line 4.
t/basic.t ............... 
Dubious, test returned 255 (wstat 65280, 0xff00)
No subtests run 
@eserte
Copy link
Author

eserte commented Feb 12, 2020

I did some experiments --- and it seems that the problem happens if a new version of Type::Parser is installed together with Type::Tiny::XS.

@ichobits
Copy link

I have the same error!

@ichobits
Copy link

ubuntu 20.04
perl 5.30

@ichobits
Copy link

conda create --name perl_env
conda activate perl_env
conda install -c bioconda biotradis=1.4.1
conda install -c bioconda perl-bio-cigar=1.01

after, cigar can be run in the perl_env

@xileF1337
Copy link

The problem is line 120 of lib/Bio/Cigar.pm:

    isa     => ArrayRef[ Tuple[ Int, Enum[split '', 'MIDNSHP=X'] ] ],

Here, the type of attribute ops is defined, and it seems as the Enum[ ] type does not support the = character as an enumeration member. Removing it makes the test compile and pass. Of course, this is no solution because a cigar string may contain the = character. So it is probably a bug in the Types::Standard module, which is contained in distribution Type::Tiny.

Solution: I had this problem with version 1.008001 of Type::Tiny, and updating (run cpanm Type::Tiny) to the current version 1.012005 fixed the issue for me.

@tsibley
Copy link
Contributor

tsibley commented Jun 16, 2022

@xileF1337 Thanks for that info. It seems to be firmly an upstream issue in the Type-Tiny ecosystem, so I'm going to close this. But happy to re-open if there's a specific workaround Bio-Cigar could make to avoid this, such as 1) declaring a dep conflict with the known-bad versions of specific upstream versions or 2) adjusting the specific syntax used to declare the Enum with =.

@tsibley
Copy link
Contributor

tsibley commented Jun 16, 2022

Ha, nevermind, turns out I don't actually still have maintainer on this repo so can't close the issue. (But I do have maint on CPAN, so can still make new releases with workarounds/fixes.)

@xileF1337
Copy link

@tsibley glad to help ;) Have you considered specifying the current version of Type::Tiny as a dependency of this module? This would trigger an update of the broken version first if people try to install Bio::Cigar.

@tsibley
Copy link
Contributor

tsibley commented Jun 16, 2022

That would work, yes, but I'd prefer not to break out the big hammer of forcing a blanket upgrade. Those can cause conflicts with other software that have version maximums on the same module that exclude the latest version, for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants