GithubHelp home page GithubHelp logo

arch-hs's Introduction

Metrics

arch-hs's People

Contributors

berberman avatar felixonmars avatar isovector avatar vekhir avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

arch-hs's Issues

Special case licenses

According to our guidelines, licenses like BSD, ISC, MIT should not be prefixed by "custom:" although they are not provided in the system. The license should still be installed inside the package, just the custom: prefix should be removed.

Polysemy is deprecating MemberWithError

The MemberWithError type in Polysemy is being deprecated and will be removed in the next version. The upgrade path is simply to replace it with Member. I'm happy to send a PR if you'd like.

Unaligned prefix spaces in arch-hs-diff when running for optparse-applicative

$ arch-hs-diff optparse-applicative 0.15.1.0 0.16.0.0
  ⓘ Start running...
  ⓘ Downloading cabal file from https://hackage.haskell.org/package/optparse-applicative-0.15.1.0/revision/0.cabal...
  ⓘ Downloading cabal file from https://hackage.haskell.org/package/optparse-applicative-0.16.0.0/revision/0.cabal...
Package: optparse-applicative
Version: 0.15.1.0  ⇒  0.16.0.0
Synopsis: Utilities and combinators for parsing command line options
Depends:
base  ==4.*
    transformers  >=0.2 && <0.6
    transformers-compat  >=0.3 && <0.7
    process  >=1.0 && <1.7
    ansi-wl-pprint  >=0.6.8 && <0.7
MakeDepends:
        base  -any
    bytestring  >=0.9 && <0.11
    optparse-applicative  -any
    QuickCheck  >=2.8 && <2.14
----------------------------
    base  -any
    bytestring  >=0.9 && <0.11
    optparse-applicative  -any
    QuickCheck  >=2.8 && <2.15

  ✔ Success!

As you can see, base ==4.* in Depends has no prefix space, and the first base -any in MakeDepends has 8 spaces instead of 4.

Support flags in arch-hs-diff

It would be nice to support flags as arch-hs, so I can specify -fwarp-tests for the following example:

$ arch-hs-diff HTTP 4000.3.14 4000.3.15
  ⓘ Start running...
  ⓘ Downloading cabal file from https://hackage.haskell.org/package/HTTP-4000.3.14/revision/0.cabal...
  ⓘ Downloading cabal file from https://hackage.haskell.org/package/HTTP-4000.3.15/revision/0.cabal...
Package: HTTP
Version: 4000.3.14  ⇒  4000.3.15
Synopsis: A library for client-side HTTP
URL: https://github.com/haskell/HTTP
Depends:
    base  >=4.3.0.0 && <4.14
    time  >=1.1.2.3 && <1.10
    Win32  >=2.2.0.0 && <2.9
    array  >=0.3.0.2 && <0.6
    bytestring  >=0.9.1.5 && <0.11
    parsec  >=2.0 && <3.2
----------------------------
    base  >=4.3.0.0 && <4.15
    time  >=1.1.2.3 && <1.11
    Win32  >=2.2.0.0 && <2.10
    array  >=0.3.0.2 && <0.6
    bytestring  >=0.9.1.5 && <0.11
    parsec  >=2.0 && <3.2
MakeDepends:
    deepseq  >=1.3.0.0 && <1.5
    HUnit  >=1.2.0.1 && <1.7
    httpd-shed  >=0.4 && <0.5
    mtl  >=1.1.1.0 && <2.3
    pureMD5  >=0.2.4 && <2.2
    split  >=0.1.3 && <0.3
    test-framework  >=0.2.0 && <0.9
    test-framework-hunit  >=0.3.0 && <0.4

  ✔ Success!

Expected result: warp etc listed in makedepends.

It would also be handy if flag changes (new flag, removed flag, etc) are shown if exist.

<no location info>: error: module ‘Setup’ cannot be found locally

$ arch-hs -o . toml-reader
$ cd haskell-toml-reader
$ makepkg -fsi --asdeps
==> Making package: haskell-toml-reader 0.2.1.0-1 (Mon 11 Sep 2023 05:22:40 PM CST)
==> Checking runtime dependencies...
==> Checking buildtime dependencies...
==> Retrieving sources...
  -> Found toml-reader-0.2.1.0.tar.gz
==> Validating source files with sha256sums...
    toml-reader-0.2.1.0.tar.gz ... Skipped
==> Extracting sources...
  -> Extracting toml-reader-0.2.1.0.tar.gz with bsdtar
==> Removing existing $pkgdir/ directory...
==> Starting build()...

<no location info>: error: module ‘Setup’ cannot be found locally
==> ERROR: A failure occurred in build().
    Aborting...

Failed to run arch-hs with target cabal-fmt

$ arch-hs cabal-fmt
  ▶ You didn't pass -h, use hackage index file from default path.
  ▶ You didn't pass -c, use community db file from default path.
  ▶ You didn't pass -f, different flag assignments may make difference in dependency resolving.
  ⓘ Loading hackage...
  ⓘ Loading community.db...
  ⓘ Start running...
  ⓘ Solved target:
Cabal                                                                        ✔ [community]
ansi-terminal                                                                ✔ [community]
ansi-wl-pprint                                                               ✔ [community]
binary                                                                       ✔ [community]
bytestring                                                                   ✔ [community]
cabal-fmt                                                                    ✘
 ├─Cabal [golden :: Test,cabal-fmt-internal :: SubLibs]                      ✔ [community]
 ├─bytestring [cabal-fmt :: Exe,golden :: Test,cabal-fmt-internal :: SubLibs]✔ [community]
 ├─cabal-fmt-internal [cabal-fmt :: Exe,golden :: Test]                      ✘
 ├─containers [golden :: Test,cabal-fmt-internal :: SubLibs]                 ✔ [community]
 ├─directory [cabal-fmt :: Exe,cabal-fmt-internal :: SubLibs]                ✔ [community]
 ├─filepath [cabal-fmt :: Exe,golden :: Test,cabal-fmt-internal :: SubLibs]  ✔ [community]
 ├─mtl [cabal-fmt-internal :: SubLibs]                                       ✔ [community]
 ├─optparse-applicative [cabal-fmt :: Exe]                                   ✔ [community]
 ├─parsec [cabal-fmt-internal :: SubLibs]                                    ✔ [community]
 ├─pretty [cabal-fmt-internal :: SubLibs]                                    ✔ [community]
 ├─process [golden :: Test]                                                  ✔ [community]
 ├─tasty [golden :: Test]                                                    ✔ [community]
 └─tasty-golden [golden :: Test]                                             ✔ [community]
colour                                                                       ✔ [community]
containers                                                                   ✔ [community]
deepseq                                                                      ✔ [community]
directory                                                                    ✔ [community]
filepath                                                                     ✔ [community]
mtl                                                                          ✔ [community]
optparse-applicative                                                         ✔ [community]
parsec                                                                       ✔ [community]
pretty                                                                       ✔ [community]
process                                                                      ✔ [community]
template-haskell                                                             ✔ [community]
text                                                                         ✔ [community]
time                                                                         ✔ [community]
transformers-compat                                                          ✔ [community]
unix                                                                         ✔ [community]
Diff                                                                         ✔ [community]
QuickCheck                                                                   ✔ [community]
array                                                                        ✔ [community]
base-compat                                                                  ✔ [community]
base-orphans                                                                 ✔ [community]
integer-logarithms                                                           ✔ [community]
stm                                                                          ✔ [community]
tagged                                                                       ✔ [community]
tar                                                                          ✔ [community]
tasty                                                                        ✔ [community]
tasty-golden                                                                 ✔ [community]
tasty-hunit                                                                  ✔ [community]
tasty-quickcheck                                                             ✔ [community]
temporary                                                                    ✔ [community]
transformers                                                                 ✔ [community]
tree-diff                                                                    ✔ [community]
HUnit                                                                        ✔ [community]
random                                                                       ✔ [community]
test-framework                                                               ✔ [community]
test-framework-quickcheck2                                                   ✔ [community]
integer-gmp                                                                  ✔ [community]
cabal-fmt-internal                                                           ✘
test-framework-hunit                                                         ✔ [community]
ghc-boot-th                                                                  ✔ [community]
quickcheck-unicode                                                           ✔ [community]

  ⓘ Recommended package order (from topological sort):
1. cabal-fmt-internal
2. cabal-fmt

  🛑 Runtime Exception: Unable to find [cabal-fmt-internal] (hackage name) / [haskell-cabal-fmt-internal] (community name)

Description with backticks gets executed

I ran arch-hs to create haskell-nicify-lib and it generated a PKGBUILD with:

pkgdesc="Pretty print the standard output of default `Show` instances."

When building with aur build, this resulted in e.g.

/home/james/src/PKGBUILDs/fossa-cli/haskell-nicify-lib/PKGBUILD: line 8: Show: command not found

This implies a code execution security problem.

Machine parsable output

Feature request

Would adding a option to have machine parseable output possible ?
I'm thinking in particular to the Recommended package order. (a simple text file
with the package in the order ?)
And maybe a json file for the dependency graph ?

Your tool is fantastic, by the way o/

Thank you for your work :)

Use cabal to resolve dependencies

When you call cabal configure inside a cabal project, cabal will automatically resolve dependencies and produce a file representing the build plan called plan.json under the directory dist-newstyle/cache. There are some advantages to using plan.json over the current method:

  1. No need to reimplement dependency resolution
  2. cabal resolves dependencies separately for different components (library, sub-libraries, executables, tests, benchmarks)

arch-hs output dir should use pkgname

  ⓘ Write file: /home/felix/projects/arch/community/conduit-parse/PKGBUILD
  ⓘ Write file: /home/felix/projects/arch/community/haskell-lsp/PKGBUILD
  ⓘ Write file: /home/felix/projects/arch/community/lsp-test/PKGBUILD

It should use haskell-conduit-parse etc by default.

Missing build tools

Target: BNFC

PKGBUILD:

depends=('ghc-libs' 'haskell-semigroups')
makedepends=('ghc' 'haskell-hunit' 'haskell-quickcheck' 'haskell-doctest' 'haskell-hspec' 'haskell-temporary')

Build log:

==> Starting build()...
Configuring BNFC-2.8.4...
Setup: The program 'alex' is required but it could not be found.

==> ERROR: A failure occurred in build().

arch-hs-diff showed wrong flags

$ arch-hs-diff skylighting-core 0.8.5 0.10
  ▶ You didn't pass -f, different flag values may make difference in dependency resolving.
  ⓘ Loading community.db...
  ⓘ Start running...
  ⓘ Downloading cabal file from https://hackage.haskell.org/package/skylighting-core-0.8.5/revision/0.cabal...
  ⓘ Downloading cabal file from https://hackage.haskell.org/package/skylighting-core-0.10/revision/0.cabal...
Package: skylighting-core
Version: 0.8.5  ⇒  0.10
Synopsis: syntax highlighting library
URL: https://github.com/jgm/skylighting
Depends:
    containers  -any
    regex-pcre-builtin  >=0.95
    aeson  >=1.0
    ansi-terminal  >=0.7
    attoparsec  -any
    base  >=4.8 && <5.0
    base64-bytestring  -any
    binary  -any
    blaze-html  >=0.5
    bytestring  -any
    case-insensitive  -any
    colour  >=2.0
    directory  >=1.2.5
    filepath  -any
    hxt  -any
    mtl  -any
    safe  -any
    text  -any
    transformers  -any
    utf8-string  -any
--------------------------------------
    containers  >=0.5.8.2
    aeson  >=1.0
    ansi-terminal  >=0.7
    attoparsec  -any
    base  >=4.8 && <5.0
    base64-bytestring  -any
    binary  -any
    blaze-html  >=0.5
    bytestring  -any
    case-insensitive  -any
    colour  >=2.0
    directory  >=1.2.5
    filepath  -any
    hxt  -any
    mtl  -any
    safe  -any
    text  -any
    transformers  -any
    utf8-string  -any

"regex-pcre-builtin" is required to be in range (>=0.95), but [community] does not provide this package.

MakeDepends:
    Diff  -any
    HUnit  -any
    QuickCheck  -any
    directory  -any
    pretty-show  -any
    random  -any
    tasty  -any
    tasty-golden  -any
    tasty-hunit  -any
    tasty-quickcheck  -any
--------------------------------------
    containers  -any
    Diff  -any
    HUnit  -any
    QuickCheck  -any
    directory  -any
    pretty-show  -any
    random  -any
    tasty  -any
    tasty-golden  -any
    tasty-hunit  -any
    tasty-quickcheck  -any


Flags:
  skylighting-core
    ⚐ executable:
      description:
        Build skylighting-extract tool
      default: False
      isManual: False
    ⚐ system-pcre:
      description:
        Use regex-pcre instead of regex-pcre-builtin
      default: False
      isManual: False


  ✔ Success!

Flag system-pcre is no longer available in the newer version.

Support SubLibraries

When running arch-hs with target haskell-ci:

$ arch-hs haskell-ci
...
  🛑 Runtime Error: Unable to find [haskell-ci-internal]

haskell-ci doesn't have condLibrary, but condSubLibraries with a suffix -internal of its component name instead. arch-hs currently is unable to handle such situation, and what it exactly does is to just ignore them. I checked the entire hackage, and found that only few packages have sub-libraries. Hence, supporting this will be in low priority.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.