kframework / c-semantics

Semantics of C in K
Other
305 stars 40 forks source link

[nice-to-have] Componentization #358

Open h0nzZik opened 5 years ago

h0nzZik commented 5 years ago

Current:

.
|-- .build
|    `--k
|-- build.sh
|-- clang-tools
|-- dist
|-- examples
|-- INSTALL.md
|-- LICENSE
|-- licenses
|-- Makefile
|-- native-server
|-- parser
|-- profiles
|-- README.md
|-- scripts
|-- semantics
|-- setup
|-- tests
`-- verification

Suggested:

.
|-- build
|    `-- .gitkeep
|-- deps
|    |-- Makefile
|    |-- clang
|    `-- k
|-- src
|    |-- Makefile
|    |-- clang-tools
|    |-- kcc
|    |-- native-server
|    |-- parser
|    |-- profiles
|    |-- setup
|    |-- scripts
|    |-- semantics
|    `-- utils
|-- dist
|-- examples
|-- INSTALL.md
|-- LICENSE
|-- licenses
|-- Makefile
|-- README.md
|-- tests
`-- verification

It will help to separate grap-dependencies, build and distribute steps.

  1. grab-dependencies clones K, checks perl/ocaml stuff, downloads clang. Writes only to /deps, or potentially to /build/deps.
  2. build will write only to the /build directory.
  3. distribute writes only to /dist. If it needs to build some helpers, it will do it in /dist/build.

@chathhorn What do you think?

h0nzZik commented 5 years ago

I attempted to restructure the repository in my experimental buildsystem refactoring branch (broken build). During the work I identified the following nice-to-have features of the build system:

  1. Every component should be buildable and testable on its own. (And we should have some per-component tests.)
  2. The phases get-dependencies, build-dependencies and build should be separated. Developer would need to repeat only the build phase. That would save some time.
  3. Both the project and individual components should be easily buildable using docker, and also easily buildable without docker - assuming the developer has installed all the SDKs (perl, java, c++).
  4. The whole build process (including the dependency-related phases) should not write anywhere besides one specific build directory. Trivially true when building with docker.
  5. The output directory (currently dist) should have an unix-friendly structure (bin, lib, libexec, share).

We may discuss these requirements and possibly implement them later.

I identified the following components: clang-tools cparser kcc native-server semantics

The components native-server and semantics can be combined into a profile. The kcc component depends on all the other.