Skip to content

Semicolon doesn't stop on error with cmake or make  #6022

Closed

Description

@apmanol

Describe the bug

With cmake or make and a semicolon` doesn't understand the error and continues.

test/build on  master [!+?] via △ v3.20.5 on ☁️   
❯ make all ; echo done 
Consolidate compiler generated dependencies of target test.x
[ 50%] Building CXX object CMakeFiles/test.x.dir/test.cpp.o
/tmp/test/test.cpp: In function ‘int main(int, char**)’:
/tmp/test/test.cpp:3:3: error: invalid use of ‘this’ in non-member function
    3 |   this is an error
      |   ^~~~
make[2]: *** [CMakeFiles/test.x.dir/build.make:76: CMakeFiles/test.x.dir/test.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/test.x.dir/all] Error 2
make: *** [Makefile:91: all] Error 2
done

How to reproduce

CMakeLists.txt:

project(test LANGUAGES CXX)
cmake_minimum_required(VERSION 3.18)

add_executable(test.x test.cpp)

test.cpp

int main(int argc, char *argv[])
{
  this is an error 
  return 0;
}
cmake -H. -Bbuild
cmake --build build --target all;echo done
/tmp/test/test.cpp: In function ‘int main(int, char**)’:
/tmp/test/test.cpp:3:3: error: invalid use of ‘this’ in non-member function
    3 |   this is an error
      |   ^~~~
gmake[2]: *** [CMakeFiles/test.x.dir/build.make:76: CMakeFiles/test.x.dir/test.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:83: CMakeFiles/test.x.dir/all] Error 2
gmake: *** [Makefile:91: all] Error 2
done    

Expected behavior

Shouldn't reach the done

Screenshots

No response

Configuration

❯ version | transpose key value | to md --pretty

key value
version 0.65.0
branch master
commit_hash
build_os linux-x86_64
build_target x86_64-unknown-linux-gnu
rust_version rustc 1.62.0 (a8314ef7d 2022-06-27)
rust_channel stable-x86_64-unknown-linux-gnu
cargo_version cargo 1.62.0 (a748cf5a3 2022-06-08)
pkg_version 0.65.0
build_time 2022-07-12 15:42:33 +03:00
build_rust_channel release
features default, trash, which, zip
installed_plugins

Additional context

No response

Activity

  1. added
    category:bug
    on Jul 12, 2022
  2. fdncred commented on Jul 12, 2022

    @fdncred
    Contributor

    I've seen this reported a few times. It wouldn't surprise me if there were another issue or 10 like this now.

  3. apmanol commented on Jul 12, 2022

    @apmanol
    Author

    I did some history research and only related was #1619 or #4139

    It's bash classic usage &&

  4. added this to the v0.66.0 milestone on Jul 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    category:bug

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions