This add a workflow which is a wrapper to the cmake/ninja build.
This will later be used as a preliminary step to arc unit.
Argument (optional):
- targets: specify which Ninja target to build.
Differential D2792
Add a build command to arcanist Fabien on Apr 10 2019, 12:05. Authored by
Details This add a workflow which is a wrapper to the cmake/ninja build. Argument (optional):
Initial state: a clean project tree. arc build Should output: OKAY Build is successful (<build duration>) WHICH_CMAKE=`which cmake` sudo mv "${WHICH_CMAKE}" "${WHICH_CMAKE}.broken" arc build Should output: FAILED The `cmake` command is required to run `arc build`. Please install CMake (https://cmake.org) then run `arc build` again. sudo mv "${WHICH_CMAKE}.broken" "${WHICH_CMAKE}" WHICH_NINJA=`which ninja` sudo mv "${WHICH_NINJA}" "${WHICH_NINJA}.broken" arc build Should output: FAILED The `ninja` command is required to run `arc build`. Please install Ninja (https://ninja-build.org) hen run `arc build` again. sudo mv "${WHICH_NINJA}.broken" "${WHICH_NINJA}" mv .arcbuild .arcbuild.bak arc build Should output: FAILED Unable to find the `.arcbuild` configuration file. Please create the file at the root of the project. mv .arcbuild.bak .arcbuild sed -i "s/build/dliub/g" .arcbuild arc build Should output: FAILED No build directory is configured. Set the `build_directory` option in your `.arcbuild` configuration file and run `arc build` again. sed -i "s/dliub/build\"/g" .arcbuild arc build Should output: FAILED The `.arcbuild` file is not a valid JSON file, please check for syntax errors. sed -i "s/build\"/build/g" .arcbuild mkdir build-arcanist chmod -w . arc build Should output: FAILED The build directory </path/to/build-arcanist> already exists and cannot be deleted. Please check the permissions or delete it manually then run `arc build` again. chmod +w . rm -rf build-arcanist chmod -w . arc build Should output: FAILED Unable to create the build directory: /home/fabien/bitcoin-abc/build-arcanist. Check you have write permissions to the parent directory and run `arc build` again. chmod +w . Comment the line include(AddCompilerFlags) in the src/CMakeLists.txt file. arc build Should output: FAILED Build failed ! Uncomment the previously commented line. Comment the line #include "init.h" in the src/init.cpp file. arc build Should output: FAILED Build failed ! Uncomment the previously commented line. arc build --trace test_bitcoin Should output: OKAY Build is successful (<build duration>) Check in the trace that the test_bitcoin target is passed to ninja. Change the build directory in .arcbuild to your project root (try absolute, relative "" and "." paths). arc build Should output: FAILED The build directory is set to the project root: </path/to/project/root>. The directory is removed after the build, please set it to something else.
Diff Detail
Event Timeline
Comment Actions The goal is not to replace a build system. You don't need 25 configs or special cases. the goal is to provide a way for arc to build to it can run unit tests. The more configuration this has, the more complex the rest of the pipeline will be and there are really no good reasons to go that road. If things needs to be cleared and otherwise managed, then this fails. If this is running in the same build dir I'm working in then you have no control over the build parameters. The build workflow is using command but do not checks that these command are effectively usable, which will lead to people doing arc build and getting an error about ninja not found which makes no sense to them.
Comment Actions Rebase and add some more checks. Comment Actions Back on your queue. This would not serve much of a purpose before cmake build works anyways. |