purescript / registry

Registry of PureScript packages and metadata about them
46 stars 14 forks source link

Update package sets #339

Closed m-bock closed 1 year ago

m-bock commented 1 year ago
{
  "packages": {
    "chameleon-styled": "0.1.0"
  }
}
pacchettibotti commented 1 year ago

Attempting to build package set update.

pacchettibotti commented 1 year ago

Built and released a new package set! Now mirroring to the package-sets repo...

pacchettibotti commented 1 year ago

Mirrored a new legacy package set.

thomashoneyman commented 1 year ago

@thought2 Would you mind trying to batch these updates together in the future just to keep the overall number of package sets in check? Thanks for keeping them updated!

m-bock commented 1 year ago

@thomashoneyman sure, actually I tried to. But the following workflow did not work:

Say I have package A and B, whereas B depends on A. Both are in the registry and in the package set.

I am using spago@next in both packages.

Now I need to update package A. I made the changes and published successfully a new version via the spago@next CLI.

Due to that change I need to update package B, too. In my local checkout of package I am adding the new version of package A as an extra dependency in the spago.yaml file. With this I can now update package B and run it locally. But when I tried to publish a new version of package B, spago tells me that I cannot, since the needed version is not in the package set. I tried with a commit hash or a version as ref.

So the only way out I found in this situation was publish a new version of the package set containing the updated package A in order to publish package B.

The workflows are quite new, so maybe I am overseeing something here. Or is it a spago issue?

thomashoneyman commented 1 year ago

cc: @f-f

You should definitely be able to publish packages without all dependencies being in the package sets. This sounds like an issue with Spago. There should be no relationship between package sets and publishing packages; the only restriction is that any dependencies you have must be in the registry within the given version bounds.

m-bock commented 1 year ago

Once I run into this situation again, I can file an issue with a specific case.

m-bock commented 1 year ago

@f-f I could image that cause for this is the same as for: https://github.com/purescript/spago/issues/978 I think the globs are correct but spago just does not download versions (if not in the package set).

f-f commented 1 year ago

Yes that's my suspicion as well! I'm trying to replicate locally but didn't manage yet (I'm on holiday this week and only have little screen time)

m-bock commented 1 year ago

Yes that's my suspicion as well! I'm trying to replicate locally but didn't manage yet (I'm on holiday this week and only have little screen time)

no hurry, enjoy your vacation!

f-f commented 1 year ago

Thanks! I just found the bug 😄

Patch incoming..

f-f commented 1 year ago

@thought2 I just released 0.93.10 which should fix the issue! I tested it locally and it seems fine (we can't yet have tests for the publishing code unfortunately), let me know if you find any more issues

m-bock commented 1 year ago

@f-f I tried to publish with spago 0.93.10 a package that depends on a package version which is not in the package set.

Link to spago.yaml: https://github.com/thought2/purescript-interactive-data.all/blob/50f0de393a657baae3cd62f8e6de95730616b56a/spago.yaml

Package depends on - chameleon-styled: ">=1.0.0 <2.0.0" 1.0.0 is in the registry. But only 0.1.0 is in the package set.

I am still getting this error: ❌ Could not find a suitable build plan, the following packages do not point to registry versions: ["chameleon-styled"]

I removed .spago dir before trying.

m-bock commented 1 year ago

Publishing via GH issue worked

pacchettibotti commented 1 year ago

The JSON input for this package update is malformed:

An error occurred while decoding a JSON value:
  Expected value of type 'Object'.

You can try again by commenting on this issue with a corrected payload.

f-f commented 1 year ago

@thought2 this issue is unrelated, a few notes:

m-bock commented 1 year ago

@f-f

I'll let you know if it worked out when I publish the next time.

f-f commented 1 year ago

Thanks! I'll try to clarify that error message to make it more actionable

m-bock commented 1 year ago

@f-f Now I tried to publish the next version with a now hopefully correct spago.yaml file: https://github.com/thought2/purescript-interactive-data.all/blob/40edf5e9103db434f80a8ad72414f783da4fec96/spago.yaml

I am getting a different error now. Below are the full logs (spago 0.93.10). Publishing via GH issue worked again.

spago publish
[...]

✅ Build succeeded.

Looking for unused and undeclared transitive dependencies...

✅ Ready for publishing. Calling the registry..

✅ Registry accepted the Publish request and is processing...

Logs from the Registry pipeline:
  2023-08-10T05:49:48.686Z Received Publish request, job id: 14583765-67aa-42f0-ade0-3d8c5e461cd7
  2023-08-10T05:49:49.055Z Fetching {
  "githubOwner": "thought2",
  "githubRepo": "purescript-interactive-data.all"
}
  2023-08-10T05:49:49.633Z [NOTIFY] Package source does not have a purs.json file, creating one from your spago.yaml file...
  2023-08-10T05:49:49.697Z Manifest does not typecheck: 

↳ /types/v1/Manifest.dhall

Error: Missing file /types/v1/Manifest.dhall

1│ /types/v1/Manifest.dhall

SCHEMA:1:1
  2023-08-10T05:49:49.701Z Found a valid purs.json file in the package source, but it does not typecheck.

❌ Registry finished processing the package, but it failed. Please fix it and try again.
pacchettibotti commented 1 year ago

The JSON input for this package update is malformed:

An error occurred while decoding a JSON value:
  Expected value of type 'Operation: Expected a valid registry operation, but provided object did not match any operation decoder.'.

You can try again by commenting on this issue with a corrected payload.

f-f commented 1 year ago

Ah, this is a problem in the deployment of the Registry server, cc @thomashoneyman