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

Shorten script-builds paths (backport #8898) #8970

Merged
merged 5 commits into from
May 30, 2023

Conversation

mergify[bot]
Copy link
Contributor

@mergify mergify bot commented May 24, 2023

This is an automatic backport of pull request #8898 done by Mergify.
Cherry-pick of a482a63 has failed:

On branch mergify/bp/3.10/pr-8898
Your branch is up to date with 'origin/3.10'.

You are currently cherry-picking commit a482a63c1.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   Cabal/src/Distribution/PackageDescription/Check.hs
	modified:   cabal-install/cabal-install.cabal
	modified:   cabal-install/src/Distribution/Client/CmdListBin.hs
	modified:   cabal-install/src/Distribution/Client/HashValue.hs
	modified:   cabal-install/src/Distribution/Client/ScriptUtils.hs
	modified:   cabal-testsuite/PackageTests/ListBin/Script/cabal.out
	modified:   cabal-testsuite/PackageTests/NewBuild/CmdBuild/Script/cabal.out
	modified:   cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptBuildRepl/cabal.out
	modified:   cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptBuildRepl/cabal.test.hs
	modified:   cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptBuildRun/cabal.out
	modified:   cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptBuildRun/cabal.test.hs
	modified:   cabal-testsuite/PackageTests/NewBuild/CmdBuild/ScriptRerun/cabal.out
	modified:   cabal-testsuite/PackageTests/NewBuild/CmdClean/Keep/cabal.out
	modified:   cabal-testsuite/PackageTests/NewBuild/CmdClean/Orphan/cabal.out
	modified:   cabal-testsuite/PackageTests/NewBuild/CmdClean/Script/cabal.out
	modified:   cabal-testsuite/PackageTests/NewBuild/CmdRepl/Script/cabal.out
	modified:   cabal-testsuite/PackageTests/NewBuild/CmdRepl/ScriptRerun/cabal.out
	modified:   cabal-testsuite/PackageTests/NewBuild/CmdRun/Script/cabal.out
	modified:   cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptLiterate/cabal.out
	modified:   cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptLiterate/cabal.test.hs
	modified:   cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptNoExtension/cabal.out
	modified:   cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptRerun/cabal.out
	modified:   cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptWithProjectBlock/cabal.out
	modified:   cabal-testsuite/cabal-testsuite.cabal
	modified:   cabal-testsuite/src/Test/Cabal/Prelude.hs
	new file:   changelog.d/issue-8841

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   cabal-install/src/Distribution/Client/CmdRun.hs
	both modified:   cabal-install/src/Distribution/Client/ProjectConfig.hs

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/github/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally


Mergify commands and options

More conditions and actions can be found in the documentation.

You can also trigger Mergify actions by commenting on this pull request:

  • @Mergifyio refresh will re-evaluate the rules
  • @Mergifyio rebase will rebase this PR on its base branch
  • @Mergifyio update will merge the base branch into this PR
  • @Mergifyio backport <destination> will backport this PR on <destination> branch

Additionally, on Mergify dashboard you can:

  • look at your merge queues
  • generate the Mergify configuration with the config editor.

Finally, you can contact us on https://mergify.com

* Use shorter hash for script-builds directories

Using a Base64 hash and truncating it to 26 characters, saves 38 chars,
which helps avoid long paths issues on Windows, while still providing
130 bits of hash in order to avoid collisions.

Bug #8841

* Use the script cache dir as the dist dir

Putting script build products under dist-newstyle within the cache
directory is unnecessary because we already control the cache directory
and can ensure there are no conflicts.

* Use the actual script name in the executable name

Previously, the script name was sanitized in final executable name,
because the executable name had to match the component name, which only
allowed for a limited character set. Now we can use the actual script
name in the executable name. This only lets us shorten the component
name without losing clarity.

* Add changelog entry

* Reenable script tests for Windows/ghc-9.4.*

(cherry picked from commit a482a63)

# Conflicts:
#	cabal-install/src/Distribution/Client/CmdRun.hs
#	cabal-install/src/Distribution/Client/ProjectConfig.hs
@ulysses4ever
Copy link
Collaborator

Part of the trouble with automatic backport is due to spurious reording of imports (probably by HLS or something?) in the original PR. Thanks god we'll be liberated from this kind of problem with #8950 (I think?).

@ulysses4ever
Copy link
Collaborator

ulysses4ever commented May 27, 2023

I attempted a manual conflict resolution. Hopefully, I'll wake up tomorrow to see CI green.

Will need squash+merge.

@ulysses4ever ulysses4ever added the squash+merge me Tell Mergify Bot to squash-merge label May 27, 2023
@ulysses4ever
Copy link
Collaborator

The testsuite needs adjustments...

@ulysses4ever
Copy link
Collaborator

In particular,

UNEXPECTED OK:
PackageTests\NewBuild\CmdRun\ScriptRerun\cabal.test.hs
PackageTests\NewBuild\CmdRun\Script\cabal.test.hs
PackageTests\NewBuild\CmdClean\Script\cabal.test.hs
PackageTests\NewBuild\CmdClean\Orphan\cabal.test.hs
PackageTests\NewBuild\CmdClean\Keep\cabal.test.hs
PackageTests\NewBuild\CmdBuild\ScriptRerun\cabal.test.hs
PackageTests\NewBuild\CmdBuild\Script\cabal.test.hs

UNEXPECTED FAIL:
PackageTests\NewBuild\CmdRun\ScriptLiterate\cabal.test.hs
PackageTests\NewBuild\CmdBuild\ScriptBuildRun\cabal.test.hs
PackageTests\NewBuild\CmdBuild\ScriptBuildRepl\cabal.test.hs

@ulysses4ever ulysses4ever merged commit 6baf1e4 into 3.10 May 30, 2023
@ulysses4ever ulysses4ever deleted the mergify/bp/3.10/pr-8898 branch May 30, 2023 01:40
@Mikolaj
Copy link
Member

Mikolaj commented May 30, 2023

Thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport conflicts squash+merge me Tell Mergify Bot to squash-merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants