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

bson out of modules list #51

Closed
MARTIMM opened this issue Aug 5, 2015 · 11 comments
Closed

bson out of modules list #51

MARTIMM opened this issue Aug 5, 2015 · 11 comments

Comments

@MARTIMM
Copy link
Contributor

MARTIMM commented Aug 5, 2015

The Module BSON is not shown in the modules list anymore at http://modules.perl6.org/ and I get the following error when installing MongoDB which depends on it

> panda install MongoDB
resolve stage failed for MongoDB: Dependency BSON is not present in the module ecosystem
...

I am now at the newest panda and perl6/moar version

@jonathanstowe
Copy link
Contributor

Just sent you a pull request that should fix this.

@ugexe
Copy link
Contributor

ugexe commented Aug 5, 2015

BSON has other problems as well. While panda may be installing this correctly for you, it cannot actually determine the proper build order and the fact it may be built in the proper order is a coincidence.

package BSON { class Bson {

And then in your META you point at BSON::Bson. But both panda and Zef determine the build order by running a regex on the source.

@MARTIMM
Copy link
Contributor Author

MARTIMM commented Aug 5, 2015

I've seen this before but I think I do not understand the implications of this.
I am using classes in packages constructs as I feel that it is just that 'a packagage with a set of modules and classes for some project'.

so therefore I use
package BSON { class Bson {

How do I have to change this or the meta.info? And, more importantly, Can one not use above structures?
It also can become harder for panda when one uses
package X { module Y { class Z {

A regex on the source should always reveal the depending code from use/need/... and build a tree of dependencies from that...

@MARTIMM MARTIMM closed this as completed Aug 5, 2015
@ugexe
Copy link
Contributor

ugexe commented Aug 5, 2015

Theoretically its a sound practice.

The problem is that package managers need to determine the order to build the modules listed in provides, and this gets done by grepping the source for use ModuleName (thats over simplified) and counting the occurances each use ModuleName. Then it can compare against the count of use OtherModule. Now, the package manager can know that lib/BSON.pm contains BSON::Bson (the provides tells us), But lets say you have:
package X { class Y {}; class Z {}; };
First, both X::Y and X::Z would need to be mapped in the provides section. If we are to assume this is the case, then the next problem is panda will count use X::Y; use X::Z in the same script as 2 counts (and as such the build order may be changed)

@MARTIMM
Copy link
Contributor Author

MARTIMM commented Aug 6, 2015

Thanks for the explanation, still have the following problem while installing from local directory...

> cd BSON
> panda install .
==> Installing BSON from a local directory '.'
==> Fetching BSON
==> Building BSON
Compiling lib/BSON/Exception.pm6 to mbc
Compiling lib/BSON/ObjectId.pm to mbc
Compiling lib/BSON/Regex.pm to mbc
Compiling lib/BSON/Javascript.pm to mbc
Compiling lib/BSON/Binary.pm to mbc
===SORRY!===
When pre-compiling a module, its dependencies must be pre-compiled first.
Please pre-compile /home/marcel/Languages/Perl6/Projects/BSON/.panda-work/1438847789_1/lib/BSON/EDC-Tools.pm6
==> Test report submitted as: http://testers.perl6.org/reports/</html>.html
build stage failed for BSON: Failed building lib/BSON/Binary.pm
  in method throw at /home/marcel/Software/lib/perl6/share/perl6/runtime/CORE.setting.moarvm:1
  in method install at lib/Panda.pm:128
  in method resolve at lib/Panda.pm:218
  in sub MAIN at /home/marcel/Software/lib/perl6/bin/panda:20
  in block <unit> at /home/marcel/Software/lib/perl6/bin/panda:87


Failure Summary
----------------
.
        *build stage failed for BSON: Failed building lib/BSON/Binary.pm

This is about what you've explained. Now how do I proceed to get this go away, Change the code into
something more 'panda comprehensable' or change the META.info

@jonathanstowe
Copy link
Contributor

Hi,
I think it's actually a bug in the way that the Panda::Builder parses the "use" and "require" lines to get the module build order, specifically it won't find any that have a '-' in their name as is the case with BSON::EDC-Tools - I've successfully built this with such a change. I'll send you a PR that implements that but fixing "panda" might be a better idea.

@MARTIMM
Copy link
Contributor Author

MARTIMM commented Aug 6, 2015

Found it, Looks like it must be the case. I will make an issue at panda
thanks

@jonathanstowe
Copy link
Contributor

Hi, I just sent a PR to panda to fix this tadzik/panda#197

@MARTIMM
Copy link
Contributor Author

MARTIMM commented Aug 6, 2015

I've seen it, thanks. I've modified the code to load EDCTools as you suggested and it works fine. I will mention this at panda.

@jonathanstowe
Copy link
Contributor

@tadzik has merged that change into panda so it should all be cool now anyway :)

@MARTIMM
Copy link
Contributor Author

MARTIMM commented Aug 6, 2015

ok, so I can dash around now!

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

3 participants