Comments (5)
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.
I think this issue can be closed due to #25084 and #25098
from chapel.
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.
I think you're absolutely right about the listDir
being wrong. We'll take a look.
from chapel.
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)
- Compiler LLVM fatal errors aren't very helpful without CHPL_DEVELOPER right now HOT 1
- [Feature Request]: support autocompletion for fish HOT 1
- Dyno: named declarations should report their indentation separately from their name locations
- Remove/Retire 'numa' locale model HOT 2
- [Feature Request]: Lint rule for extra parentheses HOT 3
- [Feature Request]: Lint rule for line length HOT 1
- Compiling a `--library` with GPU support (or C++) should use C linkage in the generated header HOT 2
- Moving tasks to sublocales doesn't work in the library mode HOT 1
- [Bug]: `chpl-shim` produces empty json if run twice on mason
- Include `CHPL_COMM_OFI_OOB` in printchplenv and unique'd library paths HOT 1
- Turn "localize array's remote domain" optimization on by default
- [Bug]: template errors in hipcub related to Chapel libc wrapper [HEAD] HOT 4
- register chpl-language-server and chplcheck on mason (neovim) HOT 6
- [Bug]: linter incorrectly complains about the indentation of a second `else if` in an if/else chain
- static variables should be able to use the `var` keyword instead of being forced to use `ref.
- [Bug]: incorrect error: illegal use of function that does not return a value, involving parenless proc HOT 2
- Split Chapel Documentation into distinct sections/sites? HOT 2
- [Feature Request]: Way to see how far you are into numtrials for a particular test with `start_test`
- [Feature Request]: Remote variables: allow non-locale arguments to `on`.
- [Feature Request]: let CLS return a list of definitions for overloaded functions HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from chapel.