From 500505cde66c3b0bb0f6adf318b9820da4d74d66 Mon Sep 17 00:00:00 2001 From: Sergey Vinokurov Date: Wed, 18 Jun 2025 09:46:49 +0100 Subject: [PATCH 01/18] Add test --- .../PreProcess/TooManyCommandLineArgs/Foo.hsc | 99 +++++++++++++++++++ .../PreProcess/TooManyCommandLineArgs/Main.hs | 6 ++ .../TooManyCommandLineArgs/cabal.project | 34 +++++++ .../deps/my-dep-dep01/FooDepDep01.hs | 4 + .../include/include_FooDepDep01.h | 1 + .../my-dep-dep01/lib/libdummy-unused-lib.a | 0 .../deps/my-dep-dep01/my-dep-dep01.cabal | 10 ++ .../deps/my-dep-dep02/FooDepDep02.hs | 4 + .../include/include_FooDepDep02.h | 1 + .../my-dep-dep02/lib/libdummy-unused-lib.a | 0 .../deps/my-dep-dep02/my-dep-dep02.cabal | 10 ++ .../deps/my-dep-dep03/FooDepDep03.hs | 4 + .../include/include_FooDepDep03.h | 1 + .../my-dep-dep03/lib/libdummy-unused-lib.a | 0 .../deps/my-dep-dep03/my-dep-dep03.cabal | 10 ++ .../deps/my-dep-dep04/FooDepDep04.hs | 4 + .../include/include_FooDepDep04.h | 1 + .../my-dep-dep04/lib/libdummy-unused-lib.a | 0 .../deps/my-dep-dep04/my-dep-dep04.cabal | 10 ++ .../deps/my-dep-dep05/FooDepDep05.hs | 4 + .../include/include_FooDepDep05.h | 1 + .../my-dep-dep05/lib/libdummy-unused-lib.a | 0 .../deps/my-dep-dep05/my-dep-dep05.cabal | 10 ++ .../deps/my-dep-dep06/FooDepDep06.hs | 4 + .../include/include_FooDepDep06.h | 1 + .../my-dep-dep06/lib/libdummy-unused-lib.a | 0 .../deps/my-dep-dep06/my-dep-dep06.cabal | 10 ++ .../deps/my-dep-dep07/FooDepDep07.hs | 4 + .../include/include_FooDepDep07.h | 1 + .../my-dep-dep07/lib/libdummy-unused-lib.a | 0 .../deps/my-dep-dep07/my-dep-dep07.cabal | 10 ++ .../deps/my-dep-dep08/FooDepDep08.hs | 4 + .../include/include_FooDepDep08.h | 1 + .../my-dep-dep08/lib/libdummy-unused-lib.a | 0 .../deps/my-dep-dep08/my-dep-dep08.cabal | 10 ++ .../deps/my-dep-dep09/FooDepDep09.hs | 4 + .../include/include_FooDepDep09.h | 1 + .../my-dep-dep09/lib/libdummy-unused-lib.a | 0 .../deps/my-dep-dep09/my-dep-dep09.cabal | 10 ++ .../deps/my-dep-dep10/FooDepDep10.hs | 4 + .../include/include_FooDepDep10.h | 1 + .../my-dep-dep10/lib/libdummy-unused-lib.a | 0 .../deps/my-dep-dep10/my-dep-dep10.cabal | 10 ++ .../deps/my-dep01/FooDep01.hs | 27 +++++ .../deps/my-dep01/include/include_FooDep01.h | 1 + .../deps/my-dep01/lib/libdummy-unused-lib.a | 0 .../deps/my-dep01/my-dep01.cabal | 21 ++++ .../deps/my-dep02/FooDep02.hs | 27 +++++ .../deps/my-dep02/include/include_FooDep02.h | 1 + .../deps/my-dep02/lib/libdummy-unused-lib.a | 0 .../deps/my-dep02/my-dep02.cabal | 21 ++++ .../deps/my-dep03/FooDep03.hs | 27 +++++ .../deps/my-dep03/include/include_FooDep03.h | 1 + .../deps/my-dep03/lib/libdummy-unused-lib.a | 0 .../deps/my-dep03/my-dep03.cabal | 21 ++++ .../deps/my-dep04/FooDep04.hs | 27 +++++ .../deps/my-dep04/include/include_FooDep04.h | 1 + .../deps/my-dep04/lib/libdummy-unused-lib.a | 0 .../deps/my-dep04/my-dep04.cabal | 21 ++++ .../deps/my-dep05/FooDep05.hs | 27 +++++ .../deps/my-dep05/include/include_FooDep05.h | 1 + .../deps/my-dep05/lib/libdummy-unused-lib.a | 0 .../deps/my-dep05/my-dep05.cabal | 21 ++++ .../deps/my-dep06/FooDep06.hs | 27 +++++ .../deps/my-dep06/include/include_FooDep06.h | 1 + .../deps/my-dep06/lib/libdummy-unused-lib.a | 0 .../deps/my-dep06/my-dep06.cabal | 21 ++++ .../deps/my-dep07/FooDep07.hs | 27 +++++ .../deps/my-dep07/include/include_FooDep07.h | 1 + .../deps/my-dep07/lib/libdummy-unused-lib.a | 0 .../deps/my-dep07/my-dep07.cabal | 21 ++++ .../deps/my-dep08/FooDep08.hs | 27 +++++ .../deps/my-dep08/include/include_FooDep08.h | 1 + .../deps/my-dep08/lib/libdummy-unused-lib.a | 0 .../deps/my-dep08/my-dep08.cabal | 21 ++++ .../deps/my-dep09/FooDep09.hs | 27 +++++ .../deps/my-dep09/include/include_FooDep09.h | 1 + .../deps/my-dep09/lib/libdummy-unused-lib.a | 0 .../deps/my-dep09/my-dep09.cabal | 21 ++++ .../deps/my-dep10/FooDep10.hs | 27 +++++ .../deps/my-dep10/include/include_FooDep10.h | 1 + .../deps/my-dep10/lib/libdummy-unused-lib.a | 0 .../deps/my-dep10/my-dep10.cabal | 21 ++++ .../TooManyCommandLineArgs/deps/my01/Foo01.hs | 27 +++++ .../deps/my01/include/include_Foo01.h | 1 + .../deps/my01/lib/libdummy-unused-lib.a | 0 .../deps/my01/my01.cabal | 21 ++++ .../TooManyCommandLineArgs/deps/my02/Foo02.hs | 27 +++++ .../deps/my02/include/include_Foo02.h | 1 + .../deps/my02/lib/libdummy-unused-lib.a | 0 .../deps/my02/my02.cabal | 21 ++++ .../TooManyCommandLineArgs/deps/my03/Foo03.hs | 27 +++++ .../deps/my03/include/include_Foo03.h | 1 + .../deps/my03/lib/libdummy-unused-lib.a | 0 .../deps/my03/my03.cabal | 21 ++++ .../TooManyCommandLineArgs/deps/my04/Foo04.hs | 27 +++++ .../deps/my04/include/include_Foo04.h | 1 + .../deps/my04/lib/libdummy-unused-lib.a | 0 .../deps/my04/my04.cabal | 21 ++++ .../TooManyCommandLineArgs/deps/my05/Foo05.hs | 27 +++++ .../deps/my05/include/include_Foo05.h | 1 + .../deps/my05/lib/libdummy-unused-lib.a | 0 .../deps/my05/my05.cabal | 21 ++++ .../TooManyCommandLineArgs/deps/my06/Foo06.hs | 27 +++++ .../deps/my06/include/include_Foo06.h | 1 + .../deps/my06/lib/libdummy-unused-lib.a | 0 .../deps/my06/my06.cabal | 21 ++++ .../TooManyCommandLineArgs/deps/my07/Foo07.hs | 27 +++++ .../deps/my07/include/include_Foo07.h | 1 + .../deps/my07/lib/libdummy-unused-lib.a | 0 .../deps/my07/my07.cabal | 21 ++++ .../TooManyCommandLineArgs/deps/my08/Foo08.hs | 27 +++++ .../deps/my08/include/include_Foo08.h | 1 + .../deps/my08/lib/libdummy-unused-lib.a | 0 .../deps/my08/my08.cabal | 21 ++++ .../TooManyCommandLineArgs/deps/my09/Foo09.hs | 27 +++++ .../deps/my09/include/include_Foo09.h | 1 + .../deps/my09/lib/libdummy-unused-lib.a | 0 .../deps/my09/my09.cabal | 21 ++++ .../TooManyCommandLineArgs/deps/my10/Foo10.hs | 27 +++++ .../deps/my10/include/include_Foo10.h | 1 + .../deps/my10/lib/libdummy-unused-lib.a | 0 .../deps/my10/my10.cabal | 21 ++++ .../TooManyCommandLineArgs/my-toplevel.cabal | 33 +++++++ .../TooManyCommandLineArgs/setup.out | 2 + .../TooManyCommandLineArgs/setup.test.hs | 96 ++++++++++++++++++ 126 files changed, 1400 insertions(+) create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/Foo.hsc create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/Main.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/cabal.project create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/FooDepDep01.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/include/include_FooDepDep01.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/my-dep-dep01.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/FooDepDep02.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/include/include_FooDepDep02.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/my-dep-dep02.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/FooDepDep03.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/include/include_FooDepDep03.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/my-dep-dep03.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/FooDepDep04.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/include/include_FooDepDep04.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/my-dep-dep04.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/FooDepDep05.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/include/include_FooDepDep05.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/my-dep-dep05.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/FooDepDep06.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/include/include_FooDepDep06.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/my-dep-dep06.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/FooDepDep07.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/include/include_FooDepDep07.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/my-dep-dep07.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/FooDepDep08.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/include/include_FooDepDep08.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/my-dep-dep08.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/FooDepDep09.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/include/include_FooDepDep09.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/my-dep-dep09.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/FooDepDep10.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/include/include_FooDepDep10.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/my-dep-dep10.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/FooDep01.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/include/include_FooDep01.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/my-dep01.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/FooDep02.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/include/include_FooDep02.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/my-dep02.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/FooDep03.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/include/include_FooDep03.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/my-dep03.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/FooDep04.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/include/include_FooDep04.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/my-dep04.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/FooDep05.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/include/include_FooDep05.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/my-dep05.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/FooDep06.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/include/include_FooDep06.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/my-dep06.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/FooDep07.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/include/include_FooDep07.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/my-dep07.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/FooDep08.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/include/include_FooDep08.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/my-dep08.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/FooDep09.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/include/include_FooDep09.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/my-dep09.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/FooDep10.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/include/include_FooDep10.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/my-dep10.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/Foo01.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/include/include_Foo01.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/my01.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/Foo02.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/include/include_Foo02.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/my02.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/Foo03.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/include/include_Foo03.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/my03.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/Foo04.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/include/include_Foo04.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/my04.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/Foo05.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/include/include_Foo05.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/my05.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/Foo06.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/include/include_Foo06.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/my06.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/Foo07.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/include/include_Foo07.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/my07.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/Foo08.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/include/include_Foo08.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/my08.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/Foo09.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/include/include_Foo09.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/my09.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/Foo10.hs create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/include/include_Foo10.h create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/lib/libdummy-unused-lib.a create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/my10.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/my-toplevel.cabal create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/setup.out create mode 100644 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/setup.test.hs diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/Foo.hsc b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/Foo.hsc new file mode 100644 index 00000000000..d1e0418a5e8 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/Foo.hsc @@ -0,0 +1,99 @@ +-- | +-- Module: Foo +-- Copyright: (c) Sergey Vinokurov 2025 +-- License: Apache-2.0 (see LICENSE) +-- Maintainer: serg.foo@gmail.com + +{-# LANGUAGE CPP #-} + +module Foo (foo) where + +import Foo01 +import Foo02 +import Foo03 +import Foo04 +import Foo05 +import Foo06 +import Foo07 +import Foo08 +import Foo09 +import Foo10 + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +foo :: Int +foo = sum + [ #{const TEST_OPTION} + , foo01 + , foo02 + , foo03 + , foo04 + , foo05 + , foo06 + , foo07 + , foo08 + , foo09 + , foo10 + + , #{const DEF_foo01} + , #{const DEF_foo02} + , #{const DEF_foo03} + , #{const DEF_foo04} + , #{const DEF_foo05} + , #{const DEF_foo06} + , #{const DEF_foo07} + , #{const DEF_foo08} + , #{const DEF_foo09} + , #{const DEF_foo10} + + , #{const DEF_fooDep01} + , #{const DEF_fooDep02} + , #{const DEF_fooDep03} + , #{const DEF_fooDep04} + , #{const DEF_fooDep05} + , #{const DEF_fooDep06} + , #{const DEF_fooDep07} + , #{const DEF_fooDep08} + , #{const DEF_fooDep09} + , #{const DEF_fooDep10} + + , #{const DEF_fooDepDep01} + , #{const DEF_fooDepDep02} + , #{const DEF_fooDepDep03} + , #{const DEF_fooDepDep04} + , #{const DEF_fooDepDep05} + , #{const DEF_fooDepDep06} + , #{const DEF_fooDepDep07} + , #{const DEF_fooDepDep08} + , #{const DEF_fooDepDep09} + , #{const DEF_fooDepDep10} + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/Main.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/Main.hs new file mode 100644 index 00000000000..fb4e301094d --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/Main.hs @@ -0,0 +1,6 @@ +module Main (main) where + +import Foo + +main :: IO () +main = putStrLn $ "Result = " ++ show foo diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/cabal.project b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/cabal.project new file mode 100644 index 00000000000..004271c651b --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/cabal.project @@ -0,0 +1,34 @@ +packages: + my-toplevel.cabal + deps/my01/my01.cabal + deps/my02/my02.cabal + deps/my03/my03.cabal + deps/my04/my04.cabal + deps/my05/my05.cabal + deps/my06/my06.cabal + deps/my07/my07.cabal + deps/my08/my08.cabal + deps/my09/my09.cabal + deps/my10/my10.cabal + + deps/my-dep01/my-dep01.cabal + deps/my-dep02/my-dep02.cabal + deps/my-dep03/my-dep03.cabal + deps/my-dep04/my-dep04.cabal + deps/my-dep05/my-dep05.cabal + deps/my-dep06/my-dep06.cabal + deps/my-dep07/my-dep07.cabal + deps/my-dep08/my-dep08.cabal + deps/my-dep09/my-dep09.cabal + deps/my-dep10/my-dep10.cabal + + deps/my-dep-dep01/my-dep-dep01.cabal + deps/my-dep-dep02/my-dep-dep02.cabal + deps/my-dep-dep03/my-dep-dep03.cabal + deps/my-dep-dep04/my-dep-dep04.cabal + deps/my-dep-dep05/my-dep-dep05.cabal + deps/my-dep-dep06/my-dep-dep06.cabal + deps/my-dep-dep07/my-dep-dep07.cabal + deps/my-dep-dep08/my-dep-dep08.cabal + deps/my-dep-dep09/my-dep-dep09.cabal + deps/my-dep-dep10/my-dep-dep10.cabal diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/FooDepDep01.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/FooDepDep01.hs new file mode 100644 index 00000000000..9e6837fb409 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/FooDepDep01.hs @@ -0,0 +1,4 @@ +module FooDepDep01 (fooDepDep01) where + +fooDepDep01 :: Int +fooDepDep01 = 01 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/include/include_FooDepDep01.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/include/include_FooDepDep01.h new file mode 100644 index 00000000000..1e2a0c2d3fd --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/include/include_FooDepDep01.h @@ -0,0 +1 @@ +#define DEF_fooDepDep01 1 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/my-dep-dep01.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/my-dep-dep01.cabal new file mode 100644 index 00000000000..075c6dadcf6 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep01/my-dep-dep01.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.0 +name: my-dep-dep01 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDepDep01 + default-language: Haskell2010 + build-depends: base diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/FooDepDep02.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/FooDepDep02.hs new file mode 100644 index 00000000000..564798ff0e7 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/FooDepDep02.hs @@ -0,0 +1,4 @@ +module FooDepDep02 (fooDepDep02) where + +fooDepDep02 :: Int +fooDepDep02 = 02 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/include/include_FooDepDep02.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/include/include_FooDepDep02.h new file mode 100644 index 00000000000..a05f788abf5 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/include/include_FooDepDep02.h @@ -0,0 +1 @@ +#define DEF_fooDepDep02 2 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/my-dep-dep02.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/my-dep-dep02.cabal new file mode 100644 index 00000000000..a21e8fa002f --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep02/my-dep-dep02.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.0 +name: my-dep-dep02 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDepDep02 + default-language: Haskell2010 + build-depends: base diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/FooDepDep03.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/FooDepDep03.hs new file mode 100644 index 00000000000..90d7ab99948 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/FooDepDep03.hs @@ -0,0 +1,4 @@ +module FooDepDep03 (fooDepDep03) where + +fooDepDep03 :: Int +fooDepDep03 = 03 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/include/include_FooDepDep03.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/include/include_FooDepDep03.h new file mode 100644 index 00000000000..716d517d278 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/include/include_FooDepDep03.h @@ -0,0 +1 @@ +#define DEF_fooDepDep03 3 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/my-dep-dep03.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/my-dep-dep03.cabal new file mode 100644 index 00000000000..84b24170e2a --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep03/my-dep-dep03.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.0 +name: my-dep-dep03 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDepDep03 + default-language: Haskell2010 + build-depends: base diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/FooDepDep04.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/FooDepDep04.hs new file mode 100644 index 00000000000..9101849a9c6 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/FooDepDep04.hs @@ -0,0 +1,4 @@ +module FooDepDep04 (fooDepDep04) where + +fooDepDep04 :: Int +fooDepDep04 = 04 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/include/include_FooDepDep04.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/include/include_FooDepDep04.h new file mode 100644 index 00000000000..79fd9374863 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/include/include_FooDepDep04.h @@ -0,0 +1 @@ +#define DEF_fooDepDep04 4 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/my-dep-dep04.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/my-dep-dep04.cabal new file mode 100644 index 00000000000..9617302f33b --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep04/my-dep-dep04.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.0 +name: my-dep-dep04 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDepDep04 + default-language: Haskell2010 + build-depends: base diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/FooDepDep05.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/FooDepDep05.hs new file mode 100644 index 00000000000..1e0a4cf206f --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/FooDepDep05.hs @@ -0,0 +1,4 @@ +module FooDepDep05 (fooDepDep05) where + +fooDepDep05 :: Int +fooDepDep05 = 05 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/include/include_FooDepDep05.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/include/include_FooDepDep05.h new file mode 100644 index 00000000000..2f305c8d829 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/include/include_FooDepDep05.h @@ -0,0 +1 @@ +#define DEF_fooDepDep05 5 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/my-dep-dep05.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/my-dep-dep05.cabal new file mode 100644 index 00000000000..18a94b86684 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep05/my-dep-dep05.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.0 +name: my-dep-dep05 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDepDep05 + default-language: Haskell2010 + build-depends: base diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/FooDepDep06.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/FooDepDep06.hs new file mode 100644 index 00000000000..50b2b0d3f0f --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/FooDepDep06.hs @@ -0,0 +1,4 @@ +module FooDepDep06 (fooDepDep06) where + +fooDepDep06 :: Int +fooDepDep06 = 06 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/include/include_FooDepDep06.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/include/include_FooDepDep06.h new file mode 100644 index 00000000000..a005ad17115 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/include/include_FooDepDep06.h @@ -0,0 +1 @@ +#define DEF_fooDepDep06 6 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/my-dep-dep06.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/my-dep-dep06.cabal new file mode 100644 index 00000000000..492161e6751 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep06/my-dep-dep06.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.0 +name: my-dep-dep06 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDepDep06 + default-language: Haskell2010 + build-depends: base diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/FooDepDep07.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/FooDepDep07.hs new file mode 100644 index 00000000000..4ee00b0d8e9 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/FooDepDep07.hs @@ -0,0 +1,4 @@ +module FooDepDep07 (fooDepDep07) where + +fooDepDep07 :: Int +fooDepDep07 = 07 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/include/include_FooDepDep07.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/include/include_FooDepDep07.h new file mode 100644 index 00000000000..cd4d9c62a90 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/include/include_FooDepDep07.h @@ -0,0 +1 @@ +#define DEF_fooDepDep07 7 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/my-dep-dep07.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/my-dep-dep07.cabal new file mode 100644 index 00000000000..d5e129e224d --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep07/my-dep-dep07.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.0 +name: my-dep-dep07 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDepDep07 + default-language: Haskell2010 + build-depends: base diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/FooDepDep08.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/FooDepDep08.hs new file mode 100644 index 00000000000..bff75a8857e --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/FooDepDep08.hs @@ -0,0 +1,4 @@ +module FooDepDep08 (fooDepDep08) where + +fooDepDep08 :: Int +fooDepDep08 = 08 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/include/include_FooDepDep08.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/include/include_FooDepDep08.h new file mode 100644 index 00000000000..1a81f6ecc2c --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/include/include_FooDepDep08.h @@ -0,0 +1 @@ +#define DEF_fooDepDep08 8 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/my-dep-dep08.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/my-dep-dep08.cabal new file mode 100644 index 00000000000..5070df765be --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep08/my-dep-dep08.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.0 +name: my-dep-dep08 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDepDep08 + default-language: Haskell2010 + build-depends: base diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/FooDepDep09.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/FooDepDep09.hs new file mode 100644 index 00000000000..df01fa36f21 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/FooDepDep09.hs @@ -0,0 +1,4 @@ +module FooDepDep09 (fooDepDep09) where + +fooDepDep09 :: Int +fooDepDep09 = 09 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/include/include_FooDepDep09.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/include/include_FooDepDep09.h new file mode 100644 index 00000000000..7e009d23532 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/include/include_FooDepDep09.h @@ -0,0 +1 @@ +#define DEF_fooDepDep09 9 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/my-dep-dep09.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/my-dep-dep09.cabal new file mode 100644 index 00000000000..e8ca1a6f25b --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep09/my-dep-dep09.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.0 +name: my-dep-dep09 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDepDep09 + default-language: Haskell2010 + build-depends: base diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/FooDepDep10.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/FooDepDep10.hs new file mode 100644 index 00000000000..f2230e5ad60 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/FooDepDep10.hs @@ -0,0 +1,4 @@ +module FooDepDep10 (fooDepDep10) where + +fooDepDep10 :: Int +fooDepDep10 = 10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/include/include_FooDepDep10.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/include/include_FooDepDep10.h new file mode 100644 index 00000000000..94ec0123768 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/include/include_FooDepDep10.h @@ -0,0 +1 @@ +#define DEF_fooDepDep10 10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/my-dep-dep10.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/my-dep-dep10.cabal new file mode 100644 index 00000000000..fc873543421 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep-dep10/my-dep-dep10.cabal @@ -0,0 +1,10 @@ +cabal-version: 3.0 +name: my-dep-dep10 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDepDep10 + default-language: Haskell2010 + build-depends: base diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/FooDep01.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/FooDep01.hs new file mode 100644 index 00000000000..4f4e5022a05 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/FooDep01.hs @@ -0,0 +1,27 @@ +module FooDep01 (fooDep01) where + +import FooDepDep01 +import FooDepDep02 +import FooDepDep03 +import FooDepDep04 +import FooDepDep05 +import FooDepDep06 +import FooDepDep07 +import FooDepDep08 +import FooDepDep09 +import FooDepDep10 + +fooDep01 :: Int +fooDep01 = sum + [ 01 + , fooDepDep01 + , fooDepDep02 + , fooDepDep03 + , fooDepDep04 + , fooDepDep05 + , fooDepDep06 + , fooDepDep07 + , fooDepDep08 + , fooDepDep09 + , fooDepDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/include/include_FooDep01.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/include/include_FooDep01.h new file mode 100644 index 00000000000..a2beee766db --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/include/include_FooDep01.h @@ -0,0 +1 @@ +#define DEF_fooDep01 1 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/my-dep01.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/my-dep01.cabal new file mode 100644 index 00000000000..04f1112df0d --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep01/my-dep01.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my-dep01 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDep01 + default-language: Haskell2010 + build-depends: + , base + , my-dep-dep01 + , my-dep-dep02 + , my-dep-dep03 + , my-dep-dep04 + , my-dep-dep05 + , my-dep-dep06 + , my-dep-dep07 + , my-dep-dep08 + , my-dep-dep09 + , my-dep-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/FooDep02.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/FooDep02.hs new file mode 100644 index 00000000000..d3768a947dd --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/FooDep02.hs @@ -0,0 +1,27 @@ +module FooDep02 (fooDep02) where + +import FooDepDep01 +import FooDepDep02 +import FooDepDep03 +import FooDepDep04 +import FooDepDep05 +import FooDepDep06 +import FooDepDep07 +import FooDepDep08 +import FooDepDep09 +import FooDepDep10 + +fooDep02 :: Int +fooDep02 = sum + [ 02 + , fooDepDep01 + , fooDepDep02 + , fooDepDep03 + , fooDepDep04 + , fooDepDep05 + , fooDepDep06 + , fooDepDep07 + , fooDepDep08 + , fooDepDep09 + , fooDepDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/include/include_FooDep02.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/include/include_FooDep02.h new file mode 100644 index 00000000000..26bb3371de3 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/include/include_FooDep02.h @@ -0,0 +1 @@ +#define DEF_fooDep02 2 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/my-dep02.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/my-dep02.cabal new file mode 100644 index 00000000000..7c5050f6804 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep02/my-dep02.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my-dep02 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDep02 + default-language: Haskell2010 + build-depends: + , base + , my-dep-dep01 + , my-dep-dep02 + , my-dep-dep03 + , my-dep-dep04 + , my-dep-dep05 + , my-dep-dep06 + , my-dep-dep07 + , my-dep-dep08 + , my-dep-dep09 + , my-dep-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/FooDep03.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/FooDep03.hs new file mode 100644 index 00000000000..0e05fcb1662 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/FooDep03.hs @@ -0,0 +1,27 @@ +module FooDep03 (fooDep03) where + +import FooDepDep01 +import FooDepDep02 +import FooDepDep03 +import FooDepDep04 +import FooDepDep05 +import FooDepDep06 +import FooDepDep07 +import FooDepDep08 +import FooDepDep09 +import FooDepDep10 + +fooDep03 :: Int +fooDep03 = sum + [ 03 + , fooDepDep01 + , fooDepDep02 + , fooDepDep03 + , fooDepDep04 + , fooDepDep05 + , fooDepDep06 + , fooDepDep07 + , fooDepDep08 + , fooDepDep09 + , fooDepDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/include/include_FooDep03.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/include/include_FooDep03.h new file mode 100644 index 00000000000..400b14465ba --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/include/include_FooDep03.h @@ -0,0 +1 @@ +#define DEF_fooDep03 3 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/my-dep03.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/my-dep03.cabal new file mode 100644 index 00000000000..fca04e84901 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep03/my-dep03.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my-dep03 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDep03 + default-language: Haskell2010 + build-depends: + , base + , my-dep-dep01 + , my-dep-dep02 + , my-dep-dep03 + , my-dep-dep04 + , my-dep-dep05 + , my-dep-dep06 + , my-dep-dep07 + , my-dep-dep08 + , my-dep-dep09 + , my-dep-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/FooDep04.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/FooDep04.hs new file mode 100644 index 00000000000..99ad7dd90ba --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/FooDep04.hs @@ -0,0 +1,27 @@ +module FooDep04 (fooDep04) where + +import FooDepDep01 +import FooDepDep02 +import FooDepDep03 +import FooDepDep04 +import FooDepDep05 +import FooDepDep06 +import FooDepDep07 +import FooDepDep08 +import FooDepDep09 +import FooDepDep10 + +fooDep04 :: Int +fooDep04 = sum + [ 04 + , fooDepDep01 + , fooDepDep02 + , fooDepDep03 + , fooDepDep04 + , fooDepDep05 + , fooDepDep06 + , fooDepDep07 + , fooDepDep08 + , fooDepDep09 + , fooDepDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/include/include_FooDep04.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/include/include_FooDep04.h new file mode 100644 index 00000000000..705321a768a --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/include/include_FooDep04.h @@ -0,0 +1 @@ +#define DEF_fooDep04 4 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/my-dep04.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/my-dep04.cabal new file mode 100644 index 00000000000..0443c45392b --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep04/my-dep04.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my-dep04 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDep04 + default-language: Haskell2010 + build-depends: + , base + , my-dep-dep01 + , my-dep-dep02 + , my-dep-dep03 + , my-dep-dep04 + , my-dep-dep05 + , my-dep-dep06 + , my-dep-dep07 + , my-dep-dep08 + , my-dep-dep09 + , my-dep-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/FooDep05.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/FooDep05.hs new file mode 100644 index 00000000000..ba763dc729f --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/FooDep05.hs @@ -0,0 +1,27 @@ +module FooDep05 (fooDep05) where + +import FooDepDep01 +import FooDepDep02 +import FooDepDep03 +import FooDepDep04 +import FooDepDep05 +import FooDepDep06 +import FooDepDep07 +import FooDepDep08 +import FooDepDep09 +import FooDepDep10 + +fooDep05 :: Int +fooDep05 = sum + [ 05 + , fooDepDep01 + , fooDepDep02 + , fooDepDep03 + , fooDepDep04 + , fooDepDep05 + , fooDepDep06 + , fooDepDep07 + , fooDepDep08 + , fooDepDep09 + , fooDepDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/include/include_FooDep05.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/include/include_FooDep05.h new file mode 100644 index 00000000000..cb4ef9e3b90 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/include/include_FooDep05.h @@ -0,0 +1 @@ +#define DEF_fooDep05 5 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/my-dep05.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/my-dep05.cabal new file mode 100644 index 00000000000..13525f75522 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep05/my-dep05.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my-dep05 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDep05 + default-language: Haskell2010 + build-depends: + , base + , my-dep-dep01 + , my-dep-dep02 + , my-dep-dep03 + , my-dep-dep04 + , my-dep-dep05 + , my-dep-dep06 + , my-dep-dep07 + , my-dep-dep08 + , my-dep-dep09 + , my-dep-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/FooDep06.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/FooDep06.hs new file mode 100644 index 00000000000..877571f3625 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/FooDep06.hs @@ -0,0 +1,27 @@ +module FooDep06 (fooDep06) where + +import FooDepDep01 +import FooDepDep02 +import FooDepDep03 +import FooDepDep04 +import FooDepDep05 +import FooDepDep06 +import FooDepDep07 +import FooDepDep08 +import FooDepDep09 +import FooDepDep10 + +fooDep06 :: Int +fooDep06 = sum + [ 06 + , fooDepDep01 + , fooDepDep02 + , fooDepDep03 + , fooDepDep04 + , fooDepDep05 + , fooDepDep06 + , fooDepDep07 + , fooDepDep08 + , fooDepDep09 + , fooDepDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/include/include_FooDep06.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/include/include_FooDep06.h new file mode 100644 index 00000000000..121a0893a6d --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/include/include_FooDep06.h @@ -0,0 +1 @@ +#define DEF_fooDep06 6 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/my-dep06.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/my-dep06.cabal new file mode 100644 index 00000000000..8f4fc14e383 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep06/my-dep06.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my-dep06 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDep06 + default-language: Haskell2010 + build-depends: + , base + , my-dep-dep01 + , my-dep-dep02 + , my-dep-dep03 + , my-dep-dep04 + , my-dep-dep05 + , my-dep-dep06 + , my-dep-dep07 + , my-dep-dep08 + , my-dep-dep09 + , my-dep-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/FooDep07.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/FooDep07.hs new file mode 100644 index 00000000000..c0102c376f0 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/FooDep07.hs @@ -0,0 +1,27 @@ +module FooDep07 (fooDep07) where + +import FooDepDep01 +import FooDepDep02 +import FooDepDep03 +import FooDepDep04 +import FooDepDep05 +import FooDepDep06 +import FooDepDep07 +import FooDepDep08 +import FooDepDep09 +import FooDepDep10 + +fooDep07 :: Int +fooDep07 = sum + [ 07 + , fooDepDep01 + , fooDepDep02 + , fooDepDep03 + , fooDepDep04 + , fooDepDep05 + , fooDepDep06 + , fooDepDep07 + , fooDepDep08 + , fooDepDep09 + , fooDepDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/include/include_FooDep07.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/include/include_FooDep07.h new file mode 100644 index 00000000000..890388e96f4 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/include/include_FooDep07.h @@ -0,0 +1 @@ +#define DEF_fooDep07 7 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/my-dep07.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/my-dep07.cabal new file mode 100644 index 00000000000..26f852fd4eb --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep07/my-dep07.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my-dep07 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDep07 + default-language: Haskell2010 + build-depends: + , base + , my-dep-dep01 + , my-dep-dep02 + , my-dep-dep03 + , my-dep-dep04 + , my-dep-dep05 + , my-dep-dep06 + , my-dep-dep07 + , my-dep-dep08 + , my-dep-dep09 + , my-dep-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/FooDep08.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/FooDep08.hs new file mode 100644 index 00000000000..a867fe7416f --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/FooDep08.hs @@ -0,0 +1,27 @@ +module FooDep08 (fooDep08) where + +import FooDepDep01 +import FooDepDep02 +import FooDepDep03 +import FooDepDep04 +import FooDepDep05 +import FooDepDep06 +import FooDepDep07 +import FooDepDep08 +import FooDepDep09 +import FooDepDep10 + +fooDep08 :: Int +fooDep08 = sum + [ 08 + , fooDepDep01 + , fooDepDep02 + , fooDepDep03 + , fooDepDep04 + , fooDepDep05 + , fooDepDep06 + , fooDepDep07 + , fooDepDep08 + , fooDepDep09 + , fooDepDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/include/include_FooDep08.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/include/include_FooDep08.h new file mode 100644 index 00000000000..a7959662c0b --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/include/include_FooDep08.h @@ -0,0 +1 @@ +#define DEF_fooDep08 8 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/my-dep08.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/my-dep08.cabal new file mode 100644 index 00000000000..6f65812163d --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep08/my-dep08.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my-dep08 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDep08 + default-language: Haskell2010 + build-depends: + , base + , my-dep-dep01 + , my-dep-dep02 + , my-dep-dep03 + , my-dep-dep04 + , my-dep-dep05 + , my-dep-dep06 + , my-dep-dep07 + , my-dep-dep08 + , my-dep-dep09 + , my-dep-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/FooDep09.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/FooDep09.hs new file mode 100644 index 00000000000..c2cd57e98b7 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/FooDep09.hs @@ -0,0 +1,27 @@ +module FooDep09 (fooDep09) where + +import FooDepDep01 +import FooDepDep02 +import FooDepDep03 +import FooDepDep04 +import FooDepDep05 +import FooDepDep06 +import FooDepDep07 +import FooDepDep08 +import FooDepDep09 +import FooDepDep10 + +fooDep09 :: Int +fooDep09 = sum + [ 09 + , fooDepDep01 + , fooDepDep02 + , fooDepDep03 + , fooDepDep04 + , fooDepDep05 + , fooDepDep06 + , fooDepDep07 + , fooDepDep08 + , fooDepDep09 + , fooDepDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/include/include_FooDep09.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/include/include_FooDep09.h new file mode 100644 index 00000000000..aa38edd5b88 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/include/include_FooDep09.h @@ -0,0 +1 @@ +#define DEF_fooDep09 9 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/my-dep09.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/my-dep09.cabal new file mode 100644 index 00000000000..a2393c87226 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep09/my-dep09.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my-dep09 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDep09 + default-language: Haskell2010 + build-depends: + , base + , my-dep-dep01 + , my-dep-dep02 + , my-dep-dep03 + , my-dep-dep04 + , my-dep-dep05 + , my-dep-dep06 + , my-dep-dep07 + , my-dep-dep08 + , my-dep-dep09 + , my-dep-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/FooDep10.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/FooDep10.hs new file mode 100644 index 00000000000..3cc38207580 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/FooDep10.hs @@ -0,0 +1,27 @@ +module FooDep10 (fooDep10) where + +import FooDepDep01 +import FooDepDep02 +import FooDepDep03 +import FooDepDep04 +import FooDepDep05 +import FooDepDep06 +import FooDepDep07 +import FooDepDep08 +import FooDepDep09 +import FooDepDep10 + +fooDep10 :: Int +fooDep10 = sum + [ 10 + , fooDepDep01 + , fooDepDep02 + , fooDepDep03 + , fooDepDep04 + , fooDepDep05 + , fooDepDep06 + , fooDepDep07 + , fooDepDep08 + , fooDepDep09 + , fooDepDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/include/include_FooDep10.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/include/include_FooDep10.h new file mode 100644 index 00000000000..2c4e63c62ed --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/include/include_FooDep10.h @@ -0,0 +1 @@ +#define DEF_fooDep10 10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/my-dep10.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/my-dep10.cabal new file mode 100644 index 00000000000..dfe7156d032 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my-dep10/my-dep10.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my-dep10 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: FooDep10 + default-language: Haskell2010 + build-depends: + , base + , my-dep-dep01 + , my-dep-dep02 + , my-dep-dep03 + , my-dep-dep04 + , my-dep-dep05 + , my-dep-dep06 + , my-dep-dep07 + , my-dep-dep08 + , my-dep-dep09 + , my-dep-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/Foo01.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/Foo01.hs new file mode 100644 index 00000000000..007e3df90b6 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/Foo01.hs @@ -0,0 +1,27 @@ +module Foo01 (foo01) where + +import FooDep01 +import FooDep02 +import FooDep03 +import FooDep04 +import FooDep05 +import FooDep06 +import FooDep07 +import FooDep08 +import FooDep09 +import FooDep10 + +foo01 :: Int +foo01 = sum + [ 01 + , fooDep01 + , fooDep02 + , fooDep03 + , fooDep04 + , fooDep05 + , fooDep06 + , fooDep07 + , fooDep08 + , fooDep09 + , fooDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/include/include_Foo01.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/include/include_Foo01.h new file mode 100644 index 00000000000..6ce0ec798ac --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/include/include_Foo01.h @@ -0,0 +1 @@ +#define DEF_foo01 1 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/my01.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/my01.cabal new file mode 100644 index 00000000000..3aa3c5b1f12 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my01/my01.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my01 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: Foo01 + default-language: Haskell2010 + build-depends: + , base + , my-dep01 + , my-dep02 + , my-dep03 + , my-dep04 + , my-dep05 + , my-dep06 + , my-dep07 + , my-dep08 + , my-dep09 + , my-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/Foo02.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/Foo02.hs new file mode 100644 index 00000000000..daeb7e06689 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/Foo02.hs @@ -0,0 +1,27 @@ +module Foo02 (foo02) where + +import FooDep01 +import FooDep02 +import FooDep03 +import FooDep04 +import FooDep05 +import FooDep06 +import FooDep07 +import FooDep08 +import FooDep09 +import FooDep10 + +foo02 :: Int +foo02 = sum + [ 02 + , fooDep01 + , fooDep02 + , fooDep03 + , fooDep04 + , fooDep05 + , fooDep06 + , fooDep07 + , fooDep08 + , fooDep09 + , fooDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/include/include_Foo02.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/include/include_Foo02.h new file mode 100644 index 00000000000..016f6956b67 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/include/include_Foo02.h @@ -0,0 +1 @@ +#define DEF_foo02 2 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/my02.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/my02.cabal new file mode 100644 index 00000000000..63dc442984e --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my02/my02.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my02 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: Foo02 + default-language: Haskell2010 + build-depends: + , base + , my-dep01 + , my-dep02 + , my-dep03 + , my-dep04 + , my-dep05 + , my-dep06 + , my-dep07 + , my-dep08 + , my-dep09 + , my-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/Foo03.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/Foo03.hs new file mode 100644 index 00000000000..bf9cc8c495b --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/Foo03.hs @@ -0,0 +1,27 @@ +module Foo03 (foo03) where + +import FooDep01 +import FooDep02 +import FooDep03 +import FooDep04 +import FooDep05 +import FooDep06 +import FooDep07 +import FooDep08 +import FooDep09 +import FooDep10 + +foo03 :: Int +foo03 = sum + [ 03 + , fooDep01 + , fooDep02 + , fooDep03 + , fooDep04 + , fooDep05 + , fooDep06 + , fooDep07 + , fooDep08 + , fooDep09 + , fooDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/include/include_Foo03.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/include/include_Foo03.h new file mode 100644 index 00000000000..1ed4f567d95 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/include/include_Foo03.h @@ -0,0 +1 @@ +#define DEF_foo03 3 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/my03.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/my03.cabal new file mode 100644 index 00000000000..534c5e914fb --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my03/my03.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my03 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: Foo03 + default-language: Haskell2010 + build-depends: + , base + , my-dep01 + , my-dep02 + , my-dep03 + , my-dep04 + , my-dep05 + , my-dep06 + , my-dep07 + , my-dep08 + , my-dep09 + , my-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/Foo04.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/Foo04.hs new file mode 100644 index 00000000000..654a7e0c661 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/Foo04.hs @@ -0,0 +1,27 @@ +module Foo04 (foo04) where + +import FooDep01 +import FooDep02 +import FooDep03 +import FooDep04 +import FooDep05 +import FooDep06 +import FooDep07 +import FooDep08 +import FooDep09 +import FooDep10 + +foo04 :: Int +foo04 = sum + [ 04 + , fooDep01 + , fooDep02 + , fooDep03 + , fooDep04 + , fooDep05 + , fooDep06 + , fooDep07 + , fooDep08 + , fooDep09 + , fooDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/include/include_Foo04.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/include/include_Foo04.h new file mode 100644 index 00000000000..f973f5e2e28 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/include/include_Foo04.h @@ -0,0 +1 @@ +#define DEF_foo04 4 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/my04.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/my04.cabal new file mode 100644 index 00000000000..b3e7cb025e9 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my04/my04.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my04 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: Foo04 + default-language: Haskell2010 + build-depends: + , base + , my-dep01 + , my-dep02 + , my-dep03 + , my-dep04 + , my-dep05 + , my-dep06 + , my-dep07 + , my-dep08 + , my-dep09 + , my-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/Foo05.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/Foo05.hs new file mode 100644 index 00000000000..6f011299199 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/Foo05.hs @@ -0,0 +1,27 @@ +module Foo05 (foo05) where + +import FooDep01 +import FooDep02 +import FooDep03 +import FooDep04 +import FooDep05 +import FooDep06 +import FooDep07 +import FooDep08 +import FooDep09 +import FooDep10 + +foo05 :: Int +foo05 = sum + [ 05 + , fooDep01 + , fooDep02 + , fooDep03 + , fooDep04 + , fooDep05 + , fooDep06 + , fooDep07 + , fooDep08 + , fooDep09 + , fooDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/include/include_Foo05.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/include/include_Foo05.h new file mode 100644 index 00000000000..d1554139188 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/include/include_Foo05.h @@ -0,0 +1 @@ +#define DEF_foo05 5 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/my05.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/my05.cabal new file mode 100644 index 00000000000..4d55d71db4d --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my05/my05.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my05 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: Foo05 + default-language: Haskell2010 + build-depends: + , base + , my-dep01 + , my-dep02 + , my-dep03 + , my-dep04 + , my-dep05 + , my-dep06 + , my-dep07 + , my-dep08 + , my-dep09 + , my-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/Foo06.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/Foo06.hs new file mode 100644 index 00000000000..4ba7567a5b2 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/Foo06.hs @@ -0,0 +1,27 @@ +module Foo06 (foo06) where + +import FooDep01 +import FooDep02 +import FooDep03 +import FooDep04 +import FooDep05 +import FooDep06 +import FooDep07 +import FooDep08 +import FooDep09 +import FooDep10 + +foo06 :: Int +foo06 = sum + [ 06 + , fooDep01 + , fooDep02 + , fooDep03 + , fooDep04 + , fooDep05 + , fooDep06 + , fooDep07 + , fooDep08 + , fooDep09 + , fooDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/include/include_Foo06.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/include/include_Foo06.h new file mode 100644 index 00000000000..b27035afce2 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/include/include_Foo06.h @@ -0,0 +1 @@ +#define DEF_foo06 6 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/my06.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/my06.cabal new file mode 100644 index 00000000000..7e4a1f00028 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my06/my06.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my06 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: Foo06 + default-language: Haskell2010 + build-depends: + , base + , my-dep01 + , my-dep02 + , my-dep03 + , my-dep04 + , my-dep05 + , my-dep06 + , my-dep07 + , my-dep08 + , my-dep09 + , my-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/Foo07.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/Foo07.hs new file mode 100644 index 00000000000..6701e0b2619 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/Foo07.hs @@ -0,0 +1,27 @@ +module Foo07 (foo07) where + +import FooDep01 +import FooDep02 +import FooDep03 +import FooDep04 +import FooDep05 +import FooDep06 +import FooDep07 +import FooDep08 +import FooDep09 +import FooDep10 + +foo07 :: Int +foo07 = sum + [ 07 + , fooDep01 + , fooDep02 + , fooDep03 + , fooDep04 + , fooDep05 + , fooDep06 + , fooDep07 + , fooDep08 + , fooDep09 + , fooDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/include/include_Foo07.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/include/include_Foo07.h new file mode 100644 index 00000000000..64d8cc6a7b9 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/include/include_Foo07.h @@ -0,0 +1 @@ +#define DEF_foo07 7 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/my07.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/my07.cabal new file mode 100644 index 00000000000..8f77521878d --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my07/my07.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my07 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: Foo07 + default-language: Haskell2010 + build-depends: + , base + , my-dep01 + , my-dep02 + , my-dep03 + , my-dep04 + , my-dep05 + , my-dep06 + , my-dep07 + , my-dep08 + , my-dep09 + , my-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/Foo08.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/Foo08.hs new file mode 100644 index 00000000000..294c7db3384 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/Foo08.hs @@ -0,0 +1,27 @@ +module Foo08 (foo08) where + +import FooDep01 +import FooDep02 +import FooDep03 +import FooDep04 +import FooDep05 +import FooDep06 +import FooDep07 +import FooDep08 +import FooDep09 +import FooDep10 + +foo08 :: Int +foo08 = sum + [ 08 + , fooDep01 + , fooDep02 + , fooDep03 + , fooDep04 + , fooDep05 + , fooDep06 + , fooDep07 + , fooDep08 + , fooDep09 + , fooDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/include/include_Foo08.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/include/include_Foo08.h new file mode 100644 index 00000000000..361e7a289a6 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/include/include_Foo08.h @@ -0,0 +1 @@ +#define DEF_foo08 8 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/my08.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/my08.cabal new file mode 100644 index 00000000000..2bf62465840 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my08/my08.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my08 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: Foo08 + default-language: Haskell2010 + build-depends: + , base + , my-dep01 + , my-dep02 + , my-dep03 + , my-dep04 + , my-dep05 + , my-dep06 + , my-dep07 + , my-dep08 + , my-dep09 + , my-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/Foo09.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/Foo09.hs new file mode 100644 index 00000000000..74b5d2ecb7f --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/Foo09.hs @@ -0,0 +1,27 @@ +module Foo09 (foo09) where + +import FooDep01 +import FooDep02 +import FooDep03 +import FooDep04 +import FooDep05 +import FooDep06 +import FooDep07 +import FooDep08 +import FooDep09 +import FooDep10 + +foo09 :: Int +foo09 = sum + [ 09 + , fooDep01 + , fooDep02 + , fooDep03 + , fooDep04 + , fooDep05 + , fooDep06 + , fooDep07 + , fooDep08 + , fooDep09 + , fooDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/include/include_Foo09.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/include/include_Foo09.h new file mode 100644 index 00000000000..7d61d6507e2 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/include/include_Foo09.h @@ -0,0 +1 @@ +#define DEF_foo09 9 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/my09.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/my09.cabal new file mode 100644 index 00000000000..c47b759958e --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my09/my09.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my09 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: Foo09 + default-language: Haskell2010 + build-depends: + , base + , my-dep01 + , my-dep02 + , my-dep03 + , my-dep04 + , my-dep05 + , my-dep06 + , my-dep07 + , my-dep08 + , my-dep09 + , my-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/Foo10.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/Foo10.hs new file mode 100644 index 00000000000..896730ca8bd --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/Foo10.hs @@ -0,0 +1,27 @@ +module Foo10 (foo10) where + +import FooDep01 +import FooDep02 +import FooDep03 +import FooDep04 +import FooDep05 +import FooDep06 +import FooDep07 +import FooDep08 +import FooDep09 +import FooDep10 + +foo10 :: Int +foo10 = sum + [ 10 + , fooDep01 + , fooDep02 + , fooDep03 + , fooDep04 + , fooDep05 + , fooDep06 + , fooDep07 + , fooDep08 + , fooDep09 + , fooDep10 + ] diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/include/include_Foo10.h b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/include/include_Foo10.h new file mode 100644 index 00000000000..d8d5ad21d36 --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/include/include_Foo10.h @@ -0,0 +1 @@ +#define DEF_foo10 10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/lib/libdummy-unused-lib.a b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/lib/libdummy-unused-lib.a new file mode 100644 index 00000000000..e69de29bb2d diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/my10.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/my10.cabal new file mode 100644 index 00000000000..fe9d8542e1b --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/deps/my10/my10.cabal @@ -0,0 +1,21 @@ +cabal-version: 3.0 +name: my10 +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + exposed-modules: Foo10 + default-language: Haskell2010 + build-depends: + , base + , my-dep01 + , my-dep02 + , my-dep03 + , my-dep04 + , my-dep05 + , my-dep06 + , my-dep07 + , my-dep08 + , my-dep09 + , my-dep10 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/my-toplevel.cabal b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/my-toplevel.cabal new file mode 100644 index 00000000000..62f16048d3e --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/my-toplevel.cabal @@ -0,0 +1,33 @@ +cabal-version: 3.6 +name: my-toplevel +description: Test that extra-include-dirs and extra-lib-dirs are not duplicated unnecessarily when e.g. gcc gets ultimately invoked +version: 0.1 +license: BSD-3-Clause +build-type: Simple + +library + default-language: + Haskell2010 + exposed-modules: + Foo + -- build-tool-depends: + -- , hsc2hs:hsc2hs + hsc2hs-options: + -DTEST_OPTION=42 + build-depends: + , base + , my01 + , my02 + , my03 + , my04 + , my05 + , my06 + , my07 + , my08 + , my09 + , my10 + +executable my-executable + main-is: Main.hs + build-depends: base, my-toplevel + default-language: Haskell2010 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/setup.out b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/setup.out new file mode 100644 index 00000000000..485946cb20a --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/setup.out @@ -0,0 +1,2 @@ +# my-toplevel my-executable +Result = 6312 diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/setup.test.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/setup.test.hs new file mode 100644 index 00000000000..0a89a85e6fa --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/setup.test.hs @@ -0,0 +1,96 @@ + +import Test.Cabal.Prelude + +-- --extra-include-dirs have to be absolute paths so this cannot +-- be specified in the cabal.project nor cabal.config. +includeDirs :: [String] +includeDirs = + [ "deps/my01/include" + , "deps/my02/include" + , "deps/my03/include" + , "deps/my04/include" + , "deps/my05/include" + , "deps/my06/include" + , "deps/my07/include" + , "deps/my08/include" + , "deps/my09/include" + , "deps/my10/include" + , "deps/my-dep01/include" + , "deps/my-dep02/include" + , "deps/my-dep03/include" + , "deps/my-dep04/include" + , "deps/my-dep05/include" + , "deps/my-dep06/include" + , "deps/my-dep07/include" + , "deps/my-dep08/include" + , "deps/my-dep09/include" + , "deps/my-dep10/include" + , "deps/my-dep-dep01/include" + , "deps/my-dep-dep02/include" + , "deps/my-dep-dep03/include" + , "deps/my-dep-dep04/include" + , "deps/my-dep-dep05/include" + , "deps/my-dep-dep06/include" + , "deps/my-dep-dep07/include" + , "deps/my-dep-dep08/include" + , "deps/my-dep-dep09/include" + , "deps/my-dep-dep10/include" + ] + +-- --extra-lib-dirs have to be absolute paths so this cannot +-- be specified in the cabal.project nor cabal.config. +libDirs :: [String] +libDirs = + [ "deps/my01/lib" + , "deps/my02/lib" + , "deps/my03/lib" + , "deps/my04/lib" + , "deps/my05/lib" + , "deps/my06/lib" + , "deps/my07/lib" + , "deps/my08/lib" + , "deps/my09/lib" + , "deps/my10/lib" + , "deps/my-dep01/lib" + , "deps/my-dep02/lib" + , "deps/my-dep03/lib" + , "deps/my-dep04/lib" + , "deps/my-dep05/lib" + , "deps/my-dep06/lib" + , "deps/my-dep07/lib" + , "deps/my-dep08/lib" + , "deps/my-dep09/lib" + , "deps/my-dep10/lib" + , "deps/my-dep-dep01/lib" + , "deps/my-dep-dep02/lib" + , "deps/my-dep-dep03/lib" + , "deps/my-dep-dep04/lib" + , "deps/my-dep-dep05/lib" + , "deps/my-dep-dep06/lib" + , "deps/my-dep-dep07/lib" + , "deps/my-dep-dep08/lib" + , "deps/my-dep-dep09/lib" + , "deps/my-dep-dep10/lib" + ] + + +main :: IO () +main = cabalTest $ do + cwd <- testSourceDir <$> getTestEnv + + -- The intention is to pass these flags via cabal.project or cabal.config, + -- but these directories must be absolute paths so we cannot commit + -- necessary cabal.project in the repository and have to resort to + -- the command-line arguments instead. + let includeFlags = + concatMap (\x -> ["--extra-include-dirs", cwd x]) includeDirs + libFlags = + concatMap (\x -> ["--extra-lib-dirs", cwd x]) libDirs + + -- Parallel flag means output of this test is nondeterministic + _<- recordMode DoNotRecord $ + cabal "v2-build" $ ["-j", "my-toplevel:exe:my-executable"] ++ includeFlags ++ libFlags + r <- withPlan $ runPlanExe' "my-toplevel" "my-executable" [] + assertOutputContains + ("Result = " ++ show (42 + 55 + 10 * (55 + 10 * 55) + 3 * 55)) + r From 2317a6708d64cc131a36973f482ae68d317c4ae9 Mon Sep 17 00:00:00 2001 From: Sergey Vinokurov Date: Thu, 19 Jun 2025 23:02:00 +0100 Subject: [PATCH 02/18] Rearrange genPureArgs for hsc2hs without changing semantics --- Cabal/src/Distribution/Simple/PreProcess.hs | 178 ++++++++++---------- 1 file changed, 91 insertions(+), 87 deletions(-) diff --git a/Cabal/src/Distribution/Simple/PreProcess.hs b/Cabal/src/Distribution/Simple/PreProcess.hs index 697a0e490dd..7e146c9a391 100644 --- a/Cabal/src/Distribution/Simple/PreProcess.hs +++ b/Cabal/src/Distribution/Simple/PreProcess.hs @@ -518,44 +518,74 @@ ppHsc2hs bi lbi clbi = -- directly, or via a response file. genPureArgs :: Version -> ConfiguredProgram -> String -> String -> [String] genPureArgs hsc2hsVersion gccProg inFile outFile = - -- Additional gcc options - [ "--cflag=" ++ opt - | opt <- - programDefaultArgs gccProg - ++ programOverrideArgs gccProg - ] - ++ [ "--lflag=" ++ opt - | opt <- - programDefaultArgs gccProg - ++ programOverrideArgs gccProg - ] - -- OSX frameworks: - ++ [ what ++ "=-F" ++ opt - | isOSX - , opt <- nub (concatMap Installed.frameworkDirs pkgs) - , what <- ["--cflag", "--lflag"] - ] - ++ [ "--lflag=" ++ arg - | isOSX - , opt <- map getSymbolicPath (PD.frameworks bi) ++ concatMap Installed.frameworks pkgs - , arg <- ["-framework", opt] - ] - -- Note that on ELF systems, wherever we use -L, we must also use -R - -- because presumably that -L dir is not on the normal path for the - -- system's dynamic linker. This is needed because hsc2hs works by - -- compiling a C program and then running it. - - ++ ["--cflag=" ++ opt | opt <- platformDefines lbi] - -- Options from the current package: - ++ ["--cflag=-I" ++ u dir | dir <- PD.includeDirs bi] - ++ [ "--cflag=-I" ++ u (buildDir lbi unsafeCoerceSymbolicPath relDir) - | relDir <- mapMaybe symbolicPathRelative_maybe $ PD.includeDirs bi - ] - ++ [ "--cflag=" ++ opt - | opt <- - PD.ccOptions bi - ++ PD.cppOptions bi - -- hsc2hs uses the C ABI + cflags + ++ ldflags + ++ preccldFlags + ++ hsc2hsOptions bi + ++ postccldFlags + ++ ["-o", outFile, inFile] + where + ldflags = + map ("--lflag=" ++) $ + concat + [ programDefaultArgs gccProg ++ programOverrideArgs gccProg + , osxFrameworkDirs + , [ arg + | isOSX + , opt <- map getSymbolicPath (PD.frameworks bi) ++ concatMap Installed.frameworks pkgs + , arg <- ["-framework", opt] + ] + , -- Note that on ELF systems, wherever we use -L, we must also use -R + -- because presumably that -L dir is not on the normal path for the + -- system's dynamic linker. This is needed because hsc2hs works by + -- compiling a C program and then running it. + + -- Options from the current package: + [ "-L" ++ u opt + | opt <- + if withFullyStaticExe lbi + then PD.extraLibDirsStatic bi + else PD.extraLibDirs bi + ] + , [ "-Wl,-R," ++ u opt + | isELF + , opt <- + if withFullyStaticExe lbi + then PD.extraLibDirsStatic bi + else PD.extraLibDirs bi + ] + , ["-l" ++ opt | opt <- PD.extraLibs bi] + , PD.ldOptions bi + , -- Options from dependent packages + [ opt + | pkg <- pkgs + , opt <- + ["-L" ++ opt | opt <- Installed.libraryDirs pkg] + ++ [ "-Wl,-R," ++ opt | isELF, opt <- Installed.libraryDirs pkg + ] + ++ [ "-l" ++ opt + | opt <- + if withFullyStaticExe lbi + then Installed.extraLibrariesStatic pkg + else Installed.extraLibraries pkg + ] + ++ Installed.ldOptions pkg + ] + ] + + cflags = + map ("--cflag=" ++) $ + concat + [ programDefaultArgs gccProg ++ programOverrideArgs gccProg + , osxFrameworkDirs + , platformDefines lbi + , -- Options from the current package: + ["-I" ++ u dir | dir <- PD.includeDirs bi] + , [ "-I" ++ u (buildDir lbi unsafeCoerceSymbolicPath relDir) + | relDir <- mapMaybe symbolicPathRelative_maybe $ PD.includeDirs bi + ] + + , -- hsc2hs uses the C ABI -- We assume that there are only C sources -- and C++ functions are exported via a C -- interface and wrapped in a C source file. @@ -563,56 +593,30 @@ ppHsc2hs bi lbi clbi = -- because there will not be C++ sources. -- -- DO NOT add PD.cxxOptions unless this changes! - ] - ++ [ "--cflag=" ++ opt - | opt <- - [ "-I" ++ u (autogenComponentModulesDir lbi clbi) - , "-I" ++ u (autogenPackageModulesDir lbi) - , "-include" - , u $ autogenComponentModulesDir lbi clbi makeRelativePathEx cppHeaderName + PD.ccOptions bi ++ PD.cppOptions bi + + , + [ "-I" ++ u (autogenComponentModulesDir lbi clbi) + , "-I" ++ u (autogenPackageModulesDir lbi) + , "-include" + , u $ autogenComponentModulesDir lbi clbi makeRelativePathEx cppHeaderName + ] + + , -- Options from dependent packages + [ opt + | pkg <- pkgs + , opt <- + ["-I" ++ opt | opt <- Installed.includeDirs pkg] + ++ Installed.ccOptions pkg + ] ] - ] - ++ [ "--lflag=-L" ++ u opt - | opt <- - if withFullyStaticExe lbi - then PD.extraLibDirsStatic bi - else PD.extraLibDirs bi - ] - ++ [ "--lflag=-Wl,-R," ++ u opt - | isELF - , opt <- - if withFullyStaticExe lbi - then PD.extraLibDirsStatic bi - else PD.extraLibDirs bi - ] - ++ ["--lflag=-l" ++ opt | opt <- PD.extraLibs bi] - ++ ["--lflag=" ++ opt | opt <- PD.ldOptions bi] - -- Options from dependent packages - ++ [ "--cflag=" ++ opt - | pkg <- pkgs - , opt <- - ["-I" ++ opt | opt <- Installed.includeDirs pkg] - ++ Installed.ccOptions pkg - ] - ++ [ "--lflag=" ++ opt - | pkg <- pkgs - , opt <- - ["-L" ++ opt | opt <- Installed.libraryDirs pkg] - ++ [ "-Wl,-R," ++ opt | isELF, opt <- Installed.libraryDirs pkg - ] - ++ [ "-l" ++ opt - | opt <- - if withFullyStaticExe lbi - then Installed.extraLibrariesStatic pkg - else Installed.extraLibraries pkg - ] - ++ Installed.ldOptions pkg - ] - ++ preccldFlags - ++ hsc2hsOptions bi - ++ postccldFlags - ++ ["-o", outFile, inFile] - where + + osxFrameworkDirs = + [ "-F" ++ opt + | isOSX + , opt <- ordNub (concatMap Installed.frameworkDirs pkgs) + ] + -- hsc2hs flag parsing was wrong -- (see -- https://github.com/haskell/hsc2hs/issues/35) -- so we need to put -- --cc/--ld *after* hsc2hsOptions, From c917edcda11412aaf459308d4b62e518394a8626 Mon Sep 17 00:00:00 2001 From: Sergey Vinokurov Date: Thu, 19 Jun 2025 23:02:29 +0100 Subject: [PATCH 03/18] Deduplicate arguments that hsc2hs passes to gcc and ld MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If extra-lib-dirs and/or extra-include-dirs are specified via either command line or project files, they’re going to be added for each package in the dendency graph. With enough long enough directories the command-line length limits for gcc may be hit and calls to the C compiler made from hsc2hs will start failing. Ideally hsc2hs should be using repsonse files, but needlessly specifying myriad of command-line parameters is redundant anyway. --- Cabal/src/Distribution/Simple/PreProcess.hs | 155 ++++++++++---------- 1 file changed, 77 insertions(+), 78 deletions(-) diff --git a/Cabal/src/Distribution/Simple/PreProcess.hs b/Cabal/src/Distribution/Simple/PreProcess.hs index 7e146c9a391..4db235065c7 100644 --- a/Cabal/src/Distribution/Simple/PreProcess.hs +++ b/Cabal/src/Distribution/Simple/PreProcess.hs @@ -527,89 +527,88 @@ ppHsc2hs bi lbi clbi = where ldflags = map ("--lflag=" ++) $ - concat - [ programDefaultArgs gccProg ++ programOverrideArgs gccProg - , osxFrameworkDirs - , [ arg - | isOSX - , opt <- map getSymbolicPath (PD.frameworks bi) ++ concatMap Installed.frameworks pkgs - , arg <- ["-framework", opt] - ] - , -- Note that on ELF systems, wherever we use -L, we must also use -R - -- because presumably that -L dir is not on the normal path for the - -- system's dynamic linker. This is needed because hsc2hs works by - -- compiling a C program and then running it. - - -- Options from the current package: - [ "-L" ++ u opt - | opt <- - if withFullyStaticExe lbi - then PD.extraLibDirsStatic bi - else PD.extraLibDirs bi - ] - , [ "-Wl,-R," ++ u opt - | isELF - , opt <- - if withFullyStaticExe lbi - then PD.extraLibDirsStatic bi - else PD.extraLibDirs bi - ] - , ["-l" ++ opt | opt <- PD.extraLibs bi] - , PD.ldOptions bi - , -- Options from dependent packages - [ opt - | pkg <- pkgs - , opt <- - ["-L" ++ opt | opt <- Installed.libraryDirs pkg] - ++ [ "-Wl,-R," ++ opt | isELF, opt <- Installed.libraryDirs pkg - ] - ++ [ "-l" ++ opt - | opt <- - if withFullyStaticExe lbi - then Installed.extraLibrariesStatic pkg - else Installed.extraLibraries pkg - ] - ++ Installed.ldOptions pkg + ordNub $ + concat + [ programDefaultArgs gccProg ++ programOverrideArgs gccProg + , osxFrameworkDirs + , [ arg + | isOSX + , opt <- map getSymbolicPath (PD.frameworks bi) ++ concatMap Installed.frameworks pkgs + , arg <- ["-framework", opt] + ] + , -- Note that on ELF systems, wherever we use -L, we must also use -R + -- because presumably that -L dir is not on the normal path for the + -- system's dynamic linker. This is needed because hsc2hs works by + -- compiling a C program and then running it. + + -- Options from the current package: + [ "-L" ++ u opt + | opt <- + if withFullyStaticExe lbi + then PD.extraLibDirsStatic bi + else PD.extraLibDirs bi + ] + , [ "-Wl,-R," ++ u opt + | isELF + , opt <- + if withFullyStaticExe lbi + then PD.extraLibDirsStatic bi + else PD.extraLibDirs bi + ] + , ["-l" ++ opt | opt <- PD.extraLibs bi] + , PD.ldOptions bi + , -- Options from dependent packages + [ opt + | pkg <- pkgs + , opt <- + ["-L" ++ opt | opt <- Installed.libraryDirs pkg] + ++ [ "-Wl,-R," ++ opt | isELF, opt <- Installed.libraryDirs pkg + ] + ++ [ "-l" ++ opt + | opt <- + if withFullyStaticExe lbi + then Installed.extraLibrariesStatic pkg + else Installed.extraLibraries pkg + ] + ++ Installed.ldOptions pkg + ] ] - ] cflags = map ("--cflag=" ++) $ - concat - [ programDefaultArgs gccProg ++ programOverrideArgs gccProg - , osxFrameworkDirs - , platformDefines lbi - , -- Options from the current package: - ["-I" ++ u dir | dir <- PD.includeDirs bi] - , [ "-I" ++ u (buildDir lbi unsafeCoerceSymbolicPath relDir) - | relDir <- mapMaybe symbolicPathRelative_maybe $ PD.includeDirs bi - ] - - , -- hsc2hs uses the C ABI - -- We assume that there are only C sources - -- and C++ functions are exported via a C - -- interface and wrapped in a C source file. - -- Therefore we do not supply C++ flags - -- because there will not be C++ sources. - -- - -- DO NOT add PD.cxxOptions unless this changes! - PD.ccOptions bi ++ PD.cppOptions bi - - , - [ "-I" ++ u (autogenComponentModulesDir lbi clbi) - , "-I" ++ u (autogenPackageModulesDir lbi) - , "-include" - , u $ autogenComponentModulesDir lbi clbi makeRelativePathEx cppHeaderName - ] - - , -- Options from dependent packages - [ opt - | pkg <- pkgs - , opt <- - ["-I" ++ opt | opt <- Installed.includeDirs pkg] - ++ Installed.ccOptions pkg + ordNub $ + concat + [ programDefaultArgs gccProg ++ programOverrideArgs gccProg + , osxFrameworkDirs + , platformDefines lbi + , -- Options from the current package: + ["-I" ++ u dir | dir <- PD.includeDirs bi] + , [ "-I" ++ u (buildDir lbi unsafeCoerceSymbolicPath relDir) + | relDir <- mapMaybe symbolicPathRelative_maybe $ PD.includeDirs bi + ] + , -- hsc2hs uses the C ABI + -- We assume that there are only C sources + -- and C++ functions are exported via a C + -- interface and wrapped in a C source file. + -- Therefore we do not supply C++ flags + -- because there will not be C++ sources. + -- + -- DO NOT add PD.cxxOptions unless this changes! + PD.ccOptions bi ++ PD.cppOptions bi + , + [ "-I" ++ u (autogenComponentModulesDir lbi clbi) + , "-I" ++ u (autogenPackageModulesDir lbi) + , "-include" + , u $ autogenComponentModulesDir lbi clbi makeRelativePathEx cppHeaderName + ] + , -- Options from dependent packages + [ opt + | pkg <- pkgs + , opt <- + ["-I" ++ opt | opt <- Installed.includeDirs pkg] + ++ Installed.ccOptions pkg + ] ] - ] osxFrameworkDirs = [ "-F" ++ opt From e38f45d9c8ef9d40df3424299774a87868adb9df Mon Sep 17 00:00:00 2001 From: Sergey Vinokurov Date: Thu, 19 Jun 2025 23:32:32 +0100 Subject: [PATCH 04/18] Add changelog --- changelog.d/pr-11005.md | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 changelog.d/pr-11005.md diff --git a/changelog.d/pr-11005.md b/changelog.d/pr-11005.md new file mode 100644 index 00000000000..42bcd334c78 --- /dev/null +++ b/changelog.d/pr-11005.md @@ -0,0 +1,9 @@ +--- +synopsis: Deduplicate hsc2hs command-line arguments +packages: [Cabal] +prs: 11005 +--- + +Fix a problem where `hsc2hs` becomes non-operational on packages with +lots of dependencies and projects that specify lots of +`extra-include-dirs` or `extra-lib-dirs`. From c3b3b82aca0f46c6066360908c84a7d17f09857b Mon Sep 17 00:00:00 2001 From: Sergey Vinokurov Date: Fri, 20 Jun 2025 00:01:26 +0100 Subject: [PATCH 05/18] Override C compiler for testing that no duplicate arguments are passed --- .../TooManyCommandLineArgs/custom-cc | 72 +++++++++++++++++++ .../TooManyCommandLineArgs/setup.test.hs | 13 +++- 2 files changed, 84 insertions(+), 1 deletion(-) create mode 100755 cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/custom-cc diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/custom-cc b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/custom-cc new file mode 100755 index 00000000000..79054cac89f --- /dev/null +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/custom-cc @@ -0,0 +1,72 @@ +#!/usr/bin/env bash + +# NB only check for duplicated -L or -I arguments because that’s the +# primary source of duplication. Some minor duplicates can also occur, +# like -Wl,--no-as-needed but there’s not too many of them yet to +# cause command line overflow. + +# Quadratic algorithm because darwin CI doesn’t seem to have bash that +# supports associative arrays. +check_duplicate() { + local test_arg="$1" + local occurs="0" + + if ! [[ "$test_arg" == -L* || "$test_arg" == -I* ]]; then + return 0 + fi + + shift + for tmp in "${@}"; do + if [[ "$tmp" == @* ]]; then + while IFS= read -d $'\n' -r arg ; do + if [[ "$arg" == "$test_arg" ]]; then + occurs=$((occurs + 1)) + fi + done <"${tmp#@}" + else + if [[ "$tmp" == "$test_arg" ]]; then + occurs=$((occurs + 1)) + fi + fi + done + + if [[ "$occurs" -gt 1 ]]; then + return 1 + else + return 0 + fi +} + +i=1 +for x in "${@}"; do + if [[ "$x" == @* ]]; then + file= + while IFS= read -d $'\n' -r arg ; do + y="$arg" + if ! check_duplicate "$arg" "${@:$i}"; then + echo "Duplicate argument detected: '$y'" + echo "All args: ${@}" + exit 1 + fi + done <"${x#@}" + else + if ! check_duplicate "$x" "${@:$i}"; then + echo "Duplicate argument detected: '$x'" + echo "All args: ${@}" + exit 1 + fi + fi + + i=$((i + 1)) +done + +if which cc >/dev/null 2>&1; then + cc -DNOERROR6 "${@}" +elif which gcc >/dev/null 2>&1; then + gcc -DNOERROR6 "${@}" +elif which clang >/dev/null 2>&1; then + clang -DNOERROR6 "${@}" +else + echo "Cannot find C compiler" >&2 + exit 1 +fi diff --git a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/setup.test.hs b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/setup.test.hs index 0a89a85e6fa..036d10cbdce 100644 --- a/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/setup.test.hs +++ b/cabal-testsuite/PackageTests/PreProcess/TooManyCommandLineArgs/setup.test.hs @@ -87,9 +87,20 @@ main = cabalTest $ do libFlags = concatMap (\x -> ["--extra-lib-dirs", cwd x]) libDirs + let customCC = cwd "custom-cc" + -- Parallel flag means output of this test is nondeterministic _<- recordMode DoNotRecord $ - cabal "v2-build" $ ["-j", "my-toplevel:exe:my-executable"] ++ includeFlags ++ libFlags + cabal "v2-build" $ + ["-j", "my-toplevel:exe:my-executable"] + -- Don’t validate absence of duplicates on Windows because + -- it’s too inconvenient to do in bat files. Let’s just + -- assume that deduplication will happen on Windows but + -- still try to run the test to see whether command-line + -- argument length limit is not hit. + ++ ["--with-gcc=" ++ customCC | not isWindows] + ++ includeFlags + ++ libFlags r <- withPlan $ runPlanExe' "my-toplevel" "my-executable" [] assertOutputContains ("Result = " ++ show (42 + 55 + 10 * (55 + 10 * 55) + 3 * 55)) From 20460e94c4080e83a6322be00c4df709cceac50a Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Wed, 16 Jul 2025 08:52:48 -0400 Subject: [PATCH 06/18] Fix typo exsting --- doc/cabaldomain.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/cabaldomain.py b/doc/cabaldomain.py index 9e16aefa6d6..8646c7453c9 100644 --- a/doc/cabaldomain.py +++ b/doc/cabaldomain.py @@ -384,7 +384,7 @@ def run(self): else: return result - # find exsting field list and add to it + # find existing field list and add to it # or create new one for item in contents: if isinstance(item, nodes.field_list): From a6e4162adb5a0ab8946d4c9fe1d33af8ccd98fa7 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Thu, 17 Jul 2025 21:42:33 -0400 Subject: [PATCH 07/18] Bump counts with hlint-3.8 --- .hlint.yaml | 41 ++++++++++++++++++++--------------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/.hlint.yaml b/.hlint.yaml index 6c5d86998d3..00468f57200 100644 --- a/.hlint.yaml +++ b/.hlint.yaml @@ -1,13 +1,12 @@ # Warnings currently triggered by your code - ignore: {name: "Avoid NonEmpty.unzip"} # 1 hint -- ignore: {name: "Avoid lambda"} # 47 hints +- ignore: {name: "Avoid lambda"} # 50 hints - ignore: {name: "Avoid lambda using `infix`"} # 23 hints -- ignore: {name: "Eta reduce"} # 124 hints +- ignore: {name: "Eta reduce"} # 132 hints - ignore: {name: "Evaluate"} # 10 hints - ignore: {name: "Functor law"} # 10 hints - ignore: {name: "Fuse concatMap/map"} # 3 hints - ignore: {name: "Fuse foldr/map"} # 3 hints -- ignore: {name: "Fuse mapMaybe/map"} # 1 hint - ignore: {name: "Fuse traverse_/fmap"} # 1 hint - ignore: {name: "Fuse traverse_/map"} # 1 hint - ignore: {name: "Hoist not"} # 16 hints @@ -16,11 +15,11 @@ - ignore: {name: "Monoid law, right identity"} # 3 hints - ignore: {name: "Move filter"} # 4 hints - ignore: {name: "Move guards forward"} # 4 hints -- ignore: {name: "Redundant $"} # 178 hints +- ignore: {name: "Redundant $"} # 192 hints - ignore: {name: "Redundant $!"} # 1 hint -- ignore: {name: "Redundant <$>"} # 16 hints +- ignore: {name: "Redundant <$>"} # 17 hints - ignore: {name: "Redundant =="} # 1 hint -- ignore: {name: "Redundant bracket"} # 240 hints +- ignore: {name: "Redundant bracket"} # 260 hints - ignore: {name: "Redundant fmap"} # 1 hint - ignore: {name: "Redundant guard"} # 2 hints - ignore: {name: "Redundant if"} # 6 hints @@ -28,13 +27,13 @@ - ignore: {name: "Redundant multi-way if"} # 1 hint - ignore: {name: "Redundant return"} # 9 hints - ignore: {name: "Replace case with fromMaybe"} # 6 hints -- ignore: {name: "Replace case with maybe"} # 10 hints +- ignore: {name: "Replace case with maybe"} # 11 hints - ignore: {name: "Use $>"} # 5 hints - ignore: {name: "Use ++"} # 4 hints -- ignore: {name: "Use :"} # 30 hints +- ignore: {name: "Use :"} # 28 hints - ignore: {name: "Use <$"} # 2 hints -- ignore: {name: "Use <$>"} # 87 hints -- ignore: {name: "Use <&>"} # 14 hints +- ignore: {name: "Use <$>"} # 86 hints +- ignore: {name: "Use <&>"} # 15 hints - ignore: {name: "Use <=<"} # 4 hints - ignore: {name: "Use =<<"} # 7 hints - ignore: {name: "Use =="} # 3 hints @@ -43,19 +42,19 @@ - ignore: {name: "Use Down"} # 3 hints - ignore: {name: "Use Just"} # 2 hints - ignore: {name: "Use bimap"} # 7 hints -- ignore: {name: "Use camelCase"} # 98 hints +- ignore: {name: "Use camelCase"} # 94 hints - ignore: {name: "Use catMaybes"} # 3 hints - ignore: {name: "Use concatMap"} # 2 hints -- ignore: {name: "Use const"} # 36 hints +- ignore: {name: "Use const"} # 37 hints - ignore: {name: "Use elem"} # 2 hints -- ignore: {name: "Use first"} # 4 hints -- ignore: {name: "Use fmap"} # 25 hints +- ignore: {name: "Use first"} # 5 hints +- ignore: {name: "Use fmap"} # 24 hints - ignore: {name: "Use fold"} # 1 hint - ignore: {name: "Use for"} # 1 hint - ignore: {name: "Use forM_"} # 1 hint -- ignore: {name: "Use fromMaybe"} # 4 hints +- ignore: {name: "Use fromMaybe"} # 5 hints - ignore: {name: "Use fromRight"} # 1 hint -- ignore: {name: "Use fst"} # 1 hint +- ignore: {name: "Use fst"} # 2 hints - ignore: {name: "Use if"} # 2 hints - ignore: {name: "Use infix"} # 20 hints - ignore: {name: "Use isAsciiLower"} # 2 hints @@ -63,7 +62,7 @@ - ignore: {name: "Use isDigit"} # 2 hints - ignore: {name: "Use isJust"} # 1 hint - ignore: {name: "Use isNothing"} # 1 hint -- ignore: {name: "Use lambda-case"} # 55 hints +- ignore: {name: "Use lambda-case"} # 58 hints - ignore: {name: "Use lefts"} # 1 hint - ignore: {name: "Use list comprehension"} # 19 hints - ignore: {name: "Use list literal"} # 3 hints @@ -74,7 +73,7 @@ - ignore: {name: "Use max"} # 2 hints - ignore: {name: "Use maybe"} # 8 hints - ignore: {name: "Use minimumBy"} # 1 hint -- ignore: {name: "Use newtype instead of data"} # 26 hints +- ignore: {name: "Use newtype instead of data"} # 29 hints - ignore: {name: "Use notElem"} # 9 hints - ignore: {name: "Use null"} # 2 hints - ignore: {name: "Use record patterns"} # 16 hints @@ -82,12 +81,12 @@ - ignore: {name: "Use replicateM_"} # 2 hints - ignore: {name: "Use rights"} # 2 hints - ignore: {name: "Use second"} # 7 hints -- ignore: {name: "Use section"} # 17 hints +- ignore: {name: "Use section"} # 18 hints - ignore: {name: "Use traverse"} # 1 hint -- ignore: {name: "Use tuple-section"} # 28 hints +- ignore: {name: "Use tuple-section"} # 27 hints - ignore: {name: "Use typeRep"} # 2 hints - ignore: {name: "Use uncurry"} # 1 hint -- ignore: {name: "Use unless"} # 22 hints +- ignore: {name: "Use unless"} # 23 hints - ignore: {name: "Use unwords"} # 8 hints - ignore: {name: "Use void"} # 23 hints - ignore: {name: "Use when"} # 1 hint From 46099cf30d132bca61f2c8123dc29d2fbc2c40d6 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Sun, 20 Jul 2025 06:58:17 -0400 Subject: [PATCH 08/18] Typo, seach, in comment --- cabal-testsuite/src/Test/Cabal/NeedleHaystack.hs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cabal-testsuite/src/Test/Cabal/NeedleHaystack.hs b/cabal-testsuite/src/Test/Cabal/NeedleHaystack.hs index 2ba8f93f41e..b77c43ff48f 100644 --- a/cabal-testsuite/src/Test/Cabal/NeedleHaystack.hs +++ b/cabal-testsuite/src/Test/Cabal/NeedleHaystack.hs @@ -145,7 +145,7 @@ data TxFwdBwd = txFwdBwdId :: TxFwdBwd txFwdBwdId = TxFwdBwd id id --- | Conversions of the needle and haystack strings, the seach string and the +-- | Conversions of the needle and haystack strings, the search string and the -- text to search in. data NeedleHaystack = NeedleHaystack From e55b86618240c594be3151e3321a70343aa275b6 Mon Sep 17 00:00:00 2001 From: Phil de Joux Date: Thu, 17 Jul 2025 21:51:50 -0400 Subject: [PATCH 09/18] Bump to hlint-3.10 - Bump to hlint-3.10 in the gh-action --- .github/workflows/lint.yml | 2 +- .hlint.yaml | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index b16a5ef0925..102be090d04 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -11,7 +11,7 @@ jobs: - uses: actions/checkout@v4 - uses: haskell-actions/hlint-setup@v2 with: - version: "3.8" + version: "3.10" - uses: haskell-actions/hlint-run@v2 with: path: "." diff --git a/.hlint.yaml b/.hlint.yaml index 00468f57200..c827093b84f 100644 --- a/.hlint.yaml +++ b/.hlint.yaml @@ -24,10 +24,11 @@ - ignore: {name: "Redundant guard"} # 2 hints - ignore: {name: "Redundant if"} # 6 hints - ignore: {name: "Redundant lambda"} # 19 hints +- ignore: {name: "Redundant maybe"} # 2 hints - ignore: {name: "Redundant multi-way if"} # 1 hint - ignore: {name: "Redundant return"} # 9 hints -- ignore: {name: "Replace case with fromMaybe"} # 6 hints -- ignore: {name: "Replace case with maybe"} # 11 hints +- ignore: {name: "Replace case with fromMaybe"} # 4 hints +- ignore: {name: "Replace case with maybe"} # 10 hints - ignore: {name: "Use $>"} # 5 hints - ignore: {name: "Use ++"} # 4 hints - ignore: {name: "Use :"} # 28 hints @@ -40,7 +41,6 @@ - ignore: {name: "Use >=>"} # 3 hints - ignore: {name: "Use ?~"} # 1 hint - ignore: {name: "Use Down"} # 3 hints -- ignore: {name: "Use Just"} # 2 hints - ignore: {name: "Use bimap"} # 7 hints - ignore: {name: "Use camelCase"} # 94 hints - ignore: {name: "Use catMaybes"} # 3 hints @@ -55,7 +55,6 @@ - ignore: {name: "Use fromMaybe"} # 5 hints - ignore: {name: "Use fromRight"} # 1 hint - ignore: {name: "Use fst"} # 2 hints -- ignore: {name: "Use if"} # 2 hints - ignore: {name: "Use infix"} # 20 hints - ignore: {name: "Use isAsciiLower"} # 2 hints - ignore: {name: "Use isAsciiUpper"} # 2 hints From 8c46f48db9d9170d54f0587e5e7ac0776015a9bc Mon Sep 17 00:00:00 2001 From: Artem Pelenitsyn Date: Tue, 15 Jul 2025 12:12:13 -0400 Subject: [PATCH 10/18] CI: add GHC 8.6.5 to validate-old-ghcs fix #11073 --- .github/workflows/validate.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml index abf19bffab8..8ced64a916f 100644 --- a/.github/workflows/validate.yml +++ b/.github/workflows/validate.yml @@ -55,11 +55,11 @@ jobs: - { os: windows-latest, shell: "C:/msys64/usr/bin/bash.exe -e {0}" } - { os: ubuntu-22.04, shell: bash } - { os: macos-latest, shell: bash } - # If you remove something from here, then add it to the old-ghcs job. - # Also a removed GHC from here means that we are actually dropping - # support, so the PR *must* have a changelog entry. ghc: [ + # IMPORTANT: If you remove a version from this list, then add it to the old-ghcs job below. + # Also a removed GHC from here means that we are actually dropping + # support, so the PR *must* have a changelog entry. "9.12.2", "9.10.2", "9.8.4", @@ -251,7 +251,7 @@ jobs: strategy: matrix: extra-ghc: - ["8.4.4", "8.2.2", "8.0.2"] + ["8.6.5", "8.4.4", "8.2.2", "8.0.2"] ## GHC 7.10.3 does not install on ubuntu-22.04 with ghcup. ## Older GHCs are not supported by ghcup in the first place. fail-fast: false From 96f1ff6721e8190e09b411b009fe23e41245ec04 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Mon, 13 Nov 2023 17:40:07 +0800 Subject: [PATCH 11/18] Migrate release CI back to github --- .github/actions/download/action.yml | 25 + .github/actions/upload/action.yml | 33 + .github/scripts/build.bash | 55 ++ .github/scripts/test.bash | 34 + .github/workflows/release.yaml | 87 ++ .github/workflows/reusable-release.yml | 741 ++++++++++++++++++ .../cabal-install-solver.cabal | 2 +- cabal.release.project | 21 +- .../create-release-metadata-for-ghcup.sh | 139 ++-- ...download-cabal-install-release-binaries.sh | 42 - scripts/release/download-gh-artifacts.sh | 42 + scripts/release/sftp-upload-artifacts.sh | 22 + 12 files changed, 1120 insertions(+), 123 deletions(-) create mode 100644 .github/actions/download/action.yml create mode 100644 .github/actions/upload/action.yml create mode 100644 .github/scripts/build.bash create mode 100644 .github/scripts/test.bash create mode 100644 .github/workflows/release.yaml create mode 100644 .github/workflows/reusable-release.yml delete mode 100755 scripts/release/download-cabal-install-release-binaries.sh create mode 100755 scripts/release/download-gh-artifacts.sh create mode 100755 scripts/release/sftp-upload-artifacts.sh diff --git a/.github/actions/download/action.yml b/.github/actions/download/action.yml new file mode 100644 index 00000000000..cfb4e283c80 --- /dev/null +++ b/.github/actions/download/action.yml @@ -0,0 +1,25 @@ +name: 'Download artifact' +description: 'Download artifacts with normalized names' +inputs: + name: + required: true + type: string + path: + required: true + type: string + +runs: + using: "composite" + steps: + - name: Normalise name + run: | + name=${{ inputs.name }} + echo "NAME=${name//\//_}" >> "$GITHUB_ENV" + shell: bash + + - name: Download artifact + uses: actions/download-artifact@v4 + with: + name: ${{ env.NAME }} + path: ${{ inputs.path }} + diff --git a/.github/actions/upload/action.yml b/.github/actions/upload/action.yml new file mode 100644 index 00000000000..927974ad581 --- /dev/null +++ b/.github/actions/upload/action.yml @@ -0,0 +1,33 @@ +name: 'Upload artifact' +description: 'Upload artifacts with normalized names' +inputs: + if-no-files-found: + default: 'error' + type: string + name: + required: true + type: string + path: + required: true + type: string + retention-days: + default: 0 + type: number + +runs: + using: "composite" + steps: + - name: Normalise name + run: | + name=${{ inputs.name }} + echo "NAME=${name//\//_}" >> "$GITHUB_ENV" + shell: bash + + - name: Upload artifact + uses: actions/upload-artifact@v4 + with: + if-no-files-found: ${{ inputs.if-no-files-found }} + retention-days: ${{ inputs.retention-days }} + name: ${{ env.NAME }} + path: ${{ inputs.path }} + diff --git a/.github/scripts/build.bash b/.github/scripts/build.bash new file mode 100644 index 00000000000..27263fc822b --- /dev/null +++ b/.github/scripts/build.bash @@ -0,0 +1,55 @@ +set -eux + +uname -a +uname -p +uname +pwd +env + +if [ "${RUNNER_OS}" = Windows ] ; then + ext=".exe" +else + ext="" +fi + +ghcup --no-verbose install ghc --set --install-targets "${GHC_TARGETS}" "${GHC_VERSION}" + +cabal update +cabal user-config diff +cabal user-config init -f +"ghc-${GHC_VERSION}" --info +"ghc" --info + +# shellcheck disable=SC2206 +args=( + -w "ghc-$GHC_VERSION" + --disable-profiling + --enable-executable-stripping + --project-file=cabal.release.project + ${ADD_CABAL_ARGS} +) + +cabal v2-build "${args[@]}" cabal-install + +mkdir -p "out" +# shellcheck disable=SC2154 +cp "$(cabal list-bin "${args[@]}" cabal-install:exe:cabal)" "out/cabal$ext" +cp dist-newstyle/cache/plan.json "out/plan.json" +cd "out/" + +# create tarball/zip +TARBALL_PREFIX="cabal-install-$("./cabal" --numeric-version)" +case "${TARBALL_EXT}" in + zip) + zip "${TARBALL_PREFIX}-${ARTIFACT}.${TARBALL_EXT}" "cabal${ext}" plan.json + ;; + tar.xz) + tar caf "${TARBALL_PREFIX}-${ARTIFACT}.${TARBALL_EXT}" "cabal${ext}" plan.json + ;; + *) + fail "Unknown TARBALL_EXT: ${TARBALL_EXT}" + ;; +esac + +rm "cabal${ext}" plan.json + diff --git a/.github/scripts/test.bash b/.github/scripts/test.bash new file mode 100644 index 00000000000..9c83dbb32d7 --- /dev/null +++ b/.github/scripts/test.bash @@ -0,0 +1,34 @@ +set -eux + +env +pwd +ls -lah + +cd out +case "${TARBALL_EXT}" in + zip) + unzip ./cabal-install-*-"${ARTIFACT}.${TARBALL_EXT}" + ;; + tar.xz) + tar xf ./cabal-install-*-"${ARTIFACT}.${TARBALL_EXT}" + ;; + *) + fail "Unknown TARBALL_EXT: ${TARBALL_EXT}" + ;; +esac +cd .. + +ghcup --no-verbose install ghc --set --install-targets "${GHC_TEST_TARGETS}" "${GHC_TEST_VERSION}" + +cabal update + +# TODO: we want to avoid building here... we should just +# be using the previously built 'cabal-tests' binary +# Also see https://github.com/haskell/cabal/issues/11048 +cabal run -w "ghc-${GHC_TEST_VERSION}" ${ADD_CABAL_ARGS} cabal-testsuite:cabal-tests -- \ + --with-cabal "$(pwd)/out/cabal" \ + --intree-cabal-lib "$(pwd)" \ + --test-tmp "$(pwd)/testdb" \ + --skip-setup-tests \ + -j "$(nproc || sysctl -n hw.ncpu || getconf _NPROCESSORS_ONLN || echo 1)" + diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000000..1a7343ba760 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,87 @@ +name: Build and release + +on: + push: + tags: + - 'v*' + - 'cabal-install-*' + pull_request: + types: [opened, synchronize, reopened, labeled] + branches: + - master + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + +permissions: + pull-requests: read + +env: + BUILD_LABEL: "run release build" + +jobs: + check-pr-labels: + name: check PR labels + runs-on: ubuntu-latest + outputs: + run_release_workflow: ${{ steps.gen_output.outputs.run_release_workflow }} + steps: + - id: gen_output + run: | + if [ "${{ github.event.action }}" == 'labeled' ] ; then + if [ ${{ github.event.label.name == '${{ env.BUILD_LABEL }}' }} ] ; then + echo run_release_workflow="yes" >> "$GITHUB_OUTPUT" + else + echo run_release_workflow="no" >> "$GITHUB_OUTPUT" + fi + elif [ "${{ github.event_name }}" = 'pull_request' ] ; then + run_it=$(if gh api --jq '.labels.[].name' /repos/${{ github.repository }}/pulls/${{ github.event.number }} | grep --quiet '^${{ env.BUILD_LABEL }}$' ; then printf "%s" "yes" ; else printf "%s" "no" ; fi) + echo "${run_it}" + echo run_release_workflow="${run_it}" >> "$GITHUB_OUTPUT" + else + echo run_release_workflow="yes" >> "$GITHUB_OUTPUT" + fi + shell: bash + env: + GH_TOKEN: ${{ github.token }} + + release-workflow: + needs: ["check-pr-labels"] + if: ${{ needs.check-pr-labels.outputs.run_release_workflow == 'yes' }} + uses: ./.github/workflows/reusable-release.yml + with: + branches: '["${{ github.ref }}"]' + + release: + name: release + needs: [ "release-workflow" ] + runs-on: ubuntu-latest + if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Download artifacts + uses: actions/download-artifact@v4 + with: + pattern: artifacts-* + merge-multiple: true + path: ./out + + - name: Install requirements + run: | + sudo apt-get update && sudo apt-get install -y tar xz-utils + shell: bash + + - name: build sdists + run: | + cabal sdist -o out all + shell: bash + + - name: Release + uses: softprops/action-gh-release@v1 + with: + draft: true + files: | + ./out/* + diff --git a/.github/workflows/reusable-release.yml b/.github/workflows/reusable-release.yml new file mode 100644 index 00000000000..b5000eba2a8 --- /dev/null +++ b/.github/workflows/reusable-release.yml @@ -0,0 +1,741 @@ +name: Build and release + +on: + workflow_call: + inputs: + branches: + required: true + type: string + ghc: + type: string + default: 9.10.2 + # speed up installation by skipping docs + # starting with GHC 9.10.x, we also need to pass the 'install_extra' target + ghc_targets: + type: string + default: "install_bin install_lib update_package_db install_extra" + cabal: + type: string + default: 3.14.2.0 + test: + type: boolean + default: true + +env: + GHC_VERSION: ${{ inputs.ghc }} + GHC_TARGETS: ${{ inputs.ghc_targets }} + # This shouldn't be necessary, but cabal developers + # want to build with 9.10.2, which causes test failures + # when used as runtime GHC version as well. + GHC_TEST_VERSION: 9.6.7 + GHC_TEST_TARGETS: "install_bin install_lib update_package_db" + CABAL_VERSION: ${{ inputs.cabal }} + BOOTSTRAP_HASKELL_NONINTERACTIVE: 1 + BOOTSTRAP_HASKELL_MINIMAL: 1 + DEBIAN_FRONTEND: noninteractive + TZ: Asia/Singapore + +jobs: + tool-output: + runs-on: ubuntu-latest + outputs: + apt_tools: ${{ steps.gen_output.outputs.apt_tools }} + apt_tools_ncurses6: ${{ steps.gen_output.outputs.apt_tools_ncurses6 }} + rpm_tools: ${{ steps.gen_output.outputs.rpm_tools }} + apk_tools: ${{ steps.gen_output.outputs.apk_tools }} + xbps_tools: ${{ steps.gen_output.outputs.xbps_tools }} + env: + APT: "groff-base libnuma-dev zlib1g-dev libgmp-dev libgmp10 libssl-dev liblzma-dev libbz2-dev git wget lsb-release software-properties-common gnupg2 apt-transport-https gcc autoconf automake build-essential curl ghc gzip libffi-dev libncurses-dev patchelf" + RPM: "groff-base autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils-libs findutils gcc gcc-c++ git gmp gmp-devel jq lbzip2 make ncurses ncurses-compat-libs ncurses-devel openssh-clients patch perl pxz python3 sqlite sudo wget which xz zlib-devel patchelf" + APK: "groff binutils-gold curl gcc g++ gmp-dev libc-dev libffi-dev make musl-dev ncurses-dev perl tar xz autoconf automake bzip2 coreutils elfutils-dev findutils git jq bzip2-dev patch python3 sqlite sudo wget which zlib-dev patchelf zlib zlib-dev zlib-static" + XBPS: "groff ncurses-libtinfo-libs autoconf automake binutils bzip2 coreutils curl elfutils-devel elfutils findutils gcc gmp gmp-devel jq lbzip2 make ncurses ncurses-devel openssh patch perl python3 sqlite sudo wget which xz tar zlib-devel patchelf gzip" + steps: + - name: Generate output + id: gen_output + run: | + echo apt_tools="${{ env.APT }} libncurses5 libtinfo5" >> "$GITHUB_OUTPUT" + echo apt_tools_ncurses6="${{ env.APT }} libncurses6 libtinfo6" >> "$GITHUB_OUTPUT" + echo rpm_tools="${{ env.RPM }}" >> "$GITHUB_OUTPUT" + echo apk_tools="${{ env.APK }}" >> "$GITHUB_OUTPUT" + echo xbps_tools="${{ env.XBPS }}" >> "$GITHUB_OUTPUT" + + build-linux: + name: Build linux binaries + runs-on: ubuntu-latest + needs: ["tool-output"] + env: + TARBALL_EXT: tar.xz + ARCH: 64 + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + platform: [ { image: "debian:11" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" + , DISTRO: "Debian" + , ARTIFACT: "x86_64-linux-deb11" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "debian:12" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" + , DISTRO: "Debian" + , ARTIFACT: "x86_64-linux-deb12" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "ubuntu:20.04" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" + , DISTRO: "Ubuntu" + , ARTIFACT: "x86_64-linux-ubuntu20.04" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "ubuntu:22.04" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" + , DISTRO: "Ubuntu" + , ARTIFACT: "x86_64-linux-ubuntu22.04" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "ubuntu:24.04" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools_ncurses6 }}" + , DISTRO: "Ubuntu" + , ARTIFACT: "x86_64-linux-ubuntu24.04" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "fedora:33" + , installCmd: "dnf install -y" + , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" + , DISTRO: "Fedora" + , ARTIFACT: "x86_64-linux-fedora33" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "fedora:36" + , installCmd: "dnf install -y" + , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" + , DISTRO: "Fedora" + , ARTIFACT: "x86_64-linux-fedora36" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "fedora:38" + , installCmd: "dnf install -y" + , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" + , DISTRO: "Fedora" + , ARTIFACT: "x86_64-linux-fedora38" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "rockylinux:8" + , installCmd: "yum -y install epel-release && yum install -y --allowerasing" + , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-rocky8" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "alpine:3.20" + , installCmd: "apk update && apk add" + , toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-unknown" + , ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static" + }, + { image: "alpine:3.12" + , installCmd: "apk update && apk add" + , toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-alpine312" + , ADD_CABAL_ARGS: "--enable-split-sections" + }, + { image: "alpine:3.20" + , installCmd: "apk update && apk add" + , toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-alpine320" + , ADD_CABAL_ARGS: "--enable-split-sections" + } + ] + container: + image: ${{ matrix.platform.image }} + steps: + - name: Install requirements + shell: sh + run: | + ${{ matrix.platform.installCmd }} curl bash git ${{ matrix.platform.toolRequirements }} + + - name: Install GHCup + uses: haskell/ghcup-setup@v1 + with: + cabal: ${{ env.CABAL_VERSION }} + + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - name: Run build + run: | + bash .github/scripts/build.bash + + env: + ARTIFACT: ${{ matrix.platform.ARTIFACT }} + DISTRO: ${{ matrix.platform.DISTRO }} + ADD_CABAL_ARGS: ${{ matrix.platform.ADD_CABAL_ARGS }} + + - if: always() + name: Upload artifact + uses: ./.github/actions/upload + with: + if-no-files-found: error + retention-days: 2 + name: artifacts-${{ matrix.platform.ARTIFACT }}-${{ matrix.branch }} + path: | + ./out/* + + build-linux-32bit: + name: Build linux binaries (32bit) + needs: ["tool-output"] + runs-on: ubuntu-latest + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + env: + TARBALL_EXT: tar.xz + ARCH: 32 + DISTRO: "Unknown" + ARTIFACT: "i386-linux-unknown" + ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static" + + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - name: Run build (32 bit linux) + uses: docker://i386/alpine:3.20 + with: + args: sh -c "apk update && apk add curl bash git ${{ needs.tool-output.outputs.apk_tools }} && export PATH=$HOME/.ghcup/bin:$PATH && curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && ghcup install cabal ${{ env.CABAL_VERSION }} && bash .github/scripts/build.bash" + + - if: always() + name: Upload artifact + uses: ./.github/actions/upload + with: + if-no-files-found: error + retention-days: 2 + name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} + path: | + ./out/* + + build-arm: + name: Build ARM binary + needs: ["tool-output"] + runs-on: ubuntu-22.04-arm + env: + TARBALL_EXT: tar.xz + ADD_CABAL_ARGS: "" + ARCH: ARM64 + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + platform: [ { ARCH: "ARM64" + , DISTRO: "Debian" + , ARTIFACT: "aarch64-linux-deb11" + }, + { ARCH: "ARM64" + , DISTRO: "Alpine" + , ARTIFACT: "aarch64-linux-unknown" + } + ] + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - if: matrix.platform.DISTRO == 'Debian' + uses: docker://arm64v8/debian:11 + name: Run build (aarch64 linux) + with: + args: sh -c "apt-get update && apt-get install -y curl bash git ${{ needs.tool-output.outputs.apt_tools }} && export PATH=$HOME/.ghcup/bin:$PATH && curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && ghcup install cabal ${{ env.CABAL_VERSION }} && bash .github/scripts/build.bash" + env: + ARTIFACT: ${{ matrix.platform.ARTIFACT }} + DISTRO: ${{ matrix.platform.DISTRO }} + ADD_CABAL_ARGS: "" + + - if: matrix.platform.DISTRO == 'Alpine' + uses: docker://arm64v8/alpine:3.20 + name: Run build (aarch64 linux alpine) + with: + args: sh -c "apk update && apk add curl bash git ${{ needs.tool-output.outputs.apk_tools }} && export PATH=$HOME/.ghcup/bin:$PATH && curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && ghcup install cabal ${{ env.CABAL_VERSION }} && bash .github/scripts/build.bash" + env: + ARTIFACT: ${{ matrix.platform.ARTIFACT }} + DISTRO: ${{ matrix.platform.DISTRO }} + ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static" + + - if: always() + name: Upload artifact + uses: ./.github/actions/upload + with: + if-no-files-found: error + retention-days: 2 + name: artifacts-${{ matrix.platform.ARTIFACT }}-${{ matrix.branch }} + path: | + ./out/* + + build-mac-x86_64: + name: Build binary (Mac x86_64) + runs-on: macOS-13 + env: + MACOSX_DEPLOYMENT_TARGET: 10.13 + ADD_CABAL_ARGS: "" + ARTIFACT: "x86_64-apple-darwin" + ARCH: 64 + TARBALL_EXT: tar.xz + DISTRO: na + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - name: Install GHCup + uses: haskell/ghcup-setup@v1 + with: + cabal: ${{ env.CABAL_VERSION }} + + - name: Run build + run: | + bash .github/scripts/build.bash + + - if: always() + name: Upload artifact + uses: ./.github/actions/upload + with: + if-no-files-found: error + retention-days: 2 + name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} + path: | + ./out/* + + build-mac-aarch64: + name: Build binary (Mac aarch64) + runs-on: macos-latest + env: + MACOSX_DEPLOYMENT_TARGET: 10.13 + ADD_CABAL_ARGS: "" + ARTIFACT: "aarch64-apple-darwin" + ARCH: ARM64 + TARBALL_EXT: tar.xz + DISTRO: na + HOMEBREW_CHANGE_ARCH_TO_ARM: 1 + GHCUP_INSTALL_BASE_PREFIX: ${{ github.workspace }} + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - name: Install GHCup + uses: haskell/ghcup-setup@v1 + with: + cabal: ${{ env.CABAL_VERSION }} + + - name: Run build + run: | + bash .github/scripts/build.bash + + - if: always() + name: Upload artifact + uses: ./.github/actions/upload + with: + if-no-files-found: error + retention-days: 2 + name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} + path: | + ./out/* + + build-win: + name: Build binary (Win) + runs-on: windows-latest + env: + ADD_CABAL_ARGS: "" + ARTIFACT: "x86_64-mingw64" + ARCH: 64 + TARBALL_EXT: "zip" + DISTRO: na + CABAL_DIR: "C:\\Users\\runneradmin\\AppData\\Roaming\\cabal" + GHCUP_INSTALL_BASE_PREFIX: "/c" + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - name: install windows deps + shell: pwsh + run: | + # https://www.msys2.org/docs/updating/ + C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -Syuu" + C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -Syuu" + C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -S make mingw-w64-x86_64-clang curl autoconf mingw-w64-x86_64-pkgconf ca-certificates base-devel gettext autoconf make libtool automake python p7zip patch unzip zip git" + taskkill /F /FI "MODULES eq msys-2.0.dll" + + - name: Install GHCup + uses: haskell/ghcup-setup@v1 + with: + cabal: ${{ env.CABAL_VERSION }} + + - name: Run build (windows) + run: | + $env:CHERE_INVOKING = 1 + $env:MSYS2_PATH_TYPE = "inherit" + $ErrorActionPreference = "Stop" + C:\msys64\usr\bin\bash -lc "bash .github/scripts/build.bash" + shell: pwsh + + - if: always() + name: Upload artifact + uses: ./.github/actions/upload + with: + if-no-files-found: error + retention-days: 2 + name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} + path: | + ./out/* + + test-linux: + name: Test linux binaries + runs-on: ubuntu-latest + needs: ["tool-output", "build-linux"] + if: ${{ inputs.test }} + env: + TARBALL_EXT: tar.xz + ARCH: 64 + ADD_CABAL_ARGS: "" + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + platform: [ { image: "debian:11" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" + , DISTRO: "Debian" + , ARTIFACT: "x86_64-linux-deb11" + }, + { image: "debian:12" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" + , DISTRO: "Debian" + , ARTIFACT: "x86_64-linux-deb12" + }, + { image: "ubuntu:20.04" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" + , DISTRO: "Ubuntu" + , ARTIFACT: "x86_64-linux-ubuntu20.04" + }, + { image: "ubuntu:22.04" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" + , DISTRO: "Ubuntu" + , ARTIFACT: "x86_64-linux-ubuntu22.04" + }, + { image: "ubuntu:24.04" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools_ncurses6 }}" + , DISTRO: "Ubuntu" + , ARTIFACT: "x86_64-linux-ubuntu24.04" + }, + { image: "fedora:33" + , installCmd: "dnf install -y" + , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" + , DISTRO: "Fedora" + , ARTIFACT: "x86_64-linux-fedora33" + }, + { image: "fedora:36" + , installCmd: "dnf install -y" + , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" + , DISTRO: "Fedora" + , ARTIFACT: "x86_64-linux-fedora36" + }, + { image: "fedora:38" + , installCmd: "dnf install -y" + , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" + , DISTRO: "Fedora" + , ARTIFACT: "x86_64-linux-fedora38" + }, + { image: "rockylinux:8" + , installCmd: "yum -y install epel-release && yum install -y --allowerasing" + , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-rocky8" + }, + { image: "alpine:3.20" + , installCmd: "apk update && apk add" + , toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-unknown" + }, + { image: "alpine:3.12" + , installCmd: "apk update && apk add" + , toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-alpine312" + }, + { image: "alpine:3.20" + , installCmd: "apk update && apk add" + , toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}" + , DISTRO: "Unknown" + , ARTIFACT: "x86_64-linux-alpine320" + } + ] + container: + image: ${{ matrix.platform.image }} + steps: + - name: Install requirements + shell: sh + run: | + ${{ matrix.platform.installCmd }} curl bash git ${{ matrix.platform.toolRequirements }} + + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + # Test suite uses 'git' to find the test files. That appears + # to cause problems in CI. A similar hack is employed in the validate + # pipeline. + - name: git clone fix + run: git config --system --add safe.directory $GITHUB_WORKSPACE + + - name: Install GHCup + uses: haskell/ghcup-setup@v1 + with: + cabal: ${{ env.CABAL_VERSION }} + + - uses: ./.github/actions/download + with: + name: artifacts-${{ matrix.platform.ARTIFACT }}-${{ matrix.branch }} + path: ./out + + - name: Run test + run: | + bash .github/scripts/test.bash + env: + ARTIFACT: ${{ matrix.platform.ARTIFACT }} + DISTRO: ${{ matrix.platform.DISTRO }} + ADD_CABAL_ARGS: ${{ matrix.platform.ADD_CABAL_ARGS }} + +# TODO: https://github.com/haskell/cabal/issues/11049 + test-linux-32bit: + name: Test linux binaries (32bit) + runs-on: ubuntu-latest + needs: ["build-linux-32bit"] + if: $ {{ inputs.test }} + env: + TARBALL_EXT: tar.xz + ARCH: 32 + DISTRO: "Unknown" + ARTIFACT: "i386-linux-unknown" + ADD_CABAL_ARGS: "" + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - uses: ./.github/actions/download + with: + name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} + path: ./out + + - name: Run build (32 bit linux) + uses: docker://i386/alpine:3.20 + with: + args: sh -c "apk update && apk add curl bash git ${{ needs.tool-output.outputs.apk_tools }} groff && git config --system --add safe.directory $GITHUB_WORKSPACE && export PATH=$HOME/.ghcup/bin:$PATH && curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && ghcup install cabal ${{ env.CABAL_VERSION }} && bash .github/scripts/build.bash" + + test-arm: + name: Test ARM binary + runs-on: ubuntu-22.04-arm + needs: ["tool-output", "build-arm"] + if: ${{ inputs.test }} + env: + ADD_CABAL_ARGS: "" + TARBALL_EXT: tar.xz + ARCH: ARM64 + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + platform: [ { ARCH: "ARM64" + , DISTRO: "Debian" + , ARTIFACT: "aarch64-linux-deb11" + }, + { ARCH: "ARM64" + , DISTRO: "Alpine" + , ARTIFACT: "aarch64-linux-unknown" + } + ] + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - uses: ./.github/actions/download + with: + name: artifacts-${{ matrix.platform.ARTIFACT }}-${{ matrix.branch }} + path: ./out + + - if: matrix.platform.DISTRO == 'Debian' + uses: docker://arm64v8/debian:11 + name: Run build (aarch64 linux) + with: + args: sh -c "apt-get update && apt-get install -y curl bash git groff-base ${{ needs.tool-output.outputs.apt_tools }} && git config --system --add safe.directory $GITHUB_WORKSPACE && export PATH=$HOME/.ghcup/bin:$PATH && curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && ghcup install cabal ${{ env.CABAL_VERSION }} && bash .github/scripts/test.bash" + env: + ARTIFACT: ${{ matrix.platform.ARTIFACT }} + DISTRO: ${{ matrix.platform.DISTRO }} + + - if: matrix.platform.DISTRO == 'Alpine' + uses: docker://arm64v8/alpine:3.20 + name: Run build (aarch64 linux alpine) + with: + args: sh -c "apk update && apk add curl bash git groff ${{ needs.tool-output.outputs.apk_tools }} && git config --system --add safe.directory $GITHUB_WORKSPACE && export PATH=$HOME/.ghcup/bin:$PATH && curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && ghcup install cabal ${{ env.CABAL_VERSION }} && bash .github/scripts/test.bash" + env: + ARTIFACT: ${{ matrix.platform.ARTIFACT }} + DISTRO: ${{ matrix.platform.DISTRO }} + + test-mac-x86_64: + name: Test binary (Mac x86_64) + runs-on: macOS-13 + needs: ["build-mac-x86_64"] + if: ${{ inputs.test }} + env: + ADD_CABAL_ARGS: "" + MACOSX_DEPLOYMENT_TARGET: 10.13 + ARTIFACT: "x86_64-apple-darwin" + ARCH: 64 + TARBALL_EXT: tar.xz + DISTRO: na + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - uses: ./.github/actions/download + with: + name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} + path: ./out + + - name: Install GHCup + uses: haskell/ghcup-setup@v1 + with: + cabal: ${{ env.CABAL_VERSION }} + + - name: Run test + run: | + # cabal-testsuite/PackageTests/Configure/cabal.test.hs needs it + # and it doesn't appear pre-installed here + brew install autoconf automake + + bash .github/scripts/test.bash + + test-mac-aarch64: + name: Test binary (Mac aarch64) + runs-on: macos-latest + needs: ["build-mac-aarch64"] + if: ${{ inputs.test }} + env: + ADD_CABAL_ARGS: "" + MACOSX_DEPLOYMENT_TARGET: 10.13 + ARTIFACT: "aarch64-apple-darwin" + ARCH: ARM64 + TARBALL_EXT: tar.xz + DISTRO: na + HOMEBREW_CHANGE_ARCH_TO_ARM: 1 + GHCUP_INSTALL_BASE_PREFIX: ${{ github.workspace }} + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - uses: ./.github/actions/download + with: + name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} + path: ./out + + - name: Install GHCup + uses: haskell/ghcup-setup@v1 + with: + cabal: ${{ env.CABAL_VERSION }} + + - name: Run test + run: | + bash .github/scripts/test.bash + + test-win: + name: Test binary (Win) + runs-on: windows-latest + needs: ["build-win"] + if: ${{ inputs.test }} + env: + ADD_CABAL_ARGS: "" + ARTIFACT: "x86_64-mingw64" + ARCH: 64 + TARBALL_EXT: "zip" + DISTRO: na + CABAL_DIR: "C:\\Users\\runneradmin\\AppData\\Roaming\\cabal" + GHCUP_INSTALL_BASE_PREFIX: "/c" + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - name: install windows deps + shell: pwsh + run: | + C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -Syuu" + C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -Syuu" + C:\msys64\usr\bin\bash -lc "pacman --disable-download-timeout --noconfirm -S make mingw-w64-x86_64-clang curl autoconf mingw-w64-x86_64-pkgconf ca-certificates base-devel gettext autoconf make libtool automake python p7zip patch unzip zip git" + taskkill /F /FI "MODULES eq msys-2.0.dll" + + - uses: ./.github/actions/download + with: + name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} + path: ./out + + - name: Install GHCup + uses: haskell/ghcup-setup@v1 + with: + cabal: ${{ env.CABAL_VERSION }} + + - name: Run test (windows) + run: | + $env:CHERE_INVOKING = 1 + $env:MSYS2_PATH_TYPE = "inherit" + $ErrorActionPreference = "Stop" + C:\msys64\usr\bin\bash -lc "bash .github/scripts/test.bash" + shell: pwsh + diff --git a/cabal-install-solver/cabal-install-solver.cabal b/cabal-install-solver/cabal-install-solver.cabal index 17e9938a46e..a222410efa0 100644 --- a/cabal-install-solver/cabal-install-solver.cabal +++ b/cabal-install-solver/cabal-install-solver.cabal @@ -107,7 +107,7 @@ library , containers >=0.5.6.2 && <0.9 , edit-distance ^>= 0.2.2 , directory >= 1.3.7.0 && < 1.4 - , filepath ^>=1.4.0.0 || ^>=1.5.0.0 + , filepath >= 1.3.0.1 && < 1.6 , mtl >=2.0 && <2.4 , network-uri >= 2.6.0.2 && < 2.7 , pretty ^>=1.1 diff --git a/cabal.release.project b/cabal.release.project index db9c4f305e2..8fd3d83a188 100644 --- a/cabal.release.project +++ b/cabal.release.project @@ -7,7 +7,26 @@ index-state: hackage.haskell.org 2025-06-27T20:43:14Z -- never include this or its TH dependency in a release! package cabal-install - flags: -git-rev + flags: -git-rev -lukko package Cabal flags: -git-rev + +constraints: + -- don't use `-march=native` (for portability) + hashable -arch-native, + -- fixes unicode issues + tar >= 0.6.2.0, + -- https://github.com/haskell/directory/issues/170 + directory >= 1.3.8.3, + -- avoid deprecated versions + filepath == 1.4.101.0 || == 1.4.300.1 || == 1.4.300.2 || == 1.4.301.0 || >= 1.5.2.0 + +-- https://github.com/haskell/ghcup-hs/issues/1107 +-- https://github.com/haskell/unix/pull/318 +if arch(arm) || arch(i386) + constraints: unix >= 2.8.6.0 + +-- static linking +package zlib + flags: -pkg-config +bundled-c-zlib diff --git a/scripts/release/create-release-metadata-for-ghcup.sh b/scripts/release/create-release-metadata-for-ghcup.sh index 6cf3415ce75..210afade4be 100755 --- a/scripts/release/create-release-metadata-for-ghcup.sh +++ b/scripts/release/create-release-metadata-for-ghcup.sh @@ -1,114 +1,95 @@ -#!/usr/bin/env bash +#!/bin/sh -# This script, when passed the cabal release number as the first and only argument -# generates the metadata in the correct format to be useable as is by GHCup -# for eg:- -# $ create-release-metadata-for-ghcup.sh 3.10.2.0 or "3.10.2.0" - -# Note:- Please run ./download-cabal-install-release-binaries.sh before running this script. set -eu set -o pipefail RELEASE=$1 -## FixMe:// What dir to use here? +VERSION=${RELEASE#cabal-install-v} +YV=$(echo "$VERSION" | sed 's/\.//g') + +cd "gh-release-artifacts/cabal-${VERSION}" + +BASE_URL=https://downloads.haskell.org/~cabal/cabal-install-$VERSION -if [ -d "binary-downloads/cabal-install-${RELEASE}-binaries" ]; then - echo "binary downloads folder for release ${RELEASE} found, starting generating GHCup metadata..." -else - echo "The binary downloads for release ${RELEASE} not found." - echo "Please run the script to download them first." -fi +get_sha() { + sha256sum "$1" | awk '{ print $1 }' +} -cd "binary-downloads/cabal-install-${RELEASE}-binaries" +print_uri_hash() { +cat < /dev/stdout + dlUri: ${BASE_URL}/$1 + dlHash: $(get_sha "$1") +EOF_INNER +} cat < /dev/stdout - $RELEASE: + $VERSION: viTags: - Latest viChangeLog: https://github.com/haskell/cabal/blob/master/release-notes/cabal-install-$RELEASE.md # uncomment viPostInstall if the release needs a post-install message - # viPostInstall: &cabal-${RELEASE//./}-post-install | + # viPostInstall: &cabal-${YV}-post-install | viArch: A_64: - Linux_UnknownLinux: - unknown_versioning: &cabal-${RELEASE//./}-64 - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-linux-alpine3_12.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-linux-alpine3_12.tar.xz" | awk '{ print $1 }') Linux_Alpine: - unknown_versioning: *cabal-${RELEASE//./}-64 - Linux_CentOS: - unknown_versioning: &cabal-${RELEASE//./}-64-centos7 - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-linux-centos7.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-linux-centos7.tar.xz" | awk '{ print $1 }') + '( >= 3.12 && < 3.20)': &cabal-${YV}-alpine312-64 +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-alpine312.tar.xz") + '>= 3.20': +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-alpine320.tar.xz") + unknown_versioning: *cabal-${YV}-alpine312-64 + Linux_UnknownLinux: + unknown_versioning: +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-unknown.tar.xz") Linux_Debian: - '( >= 9 && < 10)': &cabal-${RELEASE//./}-64-debian - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-linux-deb9.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-linux-deb9.tar.xz" | awk '{ print $1 }') - '( == 10 && < 11)': - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-linux-deb10.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-linux-deb10.tar.xz" | awk '{ print $1 }') - '( >= 11)': - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-linux-deb11.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-linux-deb11.tar.xz" | awk '{ print $1 }') - unknown_versioning: *cabal-${RELEASE//./}-64-debian + '( >= 11 && < 12)': &cabal-${YV}-64-debian11 +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-deb11.tar.xz") + '( >= 12 && < 13)': +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-deb12.tar.xz") + unknown_versioning: *cabal-${YV}-64-debian11 Linux_Fedora: - '>= 33': - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-linux-fedora33.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-linux-fedora33.tar.xz" | awk '{ print $1 }') - unknown_versioning: *cabal-${RELEASE//./}-64-centos7 + '( >= 33 && < 36 )': &cabal-${YV}-64-fedora33 +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-fedora33.tar.xz") + '( >= 36 && < 38 )': +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-fedora36.tar.xz") + '>= 38': +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-fedora38.tar.xz") + unknown_versioning: *cabal-${YV}-64-fedora33 Linux_Ubuntu: - '< 20': &cabal-${RELEASE//./}-64-ubuntu18 - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-linux-ubuntu18_04.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-linux-ubuntu18_04.tar.xz" | awk '{ print $1 }') - '>= 20': &cabal-${RELEASE//./}-64-ubuntu20 - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-linux-ubuntu20_04.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-linux-ubuntu20_04.tar.xz" | awk '{ print $1 }') - unknown_versioning: *cabal-${RELEASE//./}-64-ubuntu18 + '(>= 20 && < 22 )': &cabal-${YV}-64-ubuntu20 +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-ubuntu20.04.tar.xz") + '(>= 22 && < 24 )': +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-ubuntu22.04.tar.xz") + '(>= 24 && < 26 )': +$(print_uri_hash "cabal-install-$VERSION-x86_64-linux-ubuntu24.04.tar.xz") + unknown_versioning: *cabal-${YV}-64-ubuntu20 Linux_Mint: - '< 20': *cabal-${RELEASE//./}-64-ubuntu18 - '>= 20': *cabal-${RELEASE//./}-64-ubuntu20 - unknown_versioning: *cabal-${RELEASE//./}-64-ubuntu18 + unknown_versioning: *cabal-${YV}-64-ubuntu20 Darwin: unknown_versioning: - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-darwin.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-darwin.tar.xz" | awk '{ print $1 }') +$(print_uri_hash "cabal-install-$VERSION-x86_64-darwin.tar.xz") Windows: unknown_versioning: - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-windows.zip - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-windows.zip" | awk '{ print $1 }') +$(print_uri_hash "cabal-install-$VERSION-x86_64-mingw64.zip") FreeBSD: unknown_versioning: - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-x86_64-freebsd-14.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-x86_64-freebsd-14.tar.xz" | awk '{ print $1 }') +$(print_uri_hash "cabal-install-$VERSION-x86_64-portbld-freebsd.tar.xz") A_32: Linux_UnknownLinux: - unknown_versioning: &cabal-${RELEASE//./}-32 - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-i386-linux-alpine3_12.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-i386-linux-alpine3_12.tar.xz" | awk '{ print $1 }') + unknown_versioning: &cabal-${YV}-32 +$(print_uri_hash "cabal-install-$VERSION-i386-linux-unknown.tar.xz") Linux_Alpine: - unknown_versioning: *cabal-${RELEASE//./}-32 - Linux_Debian: - '( >= 9 )': - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-i386-linux-deb9.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-i386-linux-deb9.tar.xz" | awk '{ print $1 }') - unknown_versioning: *cabal-${RELEASE//./}-32 + unknown_versioning: *cabal-${YV}-32 A_ARM64: Darwin: unknown_versioning: - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-aarch64-darwin.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-aarch64-darwin.tar.xz" | awk '{ print $1 }') +$(print_uri_hash "cabal-install-$VERSION-aarch64-darwin.tar.xz") Linux_Debian: - '( >= 10 && < 11)': &cabal-${RELEASE//./}-arm64 - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-aarch64-linux-deb10.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-aarch64-linux-deb10.tar.xz" | awk '{ print $1 }') - '( >= 11)': - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-aarch64-linux-deb11.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-aarch64-linux-deb11.tar.xz" | awk '{ print $1 }') - unknown_versioning: *cabal-${RELEASE//./}-arm64 - Linux_Alpine: - unknown_versioning: - dlUri: https://downloads.haskell.org/~cabal/cabal-install-$RELEASE/cabal-install-$RELEASE-aarch64-linux-alpine3_18.tar.xz - dlHash: $(sha256sum "cabal-install-$RELEASE-aarch64-linux-alpine3_18.tar.xz" | awk '{ print $1 }') + '( >= 11)': &cabal-${YV}-arm64-deb +$(print_uri_hash "cabal-install-$VERSION-aarch64-linux-deb11.tar.xz") + unknown_versioning: *cabal-${YV}-arm64-deb Linux_UnknownLinux: - unknown_versioning: *cabal-${RELEASE//./}-arm64 + unknown_versioning: &cabal-${YV}-arm64 +$(print_uri_hash "cabal-install-$VERSION-aarch64-linux-unknown.tar.xz") + Linux_Alpine: + unknown_versioning: *cabal-${YV}-arm64 EOF diff --git a/scripts/release/download-cabal-install-release-binaries.sh b/scripts/release/download-cabal-install-release-binaries.sh deleted file mode 100755 index 4547fd910e8..00000000000 --- a/scripts/release/download-cabal-install-release-binaries.sh +++ /dev/null @@ -1,42 +0,0 @@ -#!/usr/bin/env bash - -# A script to download the release binary files for a given cabal release -# from upstream "downlods.haskell.org". -# It accepts the first and only argument as the release number. -# -# useage:- -# $ download-cabal-install-release-binaries.sh "3.10.1.0" -# -# This was initally made to be used with ./create-release-metadata-for-ghcup.sh - -set -eu -set -o pipefail - -RELEASE=$1 - -echo "RELEASE: $RELEASE" - -for com in wget sha256sum ; do - command -V ${com} >/dev/null 2>&1 -done - -[ ! -d "binary-downloads/cabal-install-${RELEASE}-binaries" ] - -mkdir -p "binary-downloads/cabal-install-${RELEASE}-binaries" - -cd "binary-downloads/cabal-install-${RELEASE}-binaries" - -## Download release files -echo "Downloading form: \"https://downloads.haskell.org/~cabal/cabal-install-${RELEASE}/\"" -wget --no-parent -r --reject "index.html*" --no-directories "https://downloads.haskell.org/~cabal/cabal-install-${RELEASE}/" - -## Verify that sha256 sums of downloaded files match the ones mentioned in the upstream SHA256SUMS file -echo "verifying checksums for downloaded files..." - -if sha256sum --check ./SHA256SUMS; then - echo "All checksums match!" - echo "Successfully downloaded binaries for release: ${RELEASE}" -else - echo "checksums of downloaded files do no match the ones listed in upstream SHA256SUMS file." - echo "please try deleting \"binary-downloads/cabal-install-${RELEASE}-binaries\" folder and downloading again." -fi diff --git a/scripts/release/download-gh-artifacts.sh b/scripts/release/download-gh-artifacts.sh new file mode 100755 index 00000000000..462840603b8 --- /dev/null +++ b/scripts/release/download-gh-artifacts.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +set -eu +set -o pipefail + +RELEASE=$1 +VERSION=${RELEASE#cabal-install-v} +SIGNER=$2 + +echo "RELEASE: $RELEASE" +echo "SIGNER: $SIGNER" + +for com in gh gpg curl sha256sum ; do + command -V ${com} >/dev/null 2>&1 +done + +[ ! -e "gh-release-artifacts/cabal-${VERSION}" ] + +mkdir -p "gh-release-artifacts/cabal-${VERSION}" + +git archive --format=tar.gz -o "gh-release-artifacts/cabal-${VERSION}/cabal-${VERSION}-src.tar.gz" --prefix="cabal-${VERSION}/" HEAD + +cd "gh-release-artifacts/cabal-${VERSION}" + +# github +gh release download "$RELEASE" + +sha256sum ./* > SHA256SUMS +gpg --detach-sign -u "${SIGNER}" SHA256SUMS + +echo +echo "Now run the following:" +echo " ( cd gh-release-artifacts/cabal-${VERSION} && gh release upload $RELEASE cabal-${VERSION}-src.tar.gz SHA256SUMS SHA256SUMS.sig )" +echo +echo "And afterwards to upload to downloads.haskell.org:" +echo " ./scripts/release/sftp-upload-artifacts.sh cabal-install-v${VERSION}" +echo +echo "And don't forget to finalize the release at https://github.com/stable-haskell/cabal/releases/tag/cabal-install-v${VERSION}" +echo +echo "Also create a PR at https://github.com/haskell/ghcup-metadata/pulls for the vanilla-channel from the output of the following script:" +echo " ./scripts/release/create-yaml-snippet.sh cabal-install-v${VERSION}" + diff --git a/scripts/release/sftp-upload-artifacts.sh b/scripts/release/sftp-upload-artifacts.sh new file mode 100755 index 00000000000..f4b1b20eaf1 --- /dev/null +++ b/scripts/release/sftp-upload-artifacts.sh @@ -0,0 +1,22 @@ +#!/bin/sh + +set -eu +set -o pipefail + +RELEASE=$1 +VERSION=${RELEASE#cabal-install-v} +URL=https://downloads.haskell.org + +cd "gh-release-artifacts/cabal-${VERSION}" + +sftp $URL < Date: Mon, 7 Jul 2025 18:07:27 +0800 Subject: [PATCH 12/18] Skip T5634 on Alpine See https://github.com/haskell/cabal/issues/11041 --- .../PackageTests/Backpack/T5634/setup.test.hs | 5 ++++- cabal-testsuite/cabal-testsuite.cabal | 1 + cabal-testsuite/src/Test/Cabal/Prelude.hs | 10 ++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/cabal-testsuite/PackageTests/Backpack/T5634/setup.test.hs b/cabal-testsuite/PackageTests/Backpack/T5634/setup.test.hs index d897955dd74..d12ab76f136 100644 --- a/cabal-testsuite/PackageTests/Backpack/T5634/setup.test.hs +++ b/cabal-testsuite/PackageTests/Backpack/T5634/setup.test.hs @@ -1,5 +1,8 @@ import Test.Cabal.Prelude -main = setupAndCabalTest $ do +main = do + -- TODO: this might be a GHC bug that needs fixing + skipIfAlpine "bug #11041" + setupAndCabalTest $ do skipUnlessGhcVersion ">= 8.1" setup "configure" [] setup "build" [] diff --git a/cabal-testsuite/cabal-testsuite.cabal b/cabal-testsuite/cabal-testsuite.cabal index b59e8dbf8da..50ea756fcdf 100644 --- a/cabal-testsuite/cabal-testsuite.cabal +++ b/cabal-testsuite/cabal-testsuite.cabal @@ -75,6 +75,7 @@ library , network-uri >= 2.6.0.2 && < 2.7 , network-wait ^>= 0.1.2.0 || ^>= 0.2.0.0 , optparse-applicative ^>= 0.14.3.0 || ^>=0.15.1.0 || ^>=0.16.0.0 || ^>= 0.17.0.0 || ^>= 0.18.1.0 + , os-release ^>= 1.0.2.1 , process ^>= 1.2.1.0 || ^>= 1.4.2.0 || ^>= 1.6.1.0 , regex-base ^>= 0.94.0.1 , regex-tdfa ^>= 1.2.3.1 || ^>=1.3.1.0 diff --git a/cabal-testsuite/src/Test/Cabal/Prelude.hs b/cabal-testsuite/src/Test/Cabal/Prelude.hs index 3a12298608c..c85f1205fc7 100644 --- a/cabal-testsuite/src/Test/Cabal/Prelude.hs +++ b/cabal-testsuite/src/Test/Cabal/Prelude.hs @@ -75,6 +75,7 @@ import Control.Retry (exponentialBackoff, limitRetriesByCumulativeDelay) import Network.Wait (waitTcpVerbose) import System.Environment import qualified System.FilePath.Glob as Glob (globDir1, compile) +import qualified System.OsRelease as OSR import System.Process import System.IO import qualified System.FilePath.Posix as Posix @@ -1079,6 +1080,15 @@ isJavaScript = buildArch == JavaScript skipIfWindows :: String -> IO () skipIfWindows why = skipIfIO ("Windows " <> why) isWindows +skipIfAlpine :: String -> IO () +skipIfAlpine why = do + mres <- OSR.parseOsRelease + let b = case mres of + Just (OSR.OsReleaseResult { OSR.osRelease = OSR.OsRelease { OSR.id = osId } }) + | isLinux -> osId == "alpine" + _ -> False + skipIfIO ("Alpine " <> why) b + skipUnlessWindows :: IO () skipUnlessWindows = skipIfIO "Only interesting in Windows" (not isWindows) From 2cc8a0bdaad9bd5638d03414ce247ff6d7a7378c Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Fri, 18 Jul 2025 15:18:28 +0800 Subject: [PATCH 13/18] Disable 32bit test --- .github/workflows/reusable-release.yml | 58 +++++++++++++------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/reusable-release.yml b/.github/workflows/reusable-release.yml index b5000eba2a8..b7cdb662f1a 100644 --- a/.github/workflows/reusable-release.yml +++ b/.github/workflows/reusable-release.yml @@ -535,35 +535,35 @@ jobs: ADD_CABAL_ARGS: ${{ matrix.platform.ADD_CABAL_ARGS }} # TODO: https://github.com/haskell/cabal/issues/11049 - test-linux-32bit: - name: Test linux binaries (32bit) - runs-on: ubuntu-latest - needs: ["build-linux-32bit"] - if: $ {{ inputs.test }} - env: - TARBALL_EXT: tar.xz - ARCH: 32 - DISTRO: "Unknown" - ARTIFACT: "i386-linux-unknown" - ADD_CABAL_ARGS: "" - strategy: - fail-fast: false - matrix: - branch: ${{ fromJSON(inputs.branches) }} - steps: - - uses: actions/checkout@v4 - with: - ref: ${{ matrix.branch }} - - - uses: ./.github/actions/download - with: - name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} - path: ./out - - - name: Run build (32 bit linux) - uses: docker://i386/alpine:3.20 - with: - args: sh -c "apk update && apk add curl bash git ${{ needs.tool-output.outputs.apk_tools }} groff && git config --system --add safe.directory $GITHUB_WORKSPACE && export PATH=$HOME/.ghcup/bin:$PATH && curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && ghcup install cabal ${{ env.CABAL_VERSION }} && bash .github/scripts/build.bash" +# test-linux-32bit: +# name: Test linux binaries (32bit) +# runs-on: ubuntu-latest +# needs: ["build-linux-32bit"] +# if: $ {{ inputs.test }} +# env: +# TARBALL_EXT: tar.xz +# ARCH: 32 +# DISTRO: "Unknown" +# ARTIFACT: "i386-linux-unknown" +# ADD_CABAL_ARGS: "" +# strategy: +# fail-fast: false +# matrix: +# branch: ${{ fromJSON(inputs.branches) }} +# steps: +# - uses: actions/checkout@v4 +# with: +# ref: ${{ matrix.branch }} +# +# - uses: ./.github/actions/download +# with: +# name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} +# path: ./out +# +# - name: Run build (32 bit linux) +# uses: docker://i386/alpine:3.20 +# with: +# args: sh -c "apk update && apk add curl bash git ${{ needs.tool-output.outputs.apk_tools }} groff && git config --system --add safe.directory $GITHUB_WORKSPACE && export PATH=$HOME/.ghcup/bin:$PATH && curl --proto '=https' --tlsv1.2 -sSf https://get-ghcup.haskell.org | sh && ghcup install cabal ${{ env.CABAL_VERSION }} && bash .github/scripts/build.bash" test-arm: name: Test ARM binary From 96cd816a26ed8d5f90a37182c5029ef86a7a99bf Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Fri, 18 Jul 2025 15:28:32 +0800 Subject: [PATCH 14/18] Add FreeBSD releases --- .github/workflows/reusable-release.yml | 85 ++++++++++++++++++++++++++ 1 file changed, 85 insertions(+) diff --git a/.github/workflows/reusable-release.yml b/.github/workflows/reusable-release.yml index b7cdb662f1a..9c2e738ab9c 100644 --- a/.github/workflows/reusable-release.yml +++ b/.github/workflows/reusable-release.yml @@ -412,6 +412,50 @@ jobs: path: | ./out/* + build-freebsd-x86_64: + name: Build FreeBSD x86_64 + runs-on: [self-hosted, FreeBSD, X64] + env: + ADD_CABAL_ARGS: "" + ARTIFACT: "x86_64-portbld-freebsd" + ARCH: 64 + TARBALL_EXT: tar.xz + DISTRO: na + RUNNER_OS: FreeBSD + CABAL_DIR: ${{ github.workspace }}/.cabal + GHCUP_INSTALL_BASE_PREFIX: ${{ github.workspace }} + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - name: Install GHCup + uses: haskell/ghcup-setup@v1 + with: + cabal: ${{ env.CABAL_VERSION }} + + - name: Run build + run: | + sudo sed -i.bak -e 's/quarterly/latest/' /etc/pkg/FreeBSD.conf + sudo pkg install -y curl gcc gmp gmake ncurses perl5 pkgconf libffi libiconv git bash misc/compat10x misc/compat11x misc/compat12x + sudo tzsetup Etc/GMT + sudo adjkerntz -a + bash .github/scripts/build.bash + + - if: always() + name: Upload artifact + uses: ./.github/actions/upload + with: + if-no-files-found: error + retention-days: 2 + name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} + path: | + ./out/* + test-linux: name: Test linux binaries runs-on: ubuntu-latest @@ -739,3 +783,44 @@ jobs: C:\msys64\usr\bin\bash -lc "bash .github/scripts/test.bash" shell: pwsh + test-freebsd-x86_64: + name: Test FreeBSD x86_64 + runs-on: [self-hosted, FreeBSD, X64] + needs: ["build-freebsd-x86_64"] + if: ${{ inputs.test }} + env: + ADD_CABAL_ARGS: "" + ARTIFACT: "x86_64-portbld-freebsd" + ARCH: 64 + TARBALL_EXT: tar.xz + DISTRO: na + RUNNER_OS: FreeBSD + CABAL_DIR: ${{ github.workspace }}/.cabal + GHCUP_INSTALL_BASE_PREFIX: ${{ github.workspace }} + strategy: + fail-fast: false + matrix: + branch: ${{ fromJSON(inputs.branches) }} + steps: + - uses: actions/checkout@v4 + with: + ref: ${{ matrix.branch }} + + - uses: ./.github/actions/download + with: + name: artifacts-${{ env.ARTIFACT }}-${{ matrix.branch }} + path: ./out + + - name: Install GHCup + uses: haskell/ghcup-setup@v1 + with: + cabal: ${{ env.CABAL_VERSION }} + + - name: Run test + run: | + sudo sed -i.bak -e 's/quarterly/latest/' /etc/pkg/FreeBSD.conf + sudo pkg install -y curl gcc gmp gmake ncurses perl5 pkgconf libffi libiconv git bash misc/compat10x misc/compat11x misc/compat12x groff autoconf automake + sudo tzsetup Etc/GMT + sudo adjkerntz -a + bash .github/scripts/test.bash + From 74386aaec846dee140839073789291f4ee3e2e15 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Tue, 22 Jul 2025 14:39:44 +0800 Subject: [PATCH 15/18] Downstreamify --- .github/workflows/release.yaml | 3 ++- .github/workflows/reusable-release.yml | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1a7343ba760..ced5fad34d6 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -2,11 +2,12 @@ name: Build and release on: push: + branches: + - master tags: - 'v*' - 'cabal-install-*' pull_request: - types: [opened, synchronize, reopened, labeled] branches: - master schedule: diff --git a/.github/workflows/reusable-release.yml b/.github/workflows/reusable-release.yml index 9c2e738ab9c..2daf76b06af 100644 --- a/.github/workflows/reusable-release.yml +++ b/.github/workflows/reusable-release.yml @@ -8,12 +8,12 @@ on: type: string ghc: type: string - default: 9.10.2 + default: 9.6.7 # speed up installation by skipping docs # starting with GHC 9.10.x, we also need to pass the 'install_extra' target ghc_targets: type: string - default: "install_bin install_lib update_package_db install_extra" + default: "install_bin install_lib update_package_db" cabal: type: string default: 3.14.2.0 From 9dcc0eaaebc1c53abb0a19e0883534f2837fbf19 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Tue, 15 Jul 2025 19:12:11 +0800 Subject: [PATCH 16/18] Do nightly release --- .github/workflows/release.yaml | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index ced5fad34d6..0625eff8717 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -57,8 +57,12 @@ jobs: name: release needs: [ "release-workflow" ] runs-on: ubuntu-latest - if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' }} + if: ${{ startsWith(github.ref, 'refs/tags/') || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' }} steps: + - name: Get current date + id: date + run: echo "NIGHTLY_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV + - name: Checkout code uses: actions/checkout@v4 @@ -86,3 +90,12 @@ jobs: files: | ./out/* + - name: Release nightly + if: ${{ github.event_name == 'schedule' }} + uses: softprops/action-gh-release@v1 + with: + tag_name: nightly-${{ env.NIGHTLY_DATE }} + draft: false + prerelease: true + files: | + ./out/* From 5e72db5cb8d863a1bb22ea059e9ca1326674ff85 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Mon, 21 Jul 2025 11:35:33 +0800 Subject: [PATCH 17/18] Only build 2 flavors of linux binaries - glibc (dynamic) - musl (fully static) 'gmp' and 'zlib' are always statically linked. --- .github/workflows/reusable-release.yml | 155 ++++++++++--------------- 1 file changed, 64 insertions(+), 91 deletions(-) diff --git a/.github/workflows/reusable-release.yml b/.github/workflows/reusable-release.yml index 2daf76b06af..5b6e07d0efd 100644 --- a/.github/workflows/reusable-release.yml +++ b/.github/workflows/reusable-release.yml @@ -14,6 +14,9 @@ on: ghc_targets: type: string default: "install_bin install_lib update_package_db" + gmp: + type: string + default: 6.3.0 cabal: type: string default: 3.14.2.0 @@ -30,6 +33,7 @@ env: GHC_TEST_VERSION: 9.6.7 GHC_TEST_TARGETS: "install_bin install_lib update_package_db" CABAL_VERSION: ${{ inputs.cabal }} + GMP_VERSION: ${{ inputs.gmp }} BOOTSTRAP_HASKELL_NONINTERACTIVE: 1 BOOTSTRAP_HASKELL_MINIMAL: 1 DEBIAN_FRONTEND: noninteractive @@ -70,89 +74,19 @@ jobs: fail-fast: false matrix: branch: ${{ fromJSON(inputs.branches) }} - platform: [ { image: "debian:11" - , installCmd: "apt-get update && apt-get install -y" - , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" - , DISTRO: "Debian" - , ARTIFACT: "x86_64-linux-deb11" - , ADD_CABAL_ARGS: "--enable-split-sections" - }, - { image: "debian:12" - , installCmd: "apt-get update && apt-get install -y" - , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" - , DISTRO: "Debian" - , ARTIFACT: "x86_64-linux-deb12" - , ADD_CABAL_ARGS: "--enable-split-sections" - }, - { image: "ubuntu:20.04" - , installCmd: "apt-get update && apt-get install -y" - , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" - , DISTRO: "Ubuntu" - , ARTIFACT: "x86_64-linux-ubuntu20.04" - , ADD_CABAL_ARGS: "--enable-split-sections" - }, - { image: "ubuntu:22.04" - , installCmd: "apt-get update && apt-get install -y" - , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" - , DISTRO: "Ubuntu" - , ARTIFACT: "x86_64-linux-ubuntu22.04" - , ADD_CABAL_ARGS: "--enable-split-sections" - }, - { image: "ubuntu:24.04" - , installCmd: "apt-get update && apt-get install -y" - , toolRequirements: "${{ needs.tool-output.outputs.apt_tools_ncurses6 }}" - , DISTRO: "Ubuntu" - , ARTIFACT: "x86_64-linux-ubuntu24.04" - , ADD_CABAL_ARGS: "--enable-split-sections" - }, - { image: "fedora:33" - , installCmd: "dnf install -y" - , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" - , DISTRO: "Fedora" - , ARTIFACT: "x86_64-linux-fedora33" - , ADD_CABAL_ARGS: "--enable-split-sections" - }, - { image: "fedora:36" - , installCmd: "dnf install -y" - , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" - , DISTRO: "Fedora" - , ARTIFACT: "x86_64-linux-fedora36" - , ADD_CABAL_ARGS: "--enable-split-sections" - }, - { image: "fedora:38" - , installCmd: "dnf install -y" - , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" - , DISTRO: "Fedora" - , ARTIFACT: "x86_64-linux-fedora38" - , ADD_CABAL_ARGS: "--enable-split-sections" - }, - { image: "rockylinux:8" + platform: [ { image: "rockylinux:8" , installCmd: "yum -y install epel-release && yum install -y --allowerasing" , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" - , DISTRO: "Unknown" - , ARTIFACT: "x86_64-linux-rocky8" + , DISTRO: "Rockylinux" + , ARTIFACT: "x86_64-linux-glibc" , ADD_CABAL_ARGS: "--enable-split-sections" }, { image: "alpine:3.20" , installCmd: "apk update && apk add" , toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}" - , DISTRO: "Unknown" - , ARTIFACT: "x86_64-linux-unknown" + , DISTRO: "Alpine" + , ARTIFACT: "x86_64-linux-musl-static" , ADD_CABAL_ARGS: "--enable-split-sections --enable-executable-static" - }, - { image: "alpine:3.12" - , installCmd: "apk update && apk add" - , toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}" - , DISTRO: "Unknown" - , ARTIFACT: "x86_64-linux-alpine312" - , ADD_CABAL_ARGS: "--enable-split-sections" - }, - { image: "alpine:3.20" - , installCmd: "apk update && apk add" - , toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}" - , DISTRO: "Unknown" - , ARTIFACT: "x86_64-linux-alpine320" - , ADD_CABAL_ARGS: "--enable-split-sections" } ] container: @@ -172,6 +106,19 @@ jobs: with: ref: ${{ matrix.branch }} + - name: install GMP + if: matrix.platform.DISTRO == 'Rockylinux' + run: | + set -eux + + curl -O -L https://ftp.gnu.org/gnu/gmp/gmp-${{ env.GMP_VERSION }}.tar.xz + tar xf gmp-${{ env.GMP_VERSION }}.tar.xz + cd gmp-${{ env.GMP_VERSION }} + CFLAGS=-fPIC ./configure --prefix=$HOME/.local/ --disable-shared + make install + cd .. + echo "extra-lib-dirs: $HOME/.local/lib/" >> cabal.release.project.local + - name: Run build run: | bash .github/scripts/build.bash @@ -181,6 +128,14 @@ jobs: DISTRO: ${{ matrix.platform.DISTRO }} ADD_CABAL_ARGS: ${{ matrix.platform.ADD_CABAL_ARGS }} + - name: check linking + if: matrix.platform.DISTRO == 'Rockylinux' + run: | + cd out + tar xf *.${TARBALL_EXT} + ldd cabal | grep --quiet gmp && exit 1 + rm cabal plan.json + - if: always() name: Upload artifact uses: ./.github/actions/upload @@ -473,73 +428,91 @@ jobs: , installCmd: "apt-get update && apt-get install -y" , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" , DISTRO: "Debian" - , ARTIFACT: "x86_64-linux-deb11" + , ARTIFACT: "x86_64-linux-glibc" }, { image: "debian:12" , installCmd: "apt-get update && apt-get install -y" , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" , DISTRO: "Debian" - , ARTIFACT: "x86_64-linux-deb12" + , ARTIFACT: "x86_64-linux-glibc" }, { image: "ubuntu:20.04" , installCmd: "apt-get update && apt-get install -y" , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" , DISTRO: "Ubuntu" - , ARTIFACT: "x86_64-linux-ubuntu20.04" + , ARTIFACT: "x86_64-linux-glibc" }, { image: "ubuntu:22.04" , installCmd: "apt-get update && apt-get install -y" , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" , DISTRO: "Ubuntu" - , ARTIFACT: "x86_64-linux-ubuntu22.04" + , ARTIFACT: "x86_64-linux-glibc" }, { image: "ubuntu:24.04" , installCmd: "apt-get update && apt-get install -y" , toolRequirements: "${{ needs.tool-output.outputs.apt_tools_ncurses6 }}" , DISTRO: "Ubuntu" - , ARTIFACT: "x86_64-linux-ubuntu24.04" + , ARTIFACT: "x86_64-linux-glibc" + }, + { image: "linuxmintd/mint20.3-amd64" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" + , DISTRO: "Mint" + , ARTIFACT: "x86_64-linux-glibc" + }, + { image: "linuxmintd/mint21.3-amd64" + , installCmd: "apt-get update && apt-get install -y" + , toolRequirements: "${{ needs.tool-output.outputs.apt_tools }}" + , DISTRO: "Mint" + , ARTIFACT: "x86_64-linux-glibc" }, { image: "fedora:33" , installCmd: "dnf install -y" , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" , DISTRO: "Fedora" - , ARTIFACT: "x86_64-linux-fedora33" + , ARTIFACT: "x86_64-linux-glibc" }, { image: "fedora:36" , installCmd: "dnf install -y" , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" , DISTRO: "Fedora" - , ARTIFACT: "x86_64-linux-fedora36" + , ARTIFACT: "x86_64-linux-glibc" }, { image: "fedora:38" , installCmd: "dnf install -y" , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" , DISTRO: "Fedora" - , ARTIFACT: "x86_64-linux-fedora38" + , ARTIFACT: "x86_64-linux-glibc" }, { image: "rockylinux:8" , installCmd: "yum -y install epel-release && yum install -y --allowerasing" , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" - , DISTRO: "Unknown" - , ARTIFACT: "x86_64-linux-rocky8" + , DISTRO: "Rockylinux" + , ARTIFACT: "x86_64-linux-glibc" + }, + { image: "rockylinux:9" + , installCmd: "yum -y install epel-release && yum install -y --allowerasing" + , toolRequirements: "${{ needs.tool-output.outputs.rpm_tools }}" + , DISTRO: "Rockylinux" + , ARTIFACT: "x86_64-linux-glibc" }, { image: "alpine:3.20" , installCmd: "apk update && apk add" , toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}" , DISTRO: "Unknown" - , ARTIFACT: "x86_64-linux-unknown" + , ARTIFACT: "x86_64-linux-musl-static" }, { image: "alpine:3.12" , installCmd: "apk update && apk add" , toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}" , DISTRO: "Unknown" - , ARTIFACT: "x86_64-linux-alpine312" + , ARTIFACT: "x86_64-linux-musl-static" }, - { image: "alpine:3.20" - , installCmd: "apk update && apk add" - , toolRequirements: "${{ needs.tool-output.outputs.apk_tools }}" + { image: "ghcr.io/void-linux/void-glibc:latest" + , installCmd: "xbps-install -Suy xbps && xbps-install -Sy" + , toolRequirements: "${{ needs.tool-output.outputs.xbps_tools }}" , DISTRO: "Unknown" - , ARTIFACT: "x86_64-linux-alpine320" + , ARTIFACT: "x86_64-linux-musl-static" } ] container: From 0a74ea16d75f94d282de8598fd7b244b9ab9a2e4 Mon Sep 17 00:00:00 2001 From: Julian Ospald Date: Wed, 9 Jul 2025 12:20:35 +0800 Subject: [PATCH 18/18] Add rebase CI --- .github/scripts/rebase_local.sh | 58 +++++++++++ .github/scripts/rebase_spec.sh | 167 ++++++++++++++++++++++++++++++++ .github/workflows/rebase.yaml | 156 +++++++++++++++++++++++++++++ 3 files changed, 381 insertions(+) create mode 100644 .github/scripts/rebase_local.sh create mode 100644 .github/scripts/rebase_spec.sh create mode 100644 .github/workflows/rebase.yaml diff --git a/.github/scripts/rebase_local.sh b/.github/scripts/rebase_local.sh new file mode 100644 index 00000000000..206629b4c19 --- /dev/null +++ b/.github/scripts/rebase_local.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +set -eux + +upstream_repo=$1 +# of the form [:], e.g.: +# BA:master B1:master B2:B1 B3:B2 +spec=$2 + +{ + +git remote add upstream "${upstream_repo}" || true +git fetch upstream + +output_branches=() + +# sync master with upstream +git checkout master +git reset --hard upstream/master +output_branches+=( "master" ) + +# rebase each branch +mkdir -p rebase +for branch_spec in ${spec} ; do + branch=$(echo "${branch_spec}" | awk -F ':' '{ print $1 }') + rebase_target=$(echo "${branch_spec}" | awk -F ':' '{ print $2 }') + git checkout "${branch}" + common_ancestor=$(git merge-base "${branch}" "origin/${rebase_target}") + [ -e rebase/"${branch}" ] && exit 1 + mkdir -p rebase/"${branch}" + ( + cd rebase/"${branch}" + echo "${common_ancestor}" > BASE_COMMIT + git format-patch "${common_ancestor}".."${branch}" + ) + if compgen -G rebase/"${branch}"/*.patch > /dev/null; then + git reset --hard "${rebase_target}" + git am --3way rebase/"${branch}"/*.patch + fi + output_branches+=( "${branch}" ) +done +unset branch_spec branch + +# cherry-pick on stable-master +git checkout stable-master +git reset --hard upstream/master +for branch_spec in ${spec} ; do + branch=$(echo "${branch_spec}" | awk -F ':' '{ print $1 }') + if compgen -G "rebase/${branch}"/*.patch > /dev/null; then + git am --3way "rebase/${branch}"/*.patch + fi +done +output_branches+=( "stable-master" ) + +} >&2 + +echo "${output_branches[*]}" + diff --git a/.github/scripts/rebase_spec.sh b/.github/scripts/rebase_spec.sh new file mode 100644 index 00000000000..566f3112142 --- /dev/null +++ b/.github/scripts/rebase_spec.sh @@ -0,0 +1,167 @@ +#!/bin/bash + +# Branch regex we consider for rebase targets. +# For our purposes this is usually 'stable-haskell/feature/*'. +# 'master' is always considered. +branch_regex=$1 +shift 1 +declare -a input_branches +input_branches=( "$@" ) +set -eux + +[ ${#input_branches[@]} -eq 0 ] && + input_branches=( $(gh pr list --label rebase --state open --json headRefName --jq ".[] | select( .headRefName | match(\"${branch_regex}\")) | .headRefName" --template '{{range .}}{{tablerow .headRefName}}{{end}}') ) + +branch_list=( ) +declare -A branch_map + +# @FUNCTION: die +# @USAGE: [msg] +# @DESCRIPTION: +# Exits the shell script with status code 2 +# and prints the given message in red to STDERR, if any. +die() { + (>&2 red_message "$1") + exit 2 +} + +# @FUNCTION: red_message +# @USAGE: +# @DESCRIPTION: +# Print a red message. +red_message() { + printf "\\033[0;31m%s\\033[0m\\n" "$1" +} + +# @FUNCTION: array_contains +# @USAGE: +# @DESCRIPTION: +# Checks whether the array reference contains the given value. +# @RETURN: 0 if value exists, 1 otherwise +array_contains() { + local -n arr=$1 + local val=$2 + shift 2 + if [[ " ${arr[*]} " =~ [[:space:]]${val}[[:space:]] ]]; then + return 0 + else + return 1 + fi +} + +max_backtrack=10 + +# @FUNCTION: backtrack +# @USAGE: +# @DESCRIPTION: +# Backtrack dependencies through an array list. +# E.g. given an associated array with key value pairs of: +# B1 -> M +# B2 -> B1 +# B3 -> B2 +# +# ...if we pass B3 as start_key and M as abort_value, then +# we receive the flattened ordered list "B1 B2 B3" +# @STDOUT: space separated list of backtracked values +backtrack() { + backtrack_ 0 "$1" "$2" "$3" +} + +# internal to track backtrack depth +backtrack_() { + local depth=$1 + if [[ $depth -gt $max_backtrack ]] ; then + die "Dependency backtracking too deep... aborting!" + fi + shift 1 + + if [[ $1 != map ]] ; then + local -n map=$1 + fi + + local base=$2 + local abort_value=$3 + local value + + if [ "${base}" = "${abort_value}" ] ; then + return + fi + + value=${map[$base]} + + if [ "${value}" = "${abort_value}" ] ; then + if ! array_contains branch_list "${base}" ; then + echo "${base}" + fi + else + if array_contains branch_list "${base}" ; then + backtrack_ $((depth++)) map "${map[$value]}" "${abort_value}" + else + echo "$(backtrack_ $((depth++)) map "${map[$base]}" "${abort_value}")" "${base}" + fi + fi +} + +create_branch_map() { + local -n arr=$1 + local -n discovered=$2 + local -n map=$3 + + while IFS= read -r branch || [[ -n $branch ]]; do + rebase_target=$(git branch --merged "${branch}" --sort="ahead-behind:${branch}" --format="%(refname:short)" | grep -e "${branch_regex}" -e '^master$' | awk 'NR==2{print;exit}') + + # this is the case when the branch is actually behind master... we then + # still want to rebase against master + if [ -z "${rebase_target}" ] ; then + rebase_target=master + fi + + if ! array_contains input_branches "${rebase_target}" && [ "${rebase_target}" != "master" ] ; then + discovered+=( "${rebase_target}" ) + fi + + map["${branch}"]="${rebase_target}" +done < <(printf '%s\n' "${arr[@]}") +} + +{ + +# create branch rebase tree +# we're doing that on the state of the local tree/master +newly_detected_input_branches=( ) +create_branch_map input_branches newly_detected_input_branches branch_map +# these shenanigns are needed in case the rebase target branches themselves do not have +# the 'rebase' label... this would break cherry-picking on master, so we include "parent" +# branches regardless +while true ; do + if [ ${#newly_detected_input_branches[@]} -eq 0 ] ; then + break + else + nothing=( ) + create_branch_map newly_detected_input_branches nothing branch_map + newly_detected_input_branches=( "${nothing[@]}" ) + fi +done + +} >&2 + +# flatten recursively +for key in "${!branch_map[@]}"; do + value=${branch_map[$key]} + if [ "${value}" = "master" ] ; then + if ! array_contains branch_list "${key}" ; then + branch_list+=( "${key}" ) + fi + else + # shellcheck disable=SC2207 + branch_list+=( $(backtrack branch_map "$key" "master") ) + fi +done +unset key + +result=( ) +for key in "${branch_list[@]}"; do + result+=( "${key}:${branch_map[$key]}" ) +done +echo "${result[@]}" + diff --git a/.github/workflows/rebase.yaml b/.github/workflows/rebase.yaml new file mode 100644 index 00000000000..59b1f716262 --- /dev/null +++ b/.github/workflows/rebase.yaml @@ -0,0 +1,156 @@ +name: Rebase against upstream + +on: + schedule: + - cron: '0 0 * * *' + workflow_dispatch: + +permissions: + contents: write + issues: write + pull-requests: read + +concurrency: + group: ${{ github.workflow }} + cancel-in-progress: false + +jobs: + rebase: + name: Rebase now! + runs-on: ubuntu-latest + env: + UPSTREAM_REPO: https://github.com/haskell/cabal.git + CI_BRANCH: stable-haskell/feature/rebase-CI + outputs: + rebase_output_json: ${{ steps.rebase.outputs.branches_json }} + rebase_output: ${{ steps.rebase.outputs.branches }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + + - id: rebase + name: rebase + run: | + set -eux + + git switch --detach + git fetch origin refs/heads/*:refs/heads/* + + gh repo set-default stable-haskell/cabal + git config checkout.defaultRemote origin + + # required to apply patches + git config user.email "ci@users.noreply.github.com" + git config user.name "GitHub CI" + + # this does not push + branch_spec=$(bash .github/scripts/rebase_spec.sh '^stable-haskell/feature/.*') + rebased_branches=( $(bash .github/scripts/rebase_local.sh ${{ env.UPSTREAM_REPO }} "${branch_spec}") ) + + # we use branches_json to trigger release workflow, but we don't want to do it for upstream master + echo "branches_json=$(jq --compact-output --null-input '$ARGS.positional' --args -- "${rebased_branches[@]/#/tmp\/}" | jq --compact-output 'del(.[] | select(. == "tmp/master"))')" >> "$GITHUB_OUTPUT" + # this output is used to update remote branches, so it shall include upstream master + echo "branches=${rebased_branches[*]} master" >> "$GITHUB_OUTPUT" + shell: bash + env: + GH_TOKEN: ${{ github.token }} + + - name: save branches on remote + run: | + set -eux + + for branch in ${{ steps.rebase.outputs.branches }} ; do + git checkout "${branch}" + git push -f https://${{ secrets.REBASE_PAT }}@github.com/${{ github.repository }}.git ${branch}:tmp/${branch} + done + shell: bash + env: + GH_TOKEN: ${{ github.token }} + + - if: always() + name: backup + run: | + git checkout -f master || true + git archive master > backup.tar + tar -rf backup.tar .git rebase + + - if: always() + name: Upload artifact + uses: actions/upload-artifact@v4 + with: + if-no-files-found: error + retention-days: 7 + name: backup + path: | + ./backup.tar + + - name: checkout reusable workflow + run: | + git checkout -f "${{ env.CI_BRANCH }}" + + release-workflow: + needs: ["rebase"] + uses: ./.github/workflows/reusable-release.yml + with: + branches: ${{ needs.rebase.outputs.rebase_output_json }} + ghc: "9.6.7" + cabal: "3.12.1.0" + + push-job: + runs-on: ubuntu-latest + needs: [rebase, release-workflow] + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + persist-credentials: false + + - name: update branches + run: | + set -eux + + for branch in ${{ needs.rebase.outputs.rebase_output }} ; do + git checkout "${branch}" + git push -f https://${{ secrets.REBASE_PAT }}@github.com/${{ github.repository }}.git tmp/${branch}:${branch} + done + git push -f https://${{ secrets.REBASE_PAT }}@github.com/${{ github.repository }}.git tmp/stable-master:stable-master + + shell: bash + env: + GH_TOKEN: ${{ github.token }} + + - name: delete tmp branches + if: always() + run: | + unset branch + for branch in $(git for-each-ref --format="%(refname:short)" -- 'refs/heads/tmp') ; do + git push -f https://${{ secrets.REBASE_PAT }}@github.com/${{ github.repository }}.git :${branch} + done + shell: bash + env: + GH_TOKEN: ${{ github.token }} + + notify-job: + runs-on: ubuntu-latest + needs: [release-workflow] + if: ${{ always() && contains(needs.*.result, 'failure') }} + steps: + - name: Checkout code + uses: actions/checkout@v4 + + # create an issue with a link to the workflow run on failure + # TODO: don't create more issues, only use one + - run: | + set -eux + gh repo set-default stable-haskell/cabal + for issue in $(gh issue list --label rebase-failure --json url -q '.[] | .url') ; do + gh issue close "${issue}" + done + gh issue create --title "Rebase failed on $(date -u +"%Y-%m-%d")" --label rebase-failure --body "${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}" + env: + GH_TOKEN: ${{ github.token }} +