Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove any remnant of the 'world' file #7746

Merged
merged 3 commits into from
Oct 23, 2021

Conversation

fendor
Copy link
Collaborator

@fendor fendor commented Oct 13, 2021

In v1-install, 'world' was used to trace what packages have been
installed, and re-install on-demand everything listed in it. However, in
v2-install, this is no longer needed and this file leads to code bloat.
Additionally, 'world' code-path is probably not up-to-date, remove it instead of
having partial features.

closes #6767

@fendor fendor changed the title Remove any remandant from the 'world' file Remove any remnant of the 'world' file Oct 13, 2021
@fendor fendor force-pushed the feature/remove-world-file branch 3 times, most recently from a579205 to 3f3eb53 Compare October 14, 2021 06:57
@Mikolaj
Copy link
Member

Mikolaj commented Oct 14, 2021

Does git grep -i world show any stragglers yet?

I'm going to rat you out to v1- users in #6481 so that they protest the change sooner rather than later and we can come up with workarounds, etc.

@fendor
Copy link
Collaborator Author

fendor commented Oct 14, 2021

Looks good to me:

git grep -i world
CONTRIBUTING.md:You can find a large number of real-world examples of changelog files
Cabal/ChangeLog.md:  * Don’t rebuild world when new ghc flags that affect how error
Cabal/src/Distribution/Compat/Binary/Class.hs:data MBA       = MBA {-# UNPACK #-} !(MutableByteArray# RealWorld)
Cabal/src/Distribution/Compat/Binary/Class.hs:freezeByteArray :: MutableByteArray# RealWorld -> IO ByteArray
Cabal/src/Distribution/SPDX/LicenseId.hs:    | Plexus -- ^ @Plexus@, Plexus Classworlds License
Cabal/src/Distribution/SPDX/LicenseId.hs:licenseName Plexus = "Plexus Classworlds License"
cabal-install-solver/src/Distribution/Solver/Modular.hs:-- | Ties the two worlds together: classic cabal-install vs. the modular
cabal-install/changelog:        * Initial support for a "world" package target
cabal-install/src/Distribution/Client/Init/FileCreators.hs:    , "* First version. Released on an unsuspecting world."
cabal-install/src/Distribution/Client/Init/Licenses.hs:    , "  Each contributor grants you a non-exclusive, worldwide, royalty-free"
cabal-install/src/Distribution/Client/Init/Licenses.hs:    , "  Each contributor grants you a non-exclusive, worldwide, royalty-free"
cabal-install/src/Distribution/Client/Init/Licenses.hs:    , "      worldwide, non-exclusive, no-charge, royalty-free, irrevocable"
cabal-install/src/Distribution/Client/Init/Licenses.hs:    , "      worldwide, non-exclusive, no-charge, royalty-free, irrevocable"
cabal-install/src/Distribution/Client/Init/Licenses.hs:    , "Each Contributor hereby grants You a world-wide, royalty-free,"
cabal-install/src/Distribution/Client/Install.hs:--   * only record applicable flags in world file
cabal-install/src/Distribution/Client/Install.hs:-- * change world file to use cabal section syntax
cabal-install/src/Distribution/Client/Install.hs:--  * updating world file
cabal-install/src/Distribution/Client/InstallPlan.hs:-- with libraries and executables.  In an ideal world, we would
cabal-install/src/Distribution/Client/Manpage.hs:  , (FileInfo "~/.cabal/world"  "A list of all packages whose installation has been explicitly requested.")
cabal-install/src/Distribution/Client/RebuildMonad.hs:-- This utility allows one to get the best of both worlds:
cabal-install/src/Distribution/Client/Setup.hs:    -- the world-file flag is long deprecated and unused
cabal-install/src/Distribution/Client/Setup.hs:          "Do not record the packages in the world file."
cabal-install/src/Distribution/Client/Targets.hs:   | UserTargetBadWorldPkg
cabal-install/src/Distribution/Client/Targets.hs:             ++ " - the special 'world' target\n"
cabal-install/src/Distribution/Client/Targets.hs:    case [ () | UserTargetBadWorldPkg <- problems ] of
cabal-install/src/Distribution/Client/Targets.hs:      _  -> die' verbosity "The special 'world' target does not take any version."
cabal-install/tests/IntegrationTests2/build/local-tarball/q/Q.hs:q = p ++ " world"
cabal-testsuite/PackageTests/BuildToolDepends/client/client.cabal:executable             hello-world
cabal-testsuite/PackageTests/BuildToolDepends/setup.out: - client-0.1.0.0 (exe:hello-world) (first run)
cabal-testsuite/PackageTests/BuildToolDepends/setup.out:Configuring executable 'hello-world' for client-0.1.0.0..
cabal-testsuite/PackageTests/BuildToolDepends/setup.out:Preprocessing executable 'hello-world' for client-0.1.0.0..
cabal-testsuite/PackageTests/BuildToolDepends/setup.out:Building executable 'hello-world' for client-0.1.0.0..
cabal-testsuite/PackageTests/BuildToolDependsInternalMissing/tool-depends-missing.cabal:  build-tool-depends:  build-tool-depends-missing:hello-world
cabal-testsuite/PackageTests/BuildTools/External/cabal.out: - client-0.1.0.0 (exe:hello-world) (first run)
cabal-testsuite/PackageTests/BuildTools/External/cabal.out:Configuring executable 'hello-world' for client-0.1.0.0..
cabal-testsuite/PackageTests/BuildTools/External/cabal.out:Preprocessing executable 'hello-world' for client-0.1.0.0..
cabal-testsuite/PackageTests/BuildTools/External/cabal.out:Building executable 'hello-world' for client-0.1.0.0..
cabal-testsuite/PackageTests/BuildTools/External/client/client.cabal:executable             hello-world
cabal-testsuite/PackageTests/BuildTools/Foreign/build-tools-path-foreign.cabal:executable             hello-world
cabal-testsuite/PackageTests/BuildTools/Foreign/setup.cabal.out:Preprocessing executable 'hello-world' for build-tools-path-foreign-0.1.0.0..
cabal-testsuite/PackageTests/BuildTools/Foreign/setup.cabal.out:Building executable 'hello-world' for build-tools-path-foreign-0.1.0.0..
cabal-testsuite/PackageTests/BuildTools/Foreign/setup.cabal.out:# hello-world
cabal-testsuite/PackageTests/BuildTools/Foreign/setup.out:Preprocessing executable 'hello-world' for build-tools-path-foreign-0.1.0.0..
cabal-testsuite/PackageTests/BuildTools/Foreign/setup.out:Building executable 'hello-world' for build-tools-path-foreign-0.1.0.0..
cabal-testsuite/PackageTests/BuildTools/Foreign/setup.out:# hello-world
cabal-testsuite/PackageTests/BuildTools/Foreign/setup.test.hs:    runExe' "hello-world" []
cabal-testsuite/PackageTests/BuildTools/Internal/cabal.out: - foo-0.1.0.0 (exe:hello-world) (first run)
cabal-testsuite/PackageTests/BuildTools/Internal/cabal.out:Configuring executable 'hello-world' for foo-0.1.0.0..
cabal-testsuite/PackageTests/BuildTools/Internal/cabal.out:Preprocessing executable 'hello-world' for foo-0.1.0.0..
cabal-testsuite/PackageTests/BuildTools/Internal/cabal.out:Building executable 'hello-world' for foo-0.1.0.0..
cabal-testsuite/PackageTests/BuildTools/Internal/cabal.test.hs:    cabal "v2-build" ["foo", "hello-world"]
cabal-testsuite/PackageTests/BuildTools/Internal/foo.cabal:executable             hello-world
cabal-testsuite/PackageTests/BuildTools/Internal/setup.cabal.out:Preprocessing executable 'hello-world' for foo-0.1.0.0..
cabal-testsuite/PackageTests/BuildTools/Internal/setup.cabal.out:Building executable 'hello-world' for foo-0.1.0.0..
cabal-testsuite/PackageTests/BuildTools/Internal/setup.cabal.out:# hello-world
cabal-testsuite/PackageTests/BuildTools/Internal/setup.out:Preprocessing executable 'hello-world' for foo-0.1.0.0..
cabal-testsuite/PackageTests/BuildTools/Internal/setup.out:Building executable 'hello-world' for foo-0.1.0.0..
cabal-testsuite/PackageTests/BuildTools/Internal/setup.out:# hello-world
cabal-testsuite/PackageTests/BuildTools/Internal/setup.test.hs:    runExe' "hello-world" []
cabal-testsuite/PackageTests/CMain/foo.c:    printf("Hello world!");
cabal-testsuite/PackageTests/COnlyMain/foo.c:    printf("Hello world!");
cabal-testsuite/PackageTests/CustomPreProcess/cabal.out:# internal-preprocessor-test hello-world
cabal-testsuite/PackageTests/CustomPreProcess/cabal.test.hs:        r <- runPlanExe' "internal-preprocessor-test" "hello-world" []
cabal-testsuite/PackageTests/CustomPreProcess/internal-preprocessor-test.cabal:executable             hello-world
cabal-testsuite/PackageTests/CustomPreProcess/setup.cabal.out:Preprocessing executable 'hello-world' for internal-preprocessor-test-0.1.0.0..
cabal-testsuite/PackageTests/CustomPreProcess/setup.cabal.out:Building executable 'hello-world' for internal-preprocessor-test-0.1.0.0..
cabal-testsuite/PackageTests/CustomPreProcess/setup.cabal.out:# hello-world
cabal-testsuite/PackageTests/CustomPreProcess/setup.out:Preprocessing executable 'hello-world' for internal-preprocessor-test-0.1.0.0..
cabal-testsuite/PackageTests/CustomPreProcess/setup.out:Building executable 'hello-world' for internal-preprocessor-test-0.1.0.0..
cabal-testsuite/PackageTests/CustomPreProcess/setup.out:# hello-world
cabal-testsuite/PackageTests/CustomPreProcess/setup.test.hs:    runExe' "hello-world" []
cabal-testsuite/PackageTests/ExtraPackages/repo/some-exe-0.0.1.0/Main.hs:main = putStrLn "hello world"
cabal-testsuite/PackageTests/HaddockNewline/ChangeLog.md:* First version. Released on an unsuspecting world.
cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsBad/build-tool-depends-bad-version.cabal:  build-tool-depends:  build-tool-depends-bad-version:hello-world >=2
cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsBad/build-tool-depends-bad-version.cabal:executable             hello-world
cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsBad/setup.cabal.out:Error: cabal: The package has an impossible version range for a dependency on an internal executable: build-tool-depends-bad-version:hello-world >=2. This version range does not include the current package, and must be removed as the current package's executable will always be used.
cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsBad/setup.out:Error: setup: The package has an impossible version range for a dependency on an internal executable: build-tool-depends-bad-version:hello-world >=2. This version range does not include the current package, and must be removed as the current package's executable will always be used.
cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/build-tool-depends-extra-version.cabal:  build-tool-depends:  build-tool-depends-extra-version:hello-world >=0.0.0.1
cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/build-tool-depends-extra-version.cabal:executable             hello-world
cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/setup.cabal.out:Warning: The package has an extraneous version range for a dependency on an internal executable: build-tool-depends-extra-version:hello-world >=0.0.0.1. This version range includes the current package but isn't needed as the current package's executable will always be used.
cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/setup.cabal.out:The package has an extraneous version range for a dependency on an internal executable: build-tool-depends-extra-version:hello-world >=0.0.0.1. This version range includes the current package but isn't needed as the current package's executable will always be used.
cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/setup.out:Warning: The package has an extraneous version range for a dependency on an internal executable: build-tool-depends-extra-version:hello-world >=0.0.0.1. This version range includes the current package but isn't needed as the current package's executable will always be used.
cabal-testsuite/PackageTests/InternalVersions/BuildToolDependsExtra/setup.out:The package has an extraneous version range for a dependency on an internal executable: build-tool-depends-extra-version:hello-world >=0.0.0.1. This version range includes the current package but isn't needed as the current package's executable will always be used.
cabal-testsuite/PackageTests/InternalVersions/BuildToolsBad/build-tools-bad-version.cabal:  build-tools:         hello-world >=2
cabal-testsuite/PackageTests/InternalVersions/BuildToolsBad/build-tools-bad-version.cabal:executable             hello-world
cabal-testsuite/PackageTests/InternalVersions/BuildToolsBad/setup.cabal.out:Error: cabal: The package has an impossible version range for a dependency on an internal executable: build-tools-bad-version:hello-world >=2. This version range does not include the current package, and must be removed as the current package's executable will always be used.
cabal-testsuite/PackageTests/InternalVersions/BuildToolsBad/setup.out:Error: setup: The package has an impossible version range for a dependency on an internal executable: build-tools-bad-version:hello-world >=2. This version range does not include the current package, and must be removed as the current package's executable will always be used.
cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/build-tools-extra-version.cabal:  build-tools:         hello-world >=0.0.0.1
cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/build-tools-extra-version.cabal:executable             hello-world
cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/setup.cabal.out:Warning: The package has an extraneous version range for a dependency on an internal executable: build-tools-extra-version:hello-world >=0.0.0.1. This version range includes the current package but isn't needed as the current package's executable will always be used.
cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/setup.cabal.out:The package has an extraneous version range for a dependency on an internal executable: build-tools-extra-version:hello-world >=0.0.0.1. This version range includes the current package but isn't needed as the current package's executable will always be used.
cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/setup.out:Warning: The package has an extraneous version range for a dependency on an internal executable: build-tools-extra-version:hello-world >=0.0.0.1. This version range includes the current package but isn't needed as the current package's executable will always be used.
cabal-testsuite/PackageTests/InternalVersions/BuildToolsExtra/setup.out:The package has an extraneous version range for a dependency on an internal executable: build-tools-extra-version:hello-world >=0.0.0.1. This version range includes the current package but isn't needed as the current package's executable will always be used.
cabal-testsuite/PackageTests/NewBuild/CmdExec/GhcInvocation/inplace-dep/InplaceDep.hs:f = putStrLn "Hello world"
cabal-testsuite/PackageTests/NewBuild/CmdExec/RunExe/Main.hs:main = putStrLn "Hello World"
cabal-testsuite/PackageTests/NewBuild/CmdExec/RunExe/cabal.test.hs:    cabal' "v2-exec" ["foo"] >>= assertOutputContains "Hello World"
cabal-testsuite/PackageTests/NewBuild/CmdRun/Datafiles/cabal.test.hs:    cabal' "v2-run" ["foo"] >>= assertOutputContains "Hello World"
cabal-testsuite/PackageTests/NewBuild/CmdRun/Datafiles/cabal.test.hs:    cabal' "v2-run" ["bar"] >>= assertOutputContains "Hello World"
cabal-testsuite/PackageTests/NewBuild/CmdRun/Datafiles/foo/data/hello.txt:Hello World
cabal-testsuite/PackageTests/NewBuild/CmdRun/ExeAndLib/Main.hs:main = putStrLn "Hello World"
cabal-testsuite/PackageTests/NewBuild/CmdRun/ExeAndLib/cabal.test.hs:    cabal' "v2-run" ["foo"] >>= assertOutputContains "Hello World"
cabal-testsuite/PackageTests/NewBuild/CmdRun/ExeAndLib/cabal.test.hs:    fails (cabal' "v2-run" ["ExeAndLib"]) >>= assertOutputDoesNotContain "Hello World"
cabal-testsuite/PackageTests/NewBuild/CmdRun/Script/cabal.test.hs:    assertOutputContains "Hello World" res
cabal-testsuite/PackageTests/NewBuild/CmdRun/Script/script.hs:main = putStrLn "Hello World"
cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptLiterate/cabal.test.hs:    assertOutputContains "Hello World" res
cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptLiterate/script.lhs:main = putStrLn "Hello World"
cabal-testsuite/PackageTests/NewBuild/CmdRun/Single/Main.hs:main = putStrLn "Hello World"
cabal-testsuite/PackageTests/NewBuild/CmdRun/Single/cabal.test.hs:    mapM_ (cabal' "v2-run" >=> assertOutputContains "Hello World")
cabal-testsuite/PackageTests/NewBuild/CmdRun/Single/cabal.test.hs:    fails (cabal' "v2-run" ["bar"]) >>= assertOutputDoesNotContain "Hello World"
cabal-testsuite/PackageTests/NewBuild/T4477/Main.hs:main = putStrLn "Hello World"
cabal-testsuite/PackageTests/NewBuild/T4477/cabal.test.hs:    cabal' "v2-run" ["foo"] >>= assertOutputContains "Hello World"
cabal-testsuite/PackageTests/NewSdist/DeterministicTrivial/Main.hs:main = putStrLn "Hello, world!"
cabal-testsuite/PackageTests/NewSdist/ManyDataFiles/Main.hs:main = putStrLn "Hello, World!"
cabal-testsuite/PackageTests/QuasiQuotes/dynamic/QQ.hs:myq = QuasiQuoter { quoteExp = \s -> litE $ stringL $ s ++ " world"}
cabal-testsuite/PackageTests/QuasiQuotes/profiling/QQ.hs:myq = QuasiQuoter { quoteExp = \s -> litE $ stringL $ s ++ " world"}
cabal-testsuite/PackageTests/QuasiQuotes/vanilla/QQ.hs:myq = QuasiQuoter { quoteExp = \s -> litE $ stringL $ s ++ " world"}
cabal-testsuite/PackageTests/Regression/T2971/q/Bar.hsc:main = putStrLn "hello world"
cabal-testsuite/PackageTests/Regression/T4986/client/client.cabal:executable             hello-world
changelog.d/issue-6767:synopsis:  Remove World file functionality
changelog.d/issue-6767:In v1-install, 'world' was used to trace what packages have been
changelog.d/issue-6767:Additionally, 'world' code-path is probably not up-to-date, remove it instead of
changelog.d/issue-6767:- Don't generate `world` file in `~/.cabal` when `v1-install` is executed.
changelog.d/issue-6767:- Don't ever read `world` from `~/.cabal`.
changelog.d/issue-6767:- Remove meta-target `world` from `v1-install`.
doc/cabal-package.rst:a real-world use case:
doc/cabal-project.rst:.. cfg-field:: world-file: path
doc/cabal-project.rst:               --world-file=FILE
doc/cabal-project.rst:    [STRIKEOUT:The location of the world file.] Deprecated.
doc/cabal-project.rst:    The command line variant of this flag is ``--world-file=FILE``.
doc/developing-packages.rst:understand a bit about packages in the Haskell world and the particular
doc/developing-packages.rst:programs can be run directly. In the Haskell world, library packages
doc/developing-packages.rst:other definitions. In the Haskell world, packages are not a part of the
doc/developing-packages.rst:world where installing additional dependencies is a tiresome manual
license-list-data/licenses-3.0.json:      "name": "Plexus Classworlds License",
license-list-data/licenses-3.0.json:        "https://fedoraproject.org/wiki/Licensing/Plexus_Classworlds_License"
license-list-data/licenses-3.10.json:      "name": "Plexus Classworlds License",
license-list-data/licenses-3.10.json:        "https://fedoraproject.org/wiki/Licensing/Plexus_Classworlds_License"
license-list-data/licenses-3.2.json:      "name": "Plexus Classworlds License",
license-list-data/licenses-3.2.json:        "https://fedoraproject.org/wiki/Licensing/Plexus_Classworlds_License"
license-list-data/licenses-3.6.json:      "name": "Plexus Classworlds License",
license-list-data/licenses-3.6.json:        "https://fedoraproject.org/wiki/Licensing/Plexus_Classworlds_License"
license-list-data/licenses-3.9.json:      "name": "Plexus Classworlds License",
license-list-data/licenses-3.9.json:        "https://fedoraproject.org/wiki/Licensing/Plexus_Classworlds_License"
release.py:        world-file:        {args.builddir}/cabal/world
vendor/cabal-doctest-1.0.8/ChangeLog.md:* First version. Released on an unsuspecting world.

I'm going to rat you out

😢

@fendor
Copy link
Collaborator Author

fendor commented Oct 14, 2021

Oh, I forgot to update documentation

@Mikolaj
Copy link
Member

Mikolaj commented Oct 14, 2021

These seem related, don't they?

release.py:        world-file:        {args.builddir}/cabal/world

cabal-install/src/Distribution/Client/Setup.hs:    -- the world-file flag is long deprecated and unused

cabal-install/src/Distribution/Client/Setup.hs:          "Do not record the packages in the world file."

cabal-install/src/Distribution/Client/Targets.hs:   | UserTargetBadWorldPkg

cabal-install/src/Distribution/Client/Targets.hs:             ++ " - the special 'world' target\n"

cabal-install/src/Distribution/Client/Targets.hs:    case [ () | UserTargetBadWorldPkg <- problems ] of

cabal-install/src/Distribution/Client/Targets.hs:      _  -> die' verbosity "The special 'world' target does not take any version."

cabal-install/src/Distribution/Client/Manpage.hs:  , (FileInfo "~/.cabal/world"  "A list of all packages whose installation has been explicitly requested.")

cabal-install/src/Distribution/Client/Install.hs:--   * only record applicable flags in world file

cabal-install/src/Distribution/Client/Install.hs:-- * change world file to use cabal section syntax

cabal-install/src/Distribution/Client/Install.hs:--  * updating world file

@jneira
Copy link
Member

jneira commented Oct 16, 2021

lgtm thanks for the clean up

@Mikolaj
Copy link
Member

Mikolaj commented Oct 16, 2021

@fendor: is this ready for review?

@Mikolaj
Copy link
Member

Mikolaj commented Oct 16, 2021

BTW, none of the v1- users is admitting to use world. I suspect they are biding their time until 3.8 is out to get that perfect storm.

@andreasabel
Copy link
Member

I tried this PR with our Agda workflows and did not notice any problems. The only difference was that I was alerted of an unknown field world-file in my configuration.

@fendor
Copy link
Collaborator Author

fendor commented Oct 23, 2021

@Mikolaj Yes it is!

Copy link
Member

@Mikolaj Mikolaj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right, this looks perfect.

@Mikolaj Mikolaj added merge me Tell Mergify Bot to merge and removed attention: needs-review labels Oct 23, 2021
@Mikolaj
Copy link
Member

Mikolaj commented Oct 23, 2021

Mergify seems stuck, so let me prod it.

@Mikolaj
Copy link
Member

Mikolaj commented Oct 23, 2021

@Mergifyio rebase

@Mikolaj
Copy link
Member

Mikolaj commented Oct 23, 2021

Stuck again.

@mergify
Copy link
Contributor

mergify bot commented Oct 23, 2021

rebase

❌ Base branch update has failed

No oauth valid tokens
err-code: E7B66

@Mikolaj Mikolaj removed the merge me Tell Mergify Bot to merge label Oct 23, 2021
@Mikolaj
Copy link
Member

Mikolaj commented Oct 23, 2021

@Mergifyio rebase

@mergify
Copy link
Contributor

mergify bot commented Oct 23, 2021

rebase

❌ Base branch update has failed

No oauth valid tokens
err-code: 65C4D

@Mikolaj
Copy link
Member

Mikolaj commented Oct 23, 2021

@fendor: mergifyIO is ded. Could you kindly rebase and manually merge?

In v1-install, 'world' was used to trace what packages have been
installed, and re-install on-demand everything listed in it. However, in
v2-install, this is no longer needed and this file leads to code bloat.
Additionally, 'world' code-path is probably not up-to-date, remove it instead of
having partial features.
@Mikolaj
Copy link
Member

Mikolaj commented Oct 23, 2021

CI acted up again, so let me admin-override the merge.

@Mikolaj Mikolaj merged commit e74a53b into haskell:master Oct 23, 2021
@andreasabel andreasabel added the re: world-file Concerning the "world" file used by v1-cabal label Oct 24, 2021
@gbaz
Copy link
Collaborator

gbaz commented Jan 4, 2022

@Mikolaj @fendor so I realized a small problem with this pr. in particular, people like me still have old cabal configs that were created when world files existed.

So using HEAD of cabal I get warnings like Warning: /Users/gershom/.cabal/config: Unrecognized field world-file on line 29

I know how to fix this (update my config) but I think this will be a confusing PITA for cabal users. Can we have a PR to somehow suppress this warning?

@andreasabel
Copy link
Member

As a general principle, if one removes a component of a language, like the world-file syntax from the CABAL specification language, one should not remove it from the parser. Rather, keep it in the parser so that you can give a meaningful error message that this component is no longer supported.
A meaningful error message would be "World files were removed in version 3.foo.bar.0".

See e.g. the removal of the delimiters pragma in BNFC: https://github.com/BNFC/bnfc/blob/b9d96e87a6f9051792555b7060cdd5ad2d31ff80/source/src/BNFC/GetCF.hs#L373-L376

@Mikolaj
Copy link
Member

Mikolaj commented Jan 4, 2022

That's a good idea. In particular, we could tell that it's usually just the matter of removing the "world-whatever" line from the config, because almost no users depend on it any more and so no further action is necessary.

@gbaz
Copy link
Collaborator

gbaz commented Jan 4, 2022

In this case I don't think we should give an error message or warning -- just silently discard. It was added by default in previous cabals and forcing users to all remove it by hand when it was never cared about before will cause friction.

@andreasabel
Copy link
Member

We could have a warning that only shows with -v2 or -v3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
re: world-file Concerning the "world" file used by v1-cabal
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove World file functionality
5 participants