-
Notifications
You must be signed in to change notification settings - Fork 121
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
Cargo-make to replace CMake on CXX projects (and others)? #486
Comments
thanks for the detailed explanation and examples. cargo-make in general can be used to run any flow and for rust gives much extra power. it doesn't mean it won't work, but you would have to do things manually.
can you check it out first before we think of better solution? |
The issue with cmake is that it builds the makefiles per platform and the makefiles being a limiting factor atm where i want it to build on as many turing complete systems as possible including non-standard to the reasonable degree -> Assuming sourcing makefiles not a sufficient solution?
On quicklook duckscript seems to be too limited for the expected usecase, but i am happy to be proven otherwise, see scripting language requirements below. DISCLAIMER: i didn't fully identified the code yet (around 60% identified), but i have a good idea what it is doing in short it's database handler that executes scripts with provided built-in API to provide packages for target system. So i've created a stub commit in https://github.com/Kreyren/CM-Paludis intended for discussion (this is a package manager currently designed for With ultimate goal to compile e.g. GNU emacs using the default exheres eapi (downstream library used for processing of the package) using client Cave depends on following libraries for runtime: https://github.com/Kreyren/CM-Paludis/blob/master/CMakeLists.txt#L18 with original code at http://gitlab.exherbo.org/paludis/paludis (Fork adapted to allow non-cmake management) TODO list1. We need method to create static and dynamic libraries depending on file type on demandThis seems to be possible using custom logic through 2. Parsing options inside the source code prior to compilationalso 3. Specifying executables for compilationpre-defined logic overwrittable through 4. Method to run testslow-priority atm
5. Method to run benchmarkslow-priority atm
Requirements for the scripting languageDISCLAIMER: This are observed in relation to rustlang, cmake, posix sh and lisp -- Are probably incomplete and require brainstorm Conditionals
Loops
Linting/environmentsContext: The major issue with ion that i have atm is that it doesn't have linting and the peer-review process has to be done through upstream that is taking time and is unreasonable to believe that contributors would go through this process willingly -> Ideally expecting a way to automate the review process for the contribution review through linting and tools like valgrind, indent, etc.. where less work reviewing i do the better.
RegExPCRE ideally or something embedded that allows reliable text manipulation CommentsEssential for my project where preferred are C-style comments expected to be interpreted as in-code documentation that can ideally be formatted into rustlang-style library documentation. FunctionsIdeally something sane that allows specifying arguments and limits EfficientExpecting efficiency greater then POSIX sh and quicklisp ReadabilityI prefer to make my code as readable as possible meaning:
Handling of librariesFrom my observation the most limiting factor on C is the lack of library handling that makes them more likely to be deprecated or recreated which is handled on rustlang through crates.io preferrable for scripting language as well OptionalMethod to create tests and benchmarks per function would be preferred to reduce the amount of bugs Method to redefine the programming language for the task welcomed e.g. lisp interpreted into emacs lisp to be used in scripting in GNU Emacs FWIW i like more the idea of making a scripts that compile the code that can be then put in a Makefile as code quality, reliability and readability is a concern. |
|
Can you elaborate how? I think you are proposing to maintain multiple makefiles used depending on used kernel which would require a duplicate code assuming the complexity of the CXX repo that requires compiling of libraries from X amount of files? duckscript noted FWIW my current proposal would be to add optional API to cargo-make that can be used as a replacement for cmake that doesn't generate the Makefiles and can be used across multiple programming languages. I am currently abstracting a different project that is expected to be rewritten into multiple programming languages and it's components compiled based on benchmark results so i would be interested in cooperating on this if it's in the scope of this project assuming that it would provide an API to multiple scripting/programming languages to be used on demand. |
@Kreyren i just published a new repo: https://github.com/sagiegurari/cargo-make-tasks/ for now i just created 1 makefile (cmake) for my cmake based c projects, but its worth checking what i did there to see if it can maybe give you ideas for your usecase. |
I like the idea and i will for sure it it for a reference, but i think it should be part of this repo e.g. using |
I am confused what is this doing, is this using a python file to define environment variables? FWIW i dont want to make software that during a runtime reads a lot of env vars as that would be unsafe, but i like the idea of using these during a build. Maybe this could be implemented so that it expects a standardized file whoch sets a lots of variables e.g. how linux is configured ? |
no, its an example on creating env vars with glob path |
closing this one as i think duckscript + cmake tasks examples i gave is a good start. |
I am rewriting Paludis https://gitlab.exherbo.org/paludis/paludis and using CMake on it is currently as painful as it can possible be, because it is:
1. Scripting language is featureless and implementation requires difficult to read code
defining almost everything as strings - Which to me is painful to use and writing in it feels like adding work instead of making the work easier due to the terrible syntax that requires everything to be longer then it needs to be alike:
Code example
To get sensible processing time as defining these into a function and using custom function to allow switch statement seems to increase the processing time.
2. Inefficient
Measurements are on 4thread @ 2.701Ghz CPU with SO-DIMM DDR3 RAM
3. Culturary unindeal
This may sound silly, but i am keep being blamed by the OSS community for making my software to be painful to contribute to and only in english so i like to add functions alike:
So that the output is in the language of the end-user while taking in mind mental illnesses like tokophobia https://en.wikipedia.org/wiki/Tokophobia to remove mentioning of birth with replacement string.
Cargo-make is already able to be used for this through #473 to inject functions to handle the runtime, but the implementation is 'ugly' (hard to read, requires duplicate code, etc..)
So this issue proposes adding a scripting language to cargo-make that would allow it to:
1. Inject variables in the source code
For example in cmake there is
option()
that allows parsing argument from cli e.g:This can be already done via cargo-make through
--env
, but it lacks the variable assigned string which is minor.2. Cargo-make lacks library handling
In cmake there are libraries that can be fetched in the configuration e.g.
GNUInstallDirs
https://cmake.org/cmake/help/v3.0/module/GNUInstallDirs.html that provides variables alikeSYSCONFDIR
that stores/etc
to comply with File System Hierarchy v3.0 standard3. Possibly more things..
Proposal
In theory the
ion
from the Redox project https://github.com/redox-os/ion could be used for the scripting and just allowing to provide function handling while keepingMakefile.toml
to handle the targets that call functions from the scripting file e.g.makersLists.txt
(probably a better name..)Would this be in the scope of
cargo-make
?The text was updated successfully, but these errors were encountered: