Skip to content

Add 'make manage' target, update readme.#1085

Open
mauritsvanrees wants to merge 2 commits into6.2from
maurits-readme-make-manage
Open

Add 'make manage' target, update readme.#1085
mauritsvanrees wants to merge 2 commits into6.2from
maurits-readme-make-manage

Conversation

@mauritsvanrees
Copy link
Copy Markdown
Member

See #1083

Comment thread README-make.md
Add a package to the checkouts:

```shell
make manage ARGS="add-checkout plone.restapi"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had to run make mxenv-clean and then make install for the checkout to work. I think it's worth mentioning.

Comment thread README-make.md Outdated

Run `make zope-start` to start the Zope instance.

### Manage checkouts and versions
Copy link
Copy Markdown
Member

@wesleybl wesleybl Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can be more explicit about the tests. I think we could add something like:

Note: Simply having a package directory under src/ is not enough for make test to pick it up.
You need to explicitly add it as a checkout and reinstall:

make manage ARGS="add-checkout plone.restapi"
make mxenv-clean
make install

Only after this will `make test TEST_PACKAGE=plone.restapi` use the source from src/.

Based on comments from Wesley.
@mauritsvanrees
Copy link
Copy Markdown
Member Author

@wesleybl I adapted and included your comments. Can you review again please?

Comment thread README-make.md
```

This does not yet checkout the package: it only updates the `checkouts.cfg` and `mxcheckouts.ini` files.
To *use* the new checkout, you still need to run `make install`.
Copy link
Copy Markdown
Member

@wesleybl wesleybl Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the package doesn't exist in src and I do:

make manage ARGS="add-checkout plone.restapi"

executing only make install, the clone doesn't occur. The mxdev command is only executed if mx.ini is modified. But make manage modifies mxcheckouts.ini and not mx.ini. See the rule:

buildout.coredev/Makefile

Lines 336 to 340 in bd4604c

SOURCES_TARGET:=$(SENTINEL_FOLDER)/sources.sentinel
$(SOURCES_TARGET): $(PROJECT_CONFIG) $(MXENV_TARGET)
@echo "Checkout project sources"
@mxdev -f -c $(PROJECT_CONFIG)
@touch $(SOURCES_TARGET)

We must also add the other files that, if modified, should execute mxdev. We must do this in include.mk:

$(SOURCES_TARGET): mxcheckouts.ini mxsources.ini mxtests.ini

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems to work, at least for this case, which is good!

But I am not sure. You basically then have this:

SOURCES_TARGET:=$(SENTINEL_FOLDER)/sources.sentinel 
$(SOURCES_TARGET): $(PROJECT_CONFIG) $(MXENV_TARGET) 
	@echo "Checkout project sources" 
	@mxdev -f -c $(PROJECT_CONFIG) 
	@touch $(SOURCES_TARGET)
$(SOURCES_TARGET): mxcheckouts.ini mxsources.ini mxtests.ini

It seems to me that this line overrides the second line, so maybe they need to be combined. Or does this happen automatically? The commands are still executed, so that part works.

@jensens Can you advise here?

Maybe in mxmake we could define it like this (if I spell it correctly):

SOURCES_TARGETS=$(PROJECT_CONFIG) $(MXENV_TARGET)
$(SOURCES_TARGET): $(SOURCES_TARGETS)
    ...

And then in our include.mk we could add:

SOURCES_TARGETS+=mxcheckouts.ini mxsources.ini mxtests.ini

But I guess that line is included too late, so it would have no effect.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The commands are still executed, so that part works.

Yes, it works. make merges all prerequisites into a single list. You can leave a comment to clarify this, since it generated some confusion.

But your idea of ​​SOURCES_TARGETS+= is good. It makes things clearer. But it would require a change in mxmake.

So my recommendation is to add the comment and open an issue in mxmake.

Comment thread README-make.md

```
make manage ARGS="add-checkout plone.restapi"
make mxenv-clean
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

make mxenv-clean that's no longer necessary with my previous comment.

Comment thread README-make.md
* In `.venv` there is a virtual environment with Plone and all test requirements installed.
* In `instance` a Zope instance is created.

Important: you may need to run `make install` twice, especially after you change something.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps it's no longer necessary to run make install twice, after my suggestion.

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

Successfully merging this pull request may close these issues.

2 participants