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

container ubi - fix build using DockerfileUBI #1140

Merged
merged 2 commits into from
Jan 7, 2025

Conversation

morucci
Copy link
Collaborator

@morucci morucci commented Jan 7, 2025

  • bump to ubi9-minimal
  • add some dependencies version constraints

Below are some build issues that were fixed by adding those constraints: data-default < 0.8, base64 < 1.0, envparse < 0.6

Installing   morpheus-graphql-core-0.28.1 (lib)
Completed    morpheus-graphql-core-0.28.1 (lib)

Failed to build req-3.13.4.
Build log (
/root/.cache/cabal/logs/ghc-9.6.6/req-3.13.4-f8155ed22596e5f99fa75f7f9678be05506936e7bf2a402afca163eb2b2cc664.log
):
Configuring library for req-3.13.4...
Preprocessing library for req-3.13.4...
Building library for req-3.13.4...
[1 of 1] Compiling Network.HTTP.Req ( Network/HTTP/Req.hs, dist/build/Network/HTTP/Req.o, dist/build/Network/HTTP/Req.dyn_o )

Network/HTTP/Req.hs:610:11: error: [GHC-39999]
    * No instance for `Data.Default.Class.Default NC.TLSSettings'
        arising from a use of `def'
    * In the second argument of `L.mkManagerSettingsContext', namely
        `def'
      In the expression:
        L.mkManagerSettingsContext (Just context) def Nothing
      In an equation for `settings':
          settings = L.mkManagerSettingsContext (Just context) def Nothing
    |
610 |           def
    |           ^^^
Error: [Cabal-7125]
Failed to build req-3.13.4 (which is required by exe:monocle from monocle-1.11.2). See the build log above for details.

Network/TLS/Parameters.hs:404:39: error: [GHC-39999]
    * No instance for `Default ValidationCache'
        arising from a use of `def'
    * In the `sharedValidationCache' field of a record
      In the expression:
        Shared
          {sharedCredentials = mempty,
           sharedSessionManager = noSessionManager, sharedCAStore = mempty,
           sharedValidationCache = def, sharedHelloExtensions = []}
      In an equation for `def':
          def
            = Shared
                {sharedCredentials = mempty,
                 sharedSessionManager = noSessionManager, sharedCAStore = mempty,
                 sharedValidationCache = def, sharedHelloExtensions = []}
    |
404 |             , sharedValidationCache = def
    |                                       ^^^
Error: [Cabal-7125]
Failed to build tls-2.0.6 (which is required by exe:monocle from monocle-1.11.2). See the build log above for details.

src/Monocle/Api/Jwt.hs:108:44: error: [GHC-83865]
    * Couldn't match expected type `base64-1.0:Data.Base64.Types.Internal.Base64
                                      k0 ByteString'
                  with actual type `ByteString'
    * In the first argument of `B64.decodeBase64', namely `bs'
      In the expression: B64.decodeBase64 bs
      In the expression:
        case B64.decodeBase64 bs of
          Right json -> decode $ from json
          Left _ -> Nothing
    |
108 | decodeOIDCState bs = case B64.decodeBase64 bs of
    |                                            ^^

src/CLI.hs:152:8: error:
    Ambiguous occurrence `eitherReader'
    It could refer to
       either `Env.eitherReader',
              imported from `Env' at src/CLI.hs:10:1-40
              (and originally defined in `Env.Internal.Parser')
           or `Options.Applicative.eitherReader',
              imported from `Options.Applicative' at src/CLI.hs:30:1-53
              (and originally defined in `Options.Applicative.Builder')
    |
152 |       (eitherReader $ (first T.unpack . Config.mkIndexName) . T.pack)
    |        ^^^^^^^^^^^^

src/CLI.hs:51:54: error: [GHC-83865]
    * Couldn't match expected type `Int'
                  with actual type `Env.Parser
                                      Env.Error
                                      (FilePath, String, String, String, String, String,
                                       Maybe String, Maybe String)'
    * In the first argument of `Just', namely `usageApiEnv'
      In the fourth argument of `mkCommand', namely `(Just usageApiEnv)'
      In the first argument of `(<>)', namely
        `mkCommand "Start the API" "api" usageApi (Just usageApiEnv)'
   |
51 |     ( mkCommand "Start the API" "api" usageApi (Just usageApiEnv)
   |                                                      ^^^^^^^^^^^

- bump to ubi9-minimal
- add some dependencies version constraints

Below are some build issues that were fixed by adding those
constraints: data-default < 0.8, base64 < 1.0, envparse < 0.6

```
Installing   morpheus-graphql-core-0.28.1 (lib)
Completed    morpheus-graphql-core-0.28.1 (lib)

Failed to build req-3.13.4.
Build log (
/root/.cache/cabal/logs/ghc-9.6.6/req-3.13.4-f8155ed22596e5f99fa75f7f9678be05506936e7bf2a402afca163eb2b2cc664.log
):
Configuring library for req-3.13.4...
Preprocessing library for req-3.13.4...
Building library for req-3.13.4...
[1 of 1] Compiling Network.HTTP.Req ( Network/HTTP/Req.hs, dist/build/Network/HTTP/Req.o, dist/build/Network/HTTP/Req.dyn_o )

Network/HTTP/Req.hs:610:11: error: [GHC-39999]
    * No instance for `Data.Default.Class.Default NC.TLSSettings'
        arising from a use of `def'
    * In the second argument of `L.mkManagerSettingsContext', namely
        `def'
      In the expression:
        L.mkManagerSettingsContext (Just context) def Nothing
      In an equation for `settings':
          settings = L.mkManagerSettingsContext (Just context) def Nothing
    |
610 |           def
    |           ^^^
Error: [Cabal-7125]
Failed to build req-3.13.4 (which is required by exe:monocle from monocle-1.11.2). See the build log above for details.

Network/TLS/Parameters.hs:404:39: error: [GHC-39999]
    * No instance for `Default ValidationCache'
        arising from a use of `def'
    * In the `sharedValidationCache' field of a record
      In the expression:
        Shared
          {sharedCredentials = mempty,
           sharedSessionManager = noSessionManager, sharedCAStore = mempty,
           sharedValidationCache = def, sharedHelloExtensions = []}
      In an equation for `def':
          def
            = Shared
                {sharedCredentials = mempty,
                 sharedSessionManager = noSessionManager, sharedCAStore = mempty,
                 sharedValidationCache = def, sharedHelloExtensions = []}
    |
404 |             , sharedValidationCache = def
    |                                       ^^^
Error: [Cabal-7125]
Failed to build tls-2.0.6 (which is required by exe:monocle from monocle-1.11.2). See the build log above for details.

src/Monocle/Api/Jwt.hs:108:44: error: [GHC-83865]
    * Couldn't match expected type `base64-1.0:Data.Base64.Types.Internal.Base64
                                      k0 ByteString'
                  with actual type `ByteString'
    * In the first argument of `B64.decodeBase64', namely `bs'
      In the expression: B64.decodeBase64 bs
      In the expression:
        case B64.decodeBase64 bs of
          Right json -> decode $ from json
          Left _ -> Nothing
    |
108 | decodeOIDCState bs = case B64.decodeBase64 bs of
    |                                            ^^

src/CLI.hs:152:8: error:
    Ambiguous occurrence `eitherReader'
    It could refer to
       either `Env.eitherReader',
              imported from `Env' at src/CLI.hs:10:1-40
              (and originally defined in `Env.Internal.Parser')
           or `Options.Applicative.eitherReader',
              imported from `Options.Applicative' at src/CLI.hs:30:1-53
              (and originally defined in `Options.Applicative.Builder')
    |
152 |       (eitherReader $ (first T.unpack . Config.mkIndexName) . T.pack)
    |        ^^^^^^^^^^^^

src/CLI.hs:51:54: error: [GHC-83865]
    * Couldn't match expected type `Int'
                  with actual type `Env.Parser
                                      Env.Error
                                      (FilePath, String, String, String, String, String,
                                       Maybe String, Maybe String)'
    * In the first argument of `Just', namely `usageApiEnv'
      In the fourth argument of `mkCommand', namely `(Just usageApiEnv)'
      In the first argument of `(<>)', namely
        `mkCommand "Start the API" "api" usageApi (Just usageApiEnv)'
   |
51 |     ( mkCommand "Start the API" "api" usageApi (Just usageApiEnv)
   |                                                      ^^^^^^^^^^^
```
@@ -4,32 +4,9 @@ package proto3-suite
packages: .

-- dhall expects aeson < 2.2
constraints: aeson < 2.2
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can generate the constraints from the nixpkgs set using cabal freeze. That way we only need to track the package override which uses unrelease source, and the build should keep on working in the future.

Moreover, we should put these bounds in the monocle.cabal.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes good idea, cabal freeze seems to output the right constraints. so perhaps a Just target needs to be made for that purpose of generating cabal.project file.

Add a Just target to ease maintaining it.

We still need to keep proto3-suite is the override as not published
into hackage.
@morucci morucci force-pushed the container-build-ubi branch from 8addc69 to dc4b209 Compare January 7, 2025 13:45
@TristanCacqueray TristanCacqueray added the merge me Trigger the merge process label Jan 7, 2025
@mergify mergify bot merged commit 92faaad into change-metrics:master Jan 7, 2025
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
merge me Trigger the merge process
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants