-
Notifications
You must be signed in to change notification settings - Fork 116
Auto discovery of executables #190
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
Conversation
Adds scoping to restrict allowed module use by programs.
to allow testing.
|
This looks like a useful addition, therefore apologies for the next question: How do you turn it off? Cargo can disable those by: https://doc.rust-lang.org/cargo/reference/cargo-targets.html#target-auto-discovery |
Fair question. I haven't implemented a way to disable it yet but agree that it is needed. |
In Cargo it is top-level (meaning [build] # or config, ...
auto-tests = false
auto-executables = falseNaming would be important, since this is going to be the section holding all the build configuration rules later, I guess.
The syntax will need a bit of discussion first, might be worth deferring than. Edit: Let's discuss this in a separate issue: #191 |
|
]So if you have multiple test programs that all shared a module either in the test directory or specified by [test.dependencies] |
|
@urbanjost, yes your understanding is correct: in this PR you no longer need separate subdirectories in |
|
This looks awesome. Why don't you implement the following: And add a test for it. Then this PR will be ready to merge. In the meantime, we will come up with some way to move forward in #191, and if we end up with different names, it's easy to rename in this PR. |
Returns canonical path form with redundant artifacts.
Add test on path of program source with source-dir of [[executable]] entry. For case of two executables with same name in different directories, both with overrides in fpm.toml
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good so far.
For the build_config I would suggest to have the toml-f build interface handle the construction of the data structure. The idea of tomlf_build is to allow querying an existing data structure, while adding omitted entries. Therefore, after the parsing is complete the data structure could be serialized to contain all the internal defaults for inspection or rerunning.
I implemented separate default initializers for library and executables since they depend on the “environment,” like present directories, which would have been annoying to handle in the test suite. For the build_config this doesn't seem to required. See comments below.
Contains an app and a test that should be ignored by auto-discovery - this is checked in the CI scripts.
No need for separate default initializer for build table. Co-authored-by: Sebastian Ehlert <[email protected]>
|
Thanks for the explanation @awvwgk, that makes sense. Changes applied. |
|
Nice work on the batch commit for suggested changes. Sorry for pointing out now that the |
certik
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am fine to merge as is.
I think we can merge this, and we we come up with different names in fpm.toml in #191, we can send another PR to change that.
milancurcic
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great!
Co-authored-by: Milan Curcic <[email protected]>
|
was going to ask about a use for an intrinsic module, but guess it is just easier to try it now. |
Set of changes to address #164 as discussed there.
Removes filtering out of executables/tests not specified in the manifest; this allows all programs found in
app/andtest/directories (and subdirectories) into the package model.Does not affect existing behaviour of
[[executable]]and[[test]]entries in manifest:Adds a 'scope' to each source, based on source file location, to control which modules can be
used within:src/) can onlyuseother library modules or modules from dependencies;app/andtest/can use library modules and any modules defined in the same directory as the executable/test;app/ortest/;usestatement that satisfies these scoping rules.Adds a new example demonstrating: