Skip to content

Commit

Permalink
Meta+CMake: Remove "image" ninja target in favor of "qemu-image"
Browse files Browse the repository at this point in the history
"image" was an alias for "qemu-image".

I want to add an `image` userland utility, which clashes with that
shortname.

So remove the existing "image" target. It was just an alias for
"qemu-image".

If you use serenity.sh to build, nothing changes. This only affects you
if you run ninja manually -- you now have to say `ninja qemu-image` to
build the disk image.
  • Loading branch information
nico authored and linusg committed Mar 12, 2023
1 parent 952222e commit 3cff36b
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 10 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ jobs:
- name: Create Serenity Rootfs
if: ${{ matrix.debug-options == 'NORMAL_DEBUG'}}
working-directory: ${{ github.workspace }}/Build/${{ matrix.arch }}
run: ninja install && ninja image
run: ninja install && ninja qemu-image

- name: Run On-Target Tests
if: ${{ matrix.debug-options == 'NORMAL_DEBUG'}}
Expand Down Expand Up @@ -236,6 +236,6 @@ jobs:
run: |
# Running the tests apparently leaves the image sufficiently broken
rm _disk_image
ninja image
ninja qemu-image
/usr/bin/time ../../Meta/export-argsparser-manpages.sh --verify-git-state
timeout-minutes: 10
6 changes: 1 addition & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,11 @@ add_custom_target(run
# out forcing re-builds when they might not want them.
add_custom_target(setup-and-run
COMMAND ${CMAKE_MAKE_PROGRAM} install
COMMAND ${CMAKE_MAKE_PROGRAM} image
COMMAND ${CMAKE_MAKE_PROGRAM} qemu-image
COMMAND ${CMAKE_MAKE_PROGRAM} run
USES_TERMINAL
)

add_custom_target(image
DEPENDS qemu-image
)

add_custom_target(qemu-image
COMMAND "${CMAKE_COMMAND}" -E env "SERENITY_SOURCE_DIR=${SerenityOS_SOURCE_DIR}" "SERENITY_ARCH=${SERENITY_ARCH}" "SERENITY_TOOLCHAIN=${CMAKE_CXX_COMPILER_ID}" "LLVM_VERSION=${CMAKE_CXX_COMPILER_VERSION}" "${SerenityOS_SOURCE_DIR}/Meta/build-image-qemu.sh"
BYPRODUCTS "${CMAKE_BINARY_DIR}/_disk_image"
Expand Down
2 changes: 1 addition & 1 deletion Documentation/RunningTests.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ For completeness, a basic on-target test run will need the SerenityOS image buil
cmake -GNinja -S Meta/CMake/Superbuild -B Build/superbuild-x86_64
cmake --build Build/superbuild-x86_64
cd Build/x86_64
ninja install && ninja image && ninja run
ninja install && ninja qemu-image && ninja run
```

In the initial terminal, one can easily run the test runner script:
Expand Down
2 changes: 1 addition & 1 deletion Meta/Azure/Serenity.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ jobs:
CCACHE_DIR: '$(SERENITY_CCACHE_DIR)'
- script: |
ninja install && ninja image
ninja install && ninja qemu-image
displayName: 'Create RootFS'
workingDirectory: $(Build.SourcesDirectory)/Build/${{ parameters.arch }}clang
Expand Down
2 changes: 1 addition & 1 deletion Meta/serenity.sh
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ build_image() {
if [ "$SERENITY_RUN" = "limine" ]; then
build_target limine-image
else
build_target image
build_target qemu-image
fi
}

Expand Down

0 comments on commit 3cff36b

Please sign in to comment.