Skip to content
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

Port entire build process from configure/make to dune #104

Merged
merged 40 commits into from Jul 19, 2022
Merged

Conversation

sim642
Copy link
Member

@sim642 sim642 commented Jul 17, 2022

The build process is a real pile of hacks, particularly because:

  1. Machdep is generated at compile time of CIL, which is morally wrong.

    It's build process is also extremely convoluted:

    1. Build an OCaml program (machdepConfigure.exe).
    2. Run that OCaml program to generate a C header (machdep-config.h).
    3. Build a C program (machdep-ml.exe) which includes that header.
    4. Run that C program to generate a part of an OCaml record definition.
    5. Construct the OCaml Machdep module using cppo to include part of that record definition.
    6. Build the Machdep module for CIL library.
  2. Apple's stupid gcc symlink to their Clang, which makes every gcc call a multi-step process. Moreover, homebrew's gcc doesn't support -m32, so additional conditional compilation is needed (whereas the old configure/make rather silently ignored those assembler errors).

    Even though we removed MSVC support, maybe we should add Clang support. That would solve all these obscure GCC problems and Clang should be much more similar to GCC than MSVC.

@sim642 sim642 added this to the 2.0.0 milestone Jul 17, 2022
@michael-schwarz
Copy link
Member

michael-schwarz commented Jul 18, 2022

For me locally, all tests fail when I run dune runtest or dune test.

     testcil alias test/runtest (exit 2)
(cd _build/default/test && ./testcil -r --regrtest)
Test infrastructure for CIL on linux
There are 430 tests enabled
------------ [0] CC="gcc" make arcombine ------------

[0] A regression test command failed:
  CC="gcc" make arcombine
------------ [1] CC="gcc" make baddef ------------
------------ [2] CC="gcc" make comb ------------
------------ [3] CC="gcc" make combine1 ------------

[3] A regression test command failed:
  CC="gcc" make combine1
------------ [4] CC="gcc" make combine10 ------------
[....]

[424] A regression test command failed:
  CC=gcc make testrungcc/enum3g
[425] A regression test command failed:
  CC=gcc make testrungcc/enum3h
[426] A regression test command failed:
  CC=gcc make testrungcc/enum3i
[427] A regression test command failed:
  CC=gcc make testrungcc/enum3j
[428] A regression test command failed:
  CC=gcc make testrungcc/enum3k
[429] A regression test command failed:
  CC=gcc make testrungcc/enum3l

@michael-schwarz
Copy link
Member

But once we get that to work stabley, I think it is a good idea to ditch all of this autoconf based madness.

@sim642
Copy link
Member Author

sim642 commented Jul 18, 2022

I think _build/default/test/cil.log should contain more detailed information about what's going wrong.
But if I were to guess, it might be due to a dirty build, which dune clean or make clean (before switching to this branch) might fix. If you've used make in the past, you'll have some of the make-generated files directly in the source tree, which dune might be just copying into _build instead of generating them using the newly defined rules.

Copy link
Member

@michael-schwarz michael-schwarz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I updates the readme slightly and added a comment on how to run an individual test from the suite.

@michael-schwarz
Copy link
Member

But if I were to guess, it might be due to a dirty build, which dune clean or make clean (before switching to this branch) might fix.

It was indeed a dirty build, but none of those helped. The issue was gone after a fresh checkout hough 🎉

@michael-schwarz michael-schwarz merged commit 55970e0 into develop Jul 19, 2022
@michael-schwarz michael-schwarz deleted the dune branch July 19, 2022 08:54
@michael-schwarz
Copy link
Member

@sim642: It looks like the new build process for the documentation is broken: https://github.com/goblint/cil/runs/7405853088?check_suite_focus=true

@sim642
Copy link
Member Author

sim642 commented Jul 19, 2022

Should be fixed on master now.

sim642 added a commit to sim642/opam-repository that referenced this pull request Aug 12, 2022
CHANGES:

* Wrap library into `GoblintCil` module (goblint/cil#107).
* Remove all MSVC support (goblint/cil#52, goblint/cil#88).
* Port entire build process from configure/make to dune (goblint/cil#104).
* Add C11 `_Generic` support (goblint/cil#48).
* Add C11 `_Noreturn` support (goblint/cil#58).
* Add C11 `_Static_assert` support (goblint/cil#62).
* Add C11 `_Alignof` support (goblint/cil#66).
* Add C11 `_Alignas` support (goblint/cil#93, goblint/cil#108).
* Add partial C11 `_Atomic` support (goblint/cil#61).
* Add `_Float32`, `_Float64`, `_Float32x` and `_Float64x` type support (goblint/cil#8, goblint/cil#60).
* Add Universal Character Names, `char16_t` and `char32_t` type support (goblint/cil#80).
* Change locations to location spans and add additional expression locations (goblint/cil#51).
* Add synthetic marking for CIL-inserted statement locations (goblint/cil#98).
* Expose list of files from line control directives (goblint/cil#73).
* Add parsed location transformation hook (goblint/cil#89).
* Use Zarith for integer constants (goblint/cil#47, goblint/cil#53).
* Fix constant folding overflows (goblint/cil#59).
* Add option to disable constant branch removal (goblint/cil#103).
* Add standalone expression parsing and checking (goblint/cil#97, goblint/cil#96).
* Improve inline function merging (goblint/cil#72, goblint/cil#85, goblint/cil#84, goblint/cil#86).
* Fix some attribute parsing cases (goblint/cil#71, goblint/cil#75, goblint/cil#76, goblint/cil#77).
* Fix global NaN initializers (goblint/cil#78, goblint/cil#79).
* Fix `cilly` binary installation (goblint/cil#99, goblint/cil#100, goblint/cil#102).
* Remove batteries dependency to support OCaml 5 (goblint/cil#106).
sim642 added a commit to sim642/opam-repository that referenced this pull request Aug 12, 2022
CHANGES:

* Wrap library into `GoblintCil` module (goblint/cil#107).
* Remove all MSVC support (goblint/cil#52, goblint/cil#88).
* Port entire build process from configure/make to dune (goblint/cil#104).
* Add C11 `_Generic` support (goblint/cil#48).
* Add C11 `_Noreturn` support (goblint/cil#58).
* Add C11 `_Static_assert` support (goblint/cil#62).
* Add C11 `_Alignof` support (goblint/cil#66).
* Add C11 `_Alignas` support (goblint/cil#93, goblint/cil#108).
* Add partial C11 `_Atomic` support (goblint/cil#61).
* Add `_Float32`, `_Float64`, `_Float32x` and `_Float64x` type support (goblint/cil#8, goblint/cil#60).
* Add Universal Character Names, `char16_t` and `char32_t` type support (goblint/cil#80).
* Change locations to location spans and add additional expression locations (goblint/cil#51).
* Add synthetic marking for CIL-inserted statement locations (goblint/cil#98).
* Expose list of files from line control directives (goblint/cil#73).
* Add parsed location transformation hook (goblint/cil#89).
* Use Zarith for integer constants (goblint/cil#47, goblint/cil#53).
* Fix constant folding overflows (goblint/cil#59).
* Add option to disable constant branch removal (goblint/cil#103).
* Add standalone expression parsing and checking (goblint/cil#97, goblint/cil#96).
* Improve inline function merging (goblint/cil#72, goblint/cil#85, goblint/cil#84, goblint/cil#86).
* Fix some attribute parsing cases (goblint/cil#71, goblint/cil#75, goblint/cil#76, goblint/cil#77).
* Fix global NaN initializers (goblint/cil#78, goblint/cil#79).
* Fix `cilly` binary installation (goblint/cil#99, goblint/cil#100, goblint/cil#102).
* Remove batteries dependency to support OCaml 5 (goblint/cil#106).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants