Seagate / halon

High availability solution
Apache License 2.0
1 stars 0 forks source link

scripts/h0: Default to `--fast` compilation #1478

Closed 1468ca0b-2a64-4fb4-8e52-ea5806644b4c closed 6 years ago

1468ca0b-2a64-4fb4-8e52-ea5806644b4c commented 6 years ago

Created by: vvv

1468ca0b-2a64-4fb4-8e52-ea5806644b4c commented 6 years ago

Created by: chumakd

@vvv 👍 please replace the build command in .circleci/config.yml with GHC_OPTS='-g -j2' h0 make then

1468ca0b-2a64-4fb4-8e52-ea5806644b4c commented 6 years ago

Created by: vvv

build fails and needs to be fixed.

The failure was caused by missing export. I thought it was unnecessary, wrongfully so.

--fast turns off optimizations, reducing compilation time. Defaulting to --fast is justified, because h0 script is mostly used during edit-compile-debug cycle.

h0 script is used on CircleCI to build Halon and run unit tests. This means that it will test non-optimized code, which may behave differently? If that's a possibility, it might make sense to change build command in .circleci/config.yml config, which currently uses./scripts/h0 make, and replace it with equivalent one w/o --fast.

To be honest, I don't know. I saw --fast in CI configuration of some other project, FWIIW...

Never mind. I've just learnt that stack build --fast is equivalent to stack build --ghc-options='-O0'. I'll add an environment variable to control GHC options. To build with optimizations one would have to specify this option explicitly; i.e., GHC_OPTS='-g -j2' h0 make would work similarly to the old h0 make.

1468ca0b-2a64-4fb4-8e52-ea5806644b4c commented 6 years ago

Created by: chumakd

@andriytk we do build Halon rpms on CircleCI, but I don't think that we can run Halon unit-tests from rpm

1468ca0b-2a64-4fb4-8e52-ea5806644b4c commented 6 years ago

Created by: andriytk

Why don't we build and test rpms on CI?

1468ca0b-2a64-4fb4-8e52-ea5806644b4c commented 6 years ago

Created by: chumakd

build fails and needs to be fixed.

--fast turns off optimizations, reducing compilation time. Defaulting to --fast is justified, because h0 script is mostly used during edit-compile-debug cycle.

h0 script is used on CircleCI to build Halon and run unit tests. This means that it will test non-optimized code, which may behave differently? If that's a possibility, it might make sense to change build command in .circleci/config.yml config, which currently uses./scripts/h0 make, and replace it with equivalent one w/o --fast.