Comments (5)
Hello velkyel,
rules may write to arbitrary files in the filesystem. Only the outputs declared to the build system (the ones metioned in core.publish(outputs=...)
) are required to be inside the build directory. This is currently enforced here:
Lines 69 to 70 in 74e79da
For example you may install any files in the appropriate system directories. Just don't mention them inside core.publish
. This means the files will not be tracked by the system — for example, modification or deletion will not trigger a rebuild. Tasks like "install" should be created by using core.publish(phony=True, outputs=['install'], force=True, ...)
, which means that they will be executed uncondictionally.
Do you have use-case where you require an output outside of the build directory that should be tracked by the build-system? If so, sharing it would help very much. We can change this behaviour if reasonable.
from cook.
Hello,
my simplified use-case is following: I have two directories a/ and b/ in project root. a/ contains files and I want convert/transform them (based on quite complicated rules) into b/ (b/ contains other files too - not only conversions from a/). Changes in a/ or deletion in b/ should trigger rebuild.
Another issue: cook doesn't track BUILD.py itself like scons do with SConstruct. (forced rebuild is invoked on build script modifications)
from cook.
Alright,
the restriction regarding output file paths is disabled for now (b58b54e). It might be enabled again in the future, but I guess having the option to disable this on individual rules might be useful then. For example, one could write core.publish(strict=False, ...)
or something like that, we will have to see.
Regarding your other point: Cook does not automatically track the BUILD.py because of granularity: Tiny changes which might only affect one single task would lead to rebuilding every single task defined in that script. Instead, rules are advised to mention any data they depend on using core.publish(check=XYZ, ...)
. However, I just pushed a new commit (c19e094) which allows you to do the following:
core.publish(
inputs=[__file__],
outputs=...,
message=...
)
This will track the entire BUILD.py script. __file__
resolves to the path of the file containg it.
In the future, we might add means of automatically tracking the function defining the rules (i.e. hashing the functions __code__
attribute or something like that).
from cook.
great. For this patch ae1f48b too. strict keyword switch will be ok. Issue about tracking BUILD.py script changes is not so important for me so file solution is good enough.
Thank you!
from cook.
Great to hear this!
If you have any other comments / questions, feel free to open issues / message me.
from cook.
Related Issues (20)
- Improve website HOT 1
- Improve documentation HOT 1
- Investigate Rust Rules HOT 1
- C++ feature detection / configuration
- Option to choose debug / release
- Improve IDE support HOT 1
- Path handling HOT 1
- Determine default environment to run commands within HOT 1
- Warnings are not restored HOT 1
- Automatically regenerate CLion project HOT 1
- immediate quit whole build if any job fails HOT 8
- Git Bash on Windows - UI issues HOT 1
- decider option like scons HOT 4
- Cook name duplicates established work of art HOT 2
- Investigate C Rules
- Investigate Java Rules
- Handle unknown output filenames HOT 5
- Integrate other build systems HOT 1
- Generic rule for arbitrary commands HOT 2
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 cook.