input-output-hk / foliage

🌿 Foliage is a tool to create custom Haskell package repositories, in a fully reproducible way.
MIT License
42 stars 9 forks source link

Handle curl failure #78

Closed andreabedini closed 1 year ago

andreabedini commented 1 year ago

As we discovered, curl does not fail on http response codes >=400 by default. This PR:

Sample output:

❯ cabal run -- foliage build
🌿 Foliage
# buildAction
Current time set to 2023-09-05T04:06:10Z. You can set a fixed time using the --current-time option.
# _sources/pkg-a/1.2/meta.toml
# curl (for fetchRemoteAsset https://httpbin.org/status/500)
foliage: Error when running Shake build system:
  at want, called at app/Foliage/CmdBuild.hs:50:7 in main:Foliage.CmdBuild
* Depends on: buildAction
  at apply1, called at app/Foliage/PrepareSource.hs:39:31 in main:Foliage.PrepareSource
* Depends on: prepareSource pkg-a-1.2 PackageVersionSpec {packageVersionTimestamp = Nothing, packageVersionSource = TarballSource {tarballSourceURI = https://httpbin.org/status/500, subdir = Nothing}, packageVersionRevisions = [], packageVersionDeprecations = [], packageVersionForce = False}
  at apply1, called at app/Foliage/RemoteAsset.hs:37:20 in main:Foliage.RemoteAsset
* Depends on: fetchRemoteAsset https://httpbin.org/status/500
  at error, called at app/Foliage/RemoteAsset.hs:108:19 in main:Foliage.RemoteAsset
* Raised the exception:
The requested URL returned error: 500
michaelpj commented 1 year ago

What are we doing about the CI here? Re-evaluating doesn't seem to be having any effect :think

angerman commented 1 year ago

What are we doing about the CI here? Re-evaluating doesn't seem to be having any effect :think

I've asked @cleverca22 for some help. I need to get some windows idiocity done before I can focus on something else :-(