From bb7f4dd6d7b8203efb8c00448ac1f13b5671fb92 Mon Sep 17 00:00:00 2001 From: TimQu Date: Fri, 28 Sep 2018 16:39:37 +0200 Subject: [PATCH 1/4] canHandle method of exact continuous time model checkers now return 'false' for time-bounded properties --- .../csl/HybridCtmcCslModelChecker.cpp | 2 +- .../csl/SparseCtmcCslModelChecker.cpp | 2 +- .../SparseMarkovAutomatonCslModelChecker.cpp | 21 +++++++++++++++++++ .../SparseMarkovAutomatonCslModelChecker.h | 6 ++++++ 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/src/storm/modelchecker/csl/HybridCtmcCslModelChecker.cpp b/src/storm/modelchecker/csl/HybridCtmcCslModelChecker.cpp index 4d2507288..d36680dea 100644 --- a/src/storm/modelchecker/csl/HybridCtmcCslModelChecker.cpp +++ b/src/storm/modelchecker/csl/HybridCtmcCslModelChecker.cpp @@ -37,7 +37,7 @@ namespace storm { template::SupportsExponential, int>::type> bool HybridCtmcCslModelChecker::canHandleImplementation(CheckTask const& checkTask) const { storm::logic::Formula const& formula = checkTask.getFormula(); - return formula.isInFragment(storm::logic::prctl().setGloballyFormulasAllowed(false).setLongRunAverageRewardFormulasAllowed(true).setLongRunAverageProbabilitiesAllowed(true)); + return formula.isInFragment(storm::logic::prctl().setGloballyFormulasAllowed(false).setLongRunAverageRewardFormulasAllowed(true).setLongRunAverageProbabilitiesAllowed(true).setTimeBoundedUntilFormulasAllowed(false).setCumulativeRewardFormulasAllowed(false)); } template diff --git a/src/storm/modelchecker/csl/SparseCtmcCslModelChecker.cpp b/src/storm/modelchecker/csl/SparseCtmcCslModelChecker.cpp index 3cedc1fab..f35d7e41f 100644 --- a/src/storm/modelchecker/csl/SparseCtmcCslModelChecker.cpp +++ b/src/storm/modelchecker/csl/SparseCtmcCslModelChecker.cpp @@ -44,7 +44,7 @@ namespace storm { template::SupportsExponential, int>::type> bool SparseCtmcCslModelChecker::canHandleImplementation(CheckTask const& checkTask) const { storm::logic::Formula const& formula = checkTask.getFormula(); - return formula.isInFragment(storm::logic::prctl().setGloballyFormulasAllowed(false).setLongRunAverageRewardFormulasAllowed(true).setLongRunAverageProbabilitiesAllowed(true).setTimeAllowed(true).setTotalRewardFormulasAllowed(true)); + return formula.isInFragment(storm::logic::prctl().setGloballyFormulasAllowed(false).setLongRunAverageRewardFormulasAllowed(true).setLongRunAverageProbabilitiesAllowed(true).setTimeAllowed(true).setTotalRewardFormulasAllowed(true).setTimeBoundedUntilFormulasAllowed(false).setCumulativeRewardFormulasAllowed(false)); } template diff --git a/src/storm/modelchecker/csl/SparseMarkovAutomatonCslModelChecker.cpp b/src/storm/modelchecker/csl/SparseMarkovAutomatonCslModelChecker.cpp index 929ea8721..454de198b 100644 --- a/src/storm/modelchecker/csl/SparseMarkovAutomatonCslModelChecker.cpp +++ b/src/storm/modelchecker/csl/SparseMarkovAutomatonCslModelChecker.cpp @@ -28,6 +28,12 @@ namespace storm { template bool SparseMarkovAutomatonCslModelChecker::canHandle(CheckTask const& checkTask) const { + return SparseMarkovAutomatonCslModelChecker::canHandleImplementation(checkTask); + } + + template + template::SupportsExponential, int>::type> + bool SparseMarkovAutomatonCslModelChecker::canHandleImplementation(CheckTask const& checkTask) const { storm::logic::Formula const& formula = checkTask.getFormula(); if(formula.isInFragment(storm::logic::csl().setGloballyFormulasAllowed(false).setNextFormulasAllowed(false).setRewardOperatorsAllowed(true).setReachabilityRewardFormulasAllowed(true).setTotalRewardFormulasAllowed(true).setTimeAllowed(true).setLongRunAverageProbabilitiesAllowed(true).setLongRunAverageRewardFormulasAllowed(true))) { return true; @@ -40,6 +46,21 @@ namespace storm { } } + template + template::SupportsExponential, int>::type> + bool SparseMarkovAutomatonCslModelChecker::canHandleImplementation(CheckTask const& checkTask) const { + storm::logic::Formula const& formula = checkTask.getFormula(); + if(formula.isInFragment(storm::logic::prctl().setGloballyFormulasAllowed(false).setNextFormulasAllowed(false).setRewardOperatorsAllowed(true).setReachabilityRewardFormulasAllowed(true).setTotalRewardFormulasAllowed(true).setTimeAllowed(true).setLongRunAverageProbabilitiesAllowed(true).setLongRunAverageRewardFormulasAllowed(true).setTimeBoundedUntilFormulasAllowed(false).setCumulativeRewardFormulasAllowed(false))) { + return true; + } else { + // Check whether we consider a multi-objective formula + // For multi-objective model checking, each initial state requires an individual scheduler (in contrast to single objective model checking). Let's exclude multiple initial states. + if (this->getModel().getInitialStates().getNumberOfSetBits() > 1) return false; + if (!checkTask.isOnlyInitialStatesRelevantSet()) return false; + return formula.isInFragment(storm::logic::multiObjective().setTimeAllowed(true).setTimeBoundedUntilFormulasAllowed(false).setCumulativeRewardFormulasAllowed(false)); + } + } + template std::unique_ptr SparseMarkovAutomatonCslModelChecker::computeBoundedUntilProbabilities(Environment const& env, CheckTask const& checkTask) { storm::logic::BoundedUntilFormula const& pathFormula = checkTask.getFormula(); diff --git a/src/storm/modelchecker/csl/SparseMarkovAutomatonCslModelChecker.h b/src/storm/modelchecker/csl/SparseMarkovAutomatonCslModelChecker.h index 3bd557dd4..3bd220449 100644 --- a/src/storm/modelchecker/csl/SparseMarkovAutomatonCslModelChecker.h +++ b/src/storm/modelchecker/csl/SparseMarkovAutomatonCslModelChecker.h @@ -29,7 +29,13 @@ namespace storm { virtual std::unique_ptr computeLongRunAverageRewards(Environment const& env, storm::logic::RewardMeasureType rewardMeasureType, CheckTask const& checkTask) override; virtual std::unique_ptr computeReachabilityTimes(Environment const& env, storm::logic::RewardMeasureType rewardMeasureType, CheckTask const& checkTask) override; virtual std::unique_ptr checkMultiObjectiveFormula(Environment const& env, CheckTask const& checkTask) override; + + private: + template::SupportsExponential, int>::type = 0> + bool canHandleImplementation(CheckTask const& checkTask) const; + template::SupportsExponential, int>::type = 0> + bool canHandleImplementation(CheckTask const& checkTask) const; }; } } From 24cf45d9b603041760224548dbab3be7d30ae739 Mon Sep 17 00:00:00 2001 From: TimQu Date: Fri, 28 Sep 2018 16:40:17 +0200 Subject: [PATCH 2/4] prism ToJaniConverter now adds the 'state-exit-rewards' model feature if present --- src/storm/storage/prism/ToJaniConverter.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/storm/storage/prism/ToJaniConverter.cpp b/src/storm/storage/prism/ToJaniConverter.cpp index 0f86f2398..a780200f2 100644 --- a/src/storm/storage/prism/ToJaniConverter.cpp +++ b/src/storm/storage/prism/ToJaniConverter.cpp @@ -251,6 +251,7 @@ namespace storm { // Go through the reward models and construct assignments to the transient variables that are to be added to // edges and transient assignments that are added to the locations. std::map> transientEdgeAssignments; + bool hasStateRewards = false; for (auto const& rewardModel : program.getRewardModels()) { std::string finalRewardModelName; if (rewardModel.getName().empty()) { @@ -270,6 +271,7 @@ namespace storm { storm::jani::RealVariable const& newTransientVariable = janiModel.addVariable(storm::jani::RealVariable(finalRewardModelName, newExpressionVariable, manager->rational(0.0), true)); if (rewardModel.hasStateRewards()) { + hasStateRewards = true; storm::expressions::Expression transientLocationExpression; for (auto const& stateReward : rewardModel.getStateRewards()) { storm::expressions::Expression rewardTerm = stateReward.getStatePredicateExpression().isTrue() ? stateReward.getRewardValueExpression() : storm::expressions::ite(stateReward.getStatePredicateExpression(), stateReward.getRewardValueExpression(), manager->rational(0)); @@ -321,6 +323,10 @@ namespace storm { STORM_LOG_THROW(!rewardModel.hasTransitionRewards(), storm::exceptions::NotImplementedException, "Transition reward translation currently not implemented."); } STORM_LOG_THROW(transientEdgeAssignments.empty() || transientLocationAssignments.empty() || !program.specifiesSystemComposition(), storm::exceptions::NotImplementedException, "Cannot translate reward models from PRISM to JANI that specify a custom system composition."); + // if there are state rewards and the model is a discrete time model, we add the corresponding model feature + if (janiModel.isDiscreteTimeModel() && hasStateRewards) { + janiModel.getModelFeatures().add(storm::jani::ModelFeature::StateExitRewards); + } // Now create the separate JANI automata from the modules of the PRISM program. While doing so, we use the // previously built mapping to make variables global that are read by more than one module. From c6204254a3c20c318528fe166cb95f18568b1852 Mon Sep 17 00:00:00 2001 From: dehnert Date: Sat, 29 Sep 2018 13:08:02 +0200 Subject: [PATCH 3/4] fixing two issues related to complex model building and in particular integer vs rational division --- src/storm/adapters/Z3ExpressionAdapter.cpp | 5 ++++- .../expressions/BinaryNumericalFunctionExpression.cpp | 2 +- src/storm/storage/expressions/ToRationalNumberVisitor.cpp | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/storm/adapters/Z3ExpressionAdapter.cpp b/src/storm/adapters/Z3ExpressionAdapter.cpp index 8a7f55bf5..bb9afb6f3 100644 --- a/src/storm/adapters/Z3ExpressionAdapter.cpp +++ b/src/storm/adapters/Z3ExpressionAdapter.cpp @@ -227,6 +227,9 @@ namespace storm { result = leftResult * rightResult; break; case storm::expressions::BinaryNumericalFunctionExpression::OperatorType::Divide: + if (leftResult.is_int() && rightResult.is_int()) { + leftResult = z3::expr(context, Z3_mk_int2real(context, leftResult)); + } result = leftResult / rightResult; break; case storm::expressions::BinaryNumericalFunctionExpression::OperatorType::Min: @@ -363,7 +366,7 @@ namespace storm { case storm::expressions::UnaryNumericalFunctionExpression::OperatorType::Ceil:{ storm::expressions::Variable freshAuxiliaryVariable = manager.declareFreshVariable(manager.getIntegerType(), true); z3::expr ceilVariable = context.int_const(freshAuxiliaryVariable.getName().c_str()); - additionalAssertions.push_back(z3::expr(context, Z3_mk_int2real(context, ceilVariable)) - 1 <= result && result < z3::expr(context, Z3_mk_int2real(context, ceilVariable))); + additionalAssertions.push_back(z3::expr(context, Z3_mk_int2real(context, ceilVariable)) - 1 < result && result <= z3::expr(context, Z3_mk_int2real(context, ceilVariable))); result = ceilVariable; break; } diff --git a/src/storm/storage/expressions/BinaryNumericalFunctionExpression.cpp b/src/storm/storage/expressions/BinaryNumericalFunctionExpression.cpp index 92ed03c5c..aaafce6cc 100644 --- a/src/storm/storage/expressions/BinaryNumericalFunctionExpression.cpp +++ b/src/storm/storage/expressions/BinaryNumericalFunctionExpression.cpp @@ -111,7 +111,7 @@ namespace storm { case OperatorType::Divide: newValue = firstOperandEvaluation / secondOperandEvaluation; break; case OperatorType::Power: { if (carl::isInteger(secondOperandEvaluation)) { - std::size_t exponent = carl::toInt(secondOperandEvaluation); + std::size_t exponent = carl::toInt(secondOperandEvaluation); newValue = carl::pow(firstOperandEvaluation, exponent); } break; diff --git a/src/storm/storage/expressions/ToRationalNumberVisitor.cpp b/src/storm/storage/expressions/ToRationalNumberVisitor.cpp index c54758b12..24c50e32f 100644 --- a/src/storm/storage/expressions/ToRationalNumberVisitor.cpp +++ b/src/storm/storage/expressions/ToRationalNumberVisitor.cpp @@ -76,7 +76,7 @@ namespace storm { break; case BinaryNumericalFunctionExpression::OperatorType::Power: STORM_LOG_THROW(storm::utility::isInteger(secondOperandAsRationalNumber), storm::exceptions::InvalidArgumentException, "Exponent of power operator must be a positive integer."); - exponentAsInteger = storm::utility::convertNumber(secondOperandAsRationalNumber); + exponentAsInteger = storm::utility::convertNumber(secondOperandAsRationalNumber); result = storm::utility::pow(firstOperandAsRationalNumber, exponentAsInteger); return result; break; From 0588fb0cc08828bd3ccbf1b7efb12c5941962a3c Mon Sep 17 00:00:00 2001 From: Matthias Volk Date: Mon, 1 Oct 2018 13:07:36 +0200 Subject: [PATCH 4/4] Travis: Workaround for nonblocking mode --- .travis.yml | 64 +++++++++++++++++++++++++++++++++++++++ travis/generate_travis.py | 6 ++++ 2 files changed, 70 insertions(+) diff --git a/.travis.yml b/.travis.yml index edeac6e25..26478356a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -47,6 +47,8 @@ jobs: env: CONFIG=DefaultDebugTravis LINUX=ubuntu-18.04 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build_carl.sh after_success: @@ -60,6 +62,8 @@ jobs: env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-18.04 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build_carl.sh after_success: @@ -79,6 +83,8 @@ jobs: install: - rm -rf build - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh Build1 before_cache: @@ -93,6 +99,8 @@ jobs: install: - rm -rf build - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh Build1 before_cache: @@ -107,6 +115,8 @@ jobs: install: - rm -rf build - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh Build1 before_cache: @@ -121,6 +131,8 @@ jobs: install: - rm -rf build - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh Build1 before_cache: @@ -135,6 +147,8 @@ jobs: install: - rm -rf build - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh Build1 before_cache: @@ -149,6 +163,8 @@ jobs: install: - rm -rf build - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh Build1 before_cache: @@ -167,6 +183,8 @@ jobs: env: CONFIG=DefaultDebug LINUX=debian-9 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh Build2 before_cache: @@ -180,6 +198,8 @@ jobs: env: CONFIG=DefaultRelease LINUX=debian-9 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh Build2 before_cache: @@ -193,6 +213,8 @@ jobs: env: CONFIG=DefaultDebugTravis LINUX=ubuntu-18.04 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh Build2 before_cache: @@ -206,6 +228,8 @@ jobs: env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-18.04 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh Build2 before_cache: @@ -219,6 +243,8 @@ jobs: env: CONFIG=DefaultDebug LINUX=ubuntu-18.04 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh Build2 before_cache: @@ -232,6 +258,8 @@ jobs: env: CONFIG=DefaultRelease LINUX=ubuntu-18.04 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh Build2 before_cache: @@ -250,6 +278,8 @@ jobs: env: CONFIG=DefaultDebug LINUX=debian-9 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh Build3 before_cache: @@ -263,6 +293,8 @@ jobs: env: CONFIG=DefaultRelease LINUX=debian-9 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh Build3 before_cache: @@ -276,6 +308,8 @@ jobs: env: CONFIG=DefaultDebugTravis LINUX=ubuntu-18.04 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh Build3 before_cache: @@ -289,6 +323,8 @@ jobs: env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-18.04 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh Build3 before_cache: @@ -302,6 +338,8 @@ jobs: env: CONFIG=DefaultDebug LINUX=ubuntu-18.04 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh Build3 before_cache: @@ -315,6 +353,8 @@ jobs: env: CONFIG=DefaultRelease LINUX=ubuntu-18.04 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh Build3 before_cache: @@ -333,6 +373,8 @@ jobs: env: CONFIG=DefaultDebug LINUX=debian-9 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh BuildLast before_cache: @@ -346,6 +388,8 @@ jobs: env: CONFIG=DefaultRelease LINUX=debian-9 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh BuildLast before_cache: @@ -359,6 +403,8 @@ jobs: env: CONFIG=DefaultDebugTravis LINUX=ubuntu-18.04 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh BuildLast before_cache: @@ -372,6 +418,8 @@ jobs: env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-18.04 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh BuildLast before_cache: @@ -385,6 +433,8 @@ jobs: env: CONFIG=DefaultDebug LINUX=ubuntu-18.04 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh BuildLast before_cache: @@ -398,6 +448,8 @@ jobs: env: CONFIG=DefaultRelease LINUX=ubuntu-18.04 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh BuildLast before_cache: @@ -416,6 +468,8 @@ jobs: env: CONFIG=DefaultDebug LINUX=debian-9 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh TestAll before_cache: @@ -429,6 +483,8 @@ jobs: env: CONFIG=DefaultRelease LINUX=debian-9 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh TestAll before_cache: @@ -442,6 +498,8 @@ jobs: env: CONFIG=DefaultDebugTravis LINUX=ubuntu-18.04 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh TestAll before_cache: @@ -459,6 +517,8 @@ jobs: env: CONFIG=DefaultReleaseTravis LINUX=ubuntu-18.04 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh TestAll before_cache: @@ -476,6 +536,8 @@ jobs: env: CONFIG=DefaultDebug LINUX=ubuntu-18.04 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh TestAll before_cache: @@ -489,6 +551,8 @@ jobs: env: CONFIG=DefaultRelease LINUX=ubuntu-18.04 COMPILER=gcc install: - travis/install_linux.sh + before_script: + - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode script: - travis/build.sh TestAll before_cache: diff --git a/travis/generate_travis.py b/travis/generate_travis.py index f7565c6bc..89483ba9e 100644 --- a/travis/generate_travis.py +++ b/travis/generate_travis.py @@ -91,6 +91,8 @@ if __name__ == "__main__": buildConfig += " env: CONFIG={} LINUX={} COMPILER={}\n".format(build_type, linux, compiler) buildConfig += " install:\n" buildConfig += " - travis/install_linux.sh\n" + buildConfig += " before_script:\n" + buildConfig += ' - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode\n' buildConfig += " script:\n" buildConfig += " - travis/build_carl.sh\n" # Upload to DockerHub @@ -129,6 +131,8 @@ if __name__ == "__main__": if stage[1] == "Build1": buildConfig += " - rm -rf build\n" buildConfig += " - travis/install_osx.sh\n" + buildConfig += " before_script:\n" + buildConfig += ' - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode\n' buildConfig += " script:\n" buildConfig += " - travis/build.sh {}\n".format(stage[1]) buildConfig += " after_failure:\n" @@ -154,6 +158,8 @@ if __name__ == "__main__": if stage[1] == "Build1": buildConfig += " - rm -rf build\n" buildConfig += " - travis/install_linux.sh\n" + buildConfig += " before_script:\n" + buildConfig += ' - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" # Workaround for nonblocking mode\n' buildConfig += " script:\n" buildConfig += " - travis/build.sh {}\n".format(stage[1]) buildConfig += " before_cache:\n"