Giter Site home page Giter Site logo

remodel's Introduction

remodel

make using MD5 instead of timestamps

remodel is a dependency management program. Dependencies are specified in a file with the following syntax:

target1 [ , target2 ... ] <- source1 [ , source2 ... [ : "command" ] ]

remodel, by default looks for (r|R)emodelfile. remodel can be made to use arbit filenames using -f switch. remodel, execute in parallel as many dependencies as it can. The amount of parallelism can be controlled using -j command line switch. remodel should be executed in the directory in which all dependencies are assumed to reside in rules file.

Usage: remodel [ options ] [ target ] ...
Options:
-j To specify the number of jobs to execute in parallel.
-f To specify a file other than (r|R)emodelfile.
-B To force rebuild of dependencies.
-help To display help menu.
--help to display help menu.

=============================

Building and Installing remodel

remodel is written in ocaml. The dependencies required to build remodel are

  • ocaml v4.00.1
  • ocamlgraph

opam can be used to manage compiler versions and library dependencies.

Binary name : remodel.native
Build Instructions :-

Execute the following commands in the project root directory

  • ocaml setup.ml -configure
  • ocaml setup.ml -build

Optional

  • ocaml setup.ml -install

===========================

Tests

Tests are located under test directory. They can be run using remodel.native built in the previous step. The details are as follows :

Use command "remodel.native [ -f <remodelfile name> ] <arg>" to run a test

remodelfile name arg test description
nodefaultremodel - DEFAULT target missing
nodefaultremodel c Rule missing to make a dependency
compile/ - builds example baz program
multiple_targets/ - builds multiple target
cycle/* -/a Cyclic dependency detection
vanilla/ - alternate actions, quick playground

=========================================

Working

Dependency Management

remodel parses the input file to form a dependency graph. Unless any particular target is specified on command line, remodel looks for a DEFAULT target in rules file to build.

Determining which target needs to be rebuild

remodel maintains a record of md5 digest of files in file index.rmd located in a hidden directory .remodel. Using entries in this record, remodel is able to determine if a file has changed from its previous build. Before triggering any command, current digest of file is computed and is matched with digest entry of the file. Target is rebuilt if the digests do not match.

Upon changing any command to build the target, remodel does not rebuilds the target on the next run. The developer, if required, can force remodel to rebuild target using

remodel.native -B target

Maintaining index.rmd record

index.rmd is a plain text file that contains dependency file path and its md5 digest. Only dependency files that exist in rules file are present in index.rmd. remodel checks for existence of .remodel/index.rmd on every run. If it is not found then remodel creates one, builds the target specified and updates index.rmd with new digest. As dependency files are changed, their md5 is updated in this file.

Over time as project evolves, some files may be renamed. This renaming may lead to garbage entries in index.rmd. remodel takes care of this and prunes non-existent entries after a successfull build.

Parallelism

remodel determines which rules can be executed independent of each other and executes them in parallel. The degree of parallelism can optionally be controlled using "-j" command line switch. remodel assigns a logical time to every dependency and executes dependency with same logical timestamp in parallel.

Exclusiveness

In a directory, remodel maintains exclusiveness by taking a lock on index.rmd file so that another remodel process cannot clobber the project directory.

remodel's People

Contributors

nimishgupta avatar

Watchers

 avatar  avatar

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.