-
Notifications
You must be signed in to change notification settings - Fork 696
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
Fix the timestamp shown during cabal update #7934
Merged
mergify
merged 11 commits into
haskell:master
from
andreabedini:andrea/fix-update-message-timestamp
May 7, 2022
Merged
Changes from all commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
171d5a4
Fix the timestamp shown during cabal update
andreabedini a5fdd34
Add test case for cabal update message
andreabedini 4af65bf
Enable testing against a local remote repository
andreabedini 6581a59
Skip withRemoteRepo if hackageRepoToolProgram is not available
andreabedini d007aac
Install hackage-repo-tool in CI
andreabedini ac9d6aa
Avoid threadDeleay in withRemoteRepo
andreabedini 6310e9f
Bump network-wait version.
andreabedini b3b2f3e
Replace <> with mappend to please ghc 8.0
andreabedini 8145f8c
Change waiting strategy
andreabedini 9a55a0f
Wait more
andreabedini 00c9776
Explicit is better than implicit
andreabedini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
cabal-testsuite/PackageTests/NewUpdate/UpdateIndexState/repo/pkg-1.0/pkg.cabal
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
name: pkg | ||
version: 1.0 | ||
build-type: Simple | ||
cabal-version: >= 1.2 | ||
|
||
executable my-exe | ||
main-is: Main.hs | ||
build-depends: base |
20 changes: 20 additions & 0 deletions
20
cabal-testsuite/PackageTests/NewUpdate/UpdateIndexState/update-index-state.out
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# cabal update | ||
Warning: Caught exception during _mirrors lookup:user error (res_query(3) failed) | ||
Warning: No mirrors found for http://localhost:8000/ | ||
Downloading the latest package list from repository.localhost | ||
Package list of repository.localhost has been updated. | ||
The index-state is set to 2022-01-28T02:36:41Z. | ||
To revert to previous state run: | ||
cabal v2-update 'repository.localhost,' | ||
# cabal update | ||
Downloading the latest package list from repository.localhost | ||
Package list of repository.localhost is up to date. | ||
The index-state is set to 2016-09-24T17:47:48Z. | ||
To revert to previous state run: | ||
cabal v2-update 'repository.localhost,2022-01-28T02:36:41Z' | ||
# cabal update | ||
Downloading the latest package list from repository.localhost | ||
Package list of repository.localhost is up to date. | ||
The index-state is set to 2022-01-28T02:36:41Z. | ||
To revert to previous state run: | ||
cabal v2-update 'repository.localhost,2016-09-24T17:47:48Z' |
9 changes: 9 additions & 0 deletions
9
cabal-testsuite/PackageTests/NewUpdate/UpdateIndexState/update-index-state.test.hs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import Test.Cabal.Prelude | ||
|
||
main = cabalTest $ withRemoteRepo "repo" $ do | ||
-- This test causes a warning about missing mirrors, the warning is | ||
-- included in the expected output to make the test pass but it's not | ||
-- part of the test expectations. | ||
cabal "update" ["repository.localhost,2022-01-28T02:36:41Z"] | ||
cabal "update" ["repository.localhost,2016-09-24T17:47:48Z"] | ||
cabal "update" ["repository.localhost,2022-01-28T02:36:41Z"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -69,7 +69,8 @@ runAction _verbosity mb_cwd env_overrides path0 args input action = do | |
, std_out = UseHandle writeh | ||
, std_err = UseHandle writeh | ||
} | ||
(stdin_h, _, _, procHandle) <- createProcess prc | ||
|
||
withCreateProcess prc $ \stdin_h _ _ procHandle -> do | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is required to make sure the spawn process is termined with the Haskell thread is terminated. This is important when we want to run long-running processes in parallel with a part of our code. |
||
|
||
case input of | ||
Just x -> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
synopsis: Fix the timestamp shown during cabal update | ||
packages: cabal-install | ||
prs: #7934 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great move, improving the test suite