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

spago install git clones for same monorepo package multiple times #1208

Open
srghma opened this issue Mar 19, 2024 · 1 comment
Open

spago install git clones for same monorepo package multiple times #1208

srghma opened this issue Mar 19, 2024 · 1 comment

Comments

@srghma
Copy link
Contributor

srghma commented Mar 19, 2024

having same package, with only subdir is different

    deku:
      git: https://github.com/mikesol/purescript-deku.git
      subdir: deku
      ref: main
    deku-core:
      git: https://github.com/mikesol/purescript-deku.git
      subdir: deku-core
      ref: main
    deku-css:
      git: https://github.com/mikesol/purescript-deku.git
      subdir: deku-css
      ref: main
    deku-dom:
      git: https://github.com/mikesol/purescript-deku.git
      subdir: deku-dom
      ref: main

it will

 ~/projects/deku-documentation $ spago build --pedantic-packages
Reading Spago workspace configuration...

✅ Selecting package to build: deku-documentation

Cloning https://github.com/mikesol/purescript-deku.git
Cloning https://github.com/mikesol/purescript-deku.git
Cloning https://github.com/mikesol/purescript-deku.git
Cloning https://github.com/mikesol/purescript-deku.git
Downloading dependencies...

multiple times. Very long

Expected: uniq before cloning?


Full spago.yaml

package:
  name: deku-documentation
  publish:
    version: 0.9.24
    license: "Apache-2.0"
  dependencies:
    - free
    - deku
    - deku-core
    - deku-dom
    - yoga-fetch
    - yoga-json
    - affjax-web
    - affjax
    - profunctor-lenses
    - string-parsers
    - tidy-codegen
    - aff
    - routing-duplex
    - random
    - argonaut-core
    - fetch
    - routing
    - filterable
    - qualified-do
    - canvas
    - uint
    - arraybuffer
    - avar
    - web-pointerevents
    - web-touchevents
    - stringutils
workspace:
  backend:
    cmd: purs-backend-es
    args:
      - build
  package_set:
    registry: 50.4.0
  # yq '.workspace.extra_packages | keys[]' spago.yaml | grep -v "deku" | xargs -I {} rm -rdf ".spago/p/{}"
  extra_packages:
    hyrule:
      # git: https://github.com/mikesol/purescript-hyrule.git
      # ref: master
      git: https://github.com/srghma/purescript-hyrule.git
      ref: hyrule-master
    bolson:
      # git: https://github.com/mikesol/purescript-bolson.git
      git: https://github.com/srghma/purescript-bolson.git
      ref: main
    deku:
      git: https://github.com/mikesol/purescript-deku.git
      subdir: deku
      ref: main
    deku-core:
      git: https://github.com/mikesol/purescript-deku.git
      subdir: deku-core
      ref: main
    deku-css:
      git: https://github.com/mikesol/purescript-deku.git
      subdir: deku-css
      ref: main
    deku-dom:
      git: https://github.com/mikesol/purescript-deku.git
      subdir: deku-dom
      ref: main
    dodo-printer:
      # git: https://github.com/natefaubion/purescript-dodo-printer.git
      git: https://github.com/srghma/purescript-dodo-printer.git
      ref: master
    tidy:
      # git: https://github.com/natefaubion/purescript-tidy.git
      git: https://github.com/srghma/purescript-tidy.git
      ref: main
      subdir: lib
    tidy-codegen:
      # git: https://github.com/natefaubion/purescript-tidy-codegen.git
      git: https://github.com/srghma/purescript-tidy-codegen.git
      ref: main
@f-f
Copy link
Member

f-f commented Mar 19, 2024

Yes, this is an optimisation that we should implement. Right now we do the naive (but correct) thing of just cloning the repo for each of the packages - we could instead detect if we already have the repo, copy it over to the other package, and then checkout the right branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants