mops icon indicating copy to clipboard operation
mops copied to clipboard

Supporting packages not in root directory

Open ielashi opened this issue 10 months ago • 4 comments

I have a motoko package here that I'd like to deploy to mops. However, I have it in a folder called motoko, but mops insists on having the package in the root folder. Can we support an option to specify the directory where the package is?

As a very hacky solution for now, I temporarily move the package to the root, publish on mops, then move it back again (I know, ridiculous).

ielashi avatar Feb 24 '25 13:02 ielashi

I suppose it is about repository verification. Less hacky way would be to put a copy of mops.toml in the root folder. It can be not up to date, just make sure there is name = "llm":

[package]
name = "llm"

and just publish from motoko folder

ZenVoich avatar Feb 26 '25 10:02 ZenVoich

Good to know, thanks. Perhaps a cleaner way would be to allow specifying the directory within the repo in the mops.toml file?

ielashi avatar Feb 26 '25 22:02 ielashi

We (OpenChat) have exactly the same issue with the package living in a Motoko subfolder. We have SDKs for various languages including Motoko and so Motoko can't be at the root.

https://github.com/open-chat-labs/open-chat-bots

megrogan avatar Apr 15 '25 16:04 megrogan

Implemented subfolder support for repo url. https://github.com/open-chat-labs/open-chat-bots/motoko should work now

ZenVoich avatar Apr 18 '25 07:04 ZenVoich

@fspreiss you can specify sub-directory in repository url #264 (comment)

@ZenVoich, for both

  • repository = "https://github.com/dfinity/vetkeys" and
  • repository = "https://github.com/dfinity/vetkeys/tree/main/backend/mo/ic_vetkeys"

I got

Error: Repository verification failed: Response status 404. Please double-check the repository URL and make sure the mops.toml file exists in the repository root.

using

mops --version
CLI 1.8.0
API 1.3

fspreiss avatar Jun 11 '25 07:06 fspreiss

Try repository = "https://github.com/dfinity/vetkeys/backend/mo/ic_vetkeys" (without tree/main/)

Image

ZenVoich avatar Jun 11 '25 07:06 ZenVoich

Thanks! In the meanwhile I did publish the package without the repository field as 0.1.0 (here): I guess I cannot update this now, so I can only try this next time, e.g., when we publish 0.2.0.

It probably would make sense to document how sub-directories can be used in https://docs.mops.one/mops.toml. For example, by giving a concrete example URL where the mops.toml doesn't live in the repository root.

fspreiss avatar Jun 11 '25 07:06 fspreiss

In the meanwhile I did publish the package without the repository field as 0.1.0 (here): I guess I cannot update this now, so I can only try this next time, e.g., when we publish 0.2.0.

Yes, published versions are immutable

It probably would make sense to document how sub-directories can be used in https://docs.mops.one/mops.toml. For example, by giving a concrete example URL where the mops.toml doesn't live in the repository root.

👍

ZenVoich avatar Jun 11 '25 07:06 ZenVoich

so I can only try this next time, e.g., when we publish 0.2.0

@ZenVoich, I just published https://mops.one/[email protected] and indeed repository = "https://github.com/dfinity/vetkeys/backend/mo/ic_vetkeys (without tree/main/) worked. Thanks!

fspreiss avatar Jun 18 '25 14:06 fspreiss

Should this issue be closed then? I also confirm that it works in dfinity/llm

ielashi avatar Jun 18 '25 16:06 ielashi

Glad everything working! Closing issue...

ZenVoich avatar Jun 18 '25 17:06 ZenVoich