GithubHelp home page GithubHelp logo

Comments (5)

jeremiah-corrado avatar jeremiah-corrado commented on June 16, 2024 2

Looking at this some more, I think we should make Option 2 illegal, to avoid potential module-resolution ambiguities. This requirement can always be relaxed in the future if we decide it's too strict.

from chapel.

jeremiah-corrado avatar jeremiah-corrado commented on June 16, 2024 2

I think this issue can be closed due to #25084 and #25098

from chapel.

jeremiah-corrado avatar jeremiah-corrado commented on June 16, 2024 1

I created a draft PR to fix this; however, it does allow Option 2 above, and I'm wondering whether that should be legal.

I suspect that the second case could be a problem if MyPkg.chpl has a public use for the modules something and/or somethingElse because there could be module-resolution conflicts if someone tries to use MyPkg in their project that already has a module with the same name. I'll investigate whether this is an issue before going further with my PR.

Or if anyone happens to already know that Option 2 should be illegal that would be helpful.

from chapel.

benharsh avatar benharsh commented on June 16, 2024

I think you're absolutely right about the listDir being wrong. We'll take a look.

from chapel.

lucaferranti avatar lucaferranti commented on June 16, 2024

Thanks @benharsh for the reply! I think the fix itself (updating moduleCheck) will be relatively straightforward. I would like to understand the motivation for that check in the first place.

Suppose I have a library MyPkg. Here are three options for src/

Option 1

src/
   MyPkg.chpl

This will be fine, src has only one file, hence only one module, hence only one main module. However, this solution makes sense only for small and simple libraries.

Option 2

src/
   MyPkg.chpl
   something.chpl
   somethignElse.chpl

Do something.chpl and somethingElse.chpl count as submodules of MyPkg.chpl or are they peer main modules? If I read

or packages that span multiple files, the main module is designated by the module that shares the name with the package directory and the name field in the Mason.toml file.

I would understand from it that this structure should still be fine, since MyPkg.chpl is the only main module. However maybe this is a mason specific convention and can causes issues, so this could be forbidden I guess.

Option 3

src/
   MyPkg.chpl
   MyPkg/
       something.chpl
       somethingElse.chpl

This structure will currently fail (because of my diagnosis above) but based on my reading of the docs I think it should be accepted. Is there any problem with this? I tried a small toy example and mason build and mason test with no additional flags seemed to work for this.

from chapel.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.