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

Ignore files in .gitignore when auto-detecting monorepo projects #918

Closed
f-f opened this issue Oct 19, 2022 · 10 comments
Closed

Ignore files in .gitignore when auto-detecting monorepo projects #918

f-f opened this issue Oct 19, 2022 · 10 comments

Comments

@f-f
Copy link
Member

f-f commented Oct 19, 2022

Bug report from @thomashoneyman:

when you use NPM workspaces, the contents of each workspace member are symlinked into the node_modules directory. That means the spago.yaml file is, too. That causes Spago to auto-detect the project within node_modules and try to build it as another workspace member (in this case, shadowing my actual one).

A good solution for this would be to not look for projects in places that are gitignored.
This is where we'd need to add paths to exclude:

{ succeeded: otherConfigPaths, failed } <- liftAff $ Glob.match' Paths.cwd [ "**/spago.yaml" ] { ignore: [ ".spago", "spago.yaml" ] }

@f-f f-f added the spaghetto label Oct 19, 2022
@f-f
Copy link
Member Author

f-f commented Oct 20, 2022

Fixed in 7883931

@f-f f-f closed this as completed Oct 20, 2022
@thomashoneyman
Copy link
Member

I'm still seeing this – for example, if you run npm install && spago build on the current registry-dev master, you'll see warnings like this:

Warning 11 of 11:

  in module Registry.Solver
  at node_modules/registry-app/src/Registry/Solver.purs:90:1 - 90:114 (line 90, column 1 - line 90, column 114)

    A custom warning occurred while solving type class constraints:

      Data.Map's `Semigroup` instance is now unbiased and differs from the left-biased instance defined in PureScript releases <= 0.13.x.


  in value declaration minimizeErrors

  See https://github.com/purescript/documentation/blob/master/errors/UserDefinedWarning.md for more information,
  or to contribute content related to this warning.

...where the link is to the node_modules directory.

@f-f
Copy link
Member Author

f-f commented Nov 2, 2022

I'm not sure we released a new version with this fix! Not at a computer right now, I can check later

@thomashoneyman
Copy link
Member

Oh! Sorry, I thought it was present in 0.91.0 -- in that case I take it back!

@f-f
Copy link
Member Author

f-f commented Nov 2, 2022

It looks like we did publish it in 0.91.0 - so we are probably just missing some detail.
@thomashoneyman if you run with -v, the debug logging will tell you which Spago configs it auto-discovered - what do you see there?

@thomashoneyman
Copy link
Member

Reading Spago workspace configuration...
Reading config from spago.yaml
Found packages at these paths:
  app/spago.yaml
  lib/spago.yaml
  scripts/spago.yaml
  node_modules/registry-app/spago.yaml
  node_modules/registry-lib/spago.yaml

@f-f
Copy link
Member Author

f-f commented Nov 2, 2022

Uh, I can repro this. I'll have a look..

@f-f f-f reopened this Nov 2, 2022
@f-f
Copy link
Member Author

f-f commented Nov 2, 2022

(in all of this, a spago build fails with a mysterious error, so I'll debug that first)

@f-f
Copy link
Member Author

f-f commented Nov 2, 2022

Ah, symbolic links always throw a wrench in:

fatal: pathspec 'node_modules/registry-app/spago.yaml' is beyond a symbolic link

I'll cook a patch, but to use it in the registry we'll have to adjust the spago run cwd thing, as that has been fixed too

@f-f
Copy link
Member Author

f-f commented Nov 3, 2022

Fixed again in 0.91.1

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

No branches or pull requests

2 participants