Skip to content

build: further improvements for passthrough functionality#494

Merged
medubelko merged 8 commits intocanonical:devfrom
medubelko:build-passthrough-improvements
Jan 28, 2026
Merged

build: further improvements for passthrough functionality#494
medubelko merged 8 commits intocanonical:devfrom
medubelko:build-passthrough-improvements

Conversation

@medubelko
Copy link
Copy Markdown
Collaborator

@medubelko medubelko commented Jan 14, 2026

  • Make *DIR and venv vars conditional. This further helps projects that call the Makefile from a root build system.
  • Add a DOCS_ prefix to common vars in Makefile. The build environment has several variables with popular names such as BUILDDIR and SOURCEDIR. These can confuse developers of projects where the docs aren't at the root, and could collide with their root build systems.

  • Have you updated CHANGELOG.md with relevant non-documentation file changes?
    [ ] Have you updated the documentation for this change?

medubelko added a commit to medubelko/sphinx-docs-starter-pack that referenced this pull request Jan 14, 2026
Comment thread docs/Makefile Outdated
Copy link
Copy Markdown
Contributor

@dwilding dwilding left a comment

Choose a reason for hiding this comment

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

This seems like a reasonable change, thanks.

I was wondering whether it's worth introducing the DOCS_... variables in one release and then removing the old variables in a subsequent release. I guess it depends how much people have hardcoded the variable names outside the Makefile.

E.g., I searched for uses of BUILDDIR in YAML files and got two results:

  • In ops, which I can update in tandem with the next starter pack version
  • In starbase, which I'm sure you already know about

There are also projects such as microcloud, which has a custom Makefile that calls Makefile.sp with BUILDDIR set - but this is an older setup of the starter pack.

These are the uses I could find after a couple of quick searches. Do you have a better feel for how disruptive the changes might be? If it's not much more than what I found, I don't think there's any need for a staged rollout.

Comment thread docs/Makefile Outdated
Comment thread docs/Makefile Outdated
@medubelko
Copy link
Copy Markdown
Collaborator Author

Do you have a better feel for how disruptive the changes might be?

I searched for BUILDDIR and make docs in Makefiles. There are a few projects that call the docs Makefile, but I couldn't find any that deliberately use BUILDDIR. The majority of non-SP uses were from projects that use that name in their own build namespace.

I want to roll out a doc this week that will guide developers on how to consume the Makefile, so the intent of this PR is to get the ducks lined up before we describe the activity.

medubelko added a commit to medubelko/sphinx-docs-starter-pack that referenced this pull request Jan 22, 2026
@medubelko medubelko force-pushed the build-passthrough-improvements branch from e14a7d9 to cdc4ac1 Compare January 22, 2026 04:46
Comment thread docs/Makefile Outdated
Comment thread docs/Makefile Outdated
Comment thread docs/Makefile Outdated
Comment thread docs/Makefile Outdated
Comment thread docs/Makefile Outdated
Comment thread docs/Makefile Outdated
@akcano
Copy link
Copy Markdown
Contributor

akcano commented Jan 22, 2026

Do you have a better feel for how disruptive the changes might be?

I searched for BUILDDIR and make docs in Makefiles. There are a few projects that call the docs Makefile, but I couldn't find any that deliberately use BUILDDIR. The majority of non-SP uses were from projects that use that name in their own build namespace.

For added security, consider having the Makefile look for defined BUILDDIR, SOURCEDIR, etc. and say something, e.g.:

ifdef SOURCEDIR
    $(error "SOURCEDIR is deprecated")
endif

@medubelko
Copy link
Copy Markdown
Collaborator Author

or added security, consider having the Makefile look for defined BUILDDIR, SOURCEDIR, etc. and say something, e.g.:

ifdef SOURCEDIR
    $(error "SOURCEDIR is deprecated")
endif

I don't think we should, since the purpose of these changes is to make it's so it's not possible to collide with these names. If a var like BUILDDIR (used by at least one project at Canonical) is exported to the host's environment, they'll get a warning when it calls the docs.

@medubelko medubelko requested a review from akcano January 23, 2026 00:33
Copy link
Copy Markdown
Contributor

@akcano akcano left a comment

Choose a reason for hiding this comment

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

LGTM, one minor nitpick.

Comment thread docs/Makefile Outdated
This further helps projects that call the Makefile from a root build
system.
Add a `DOCS_` prefix to common vars in Makefile.

The build environment has several variables with popular names such as
`BUILDDIR` and `SOURCEDIR`. These can confuse developers of projects
where the docs aren't at the root, and could collide with their root
build systems.
Remove old var names.

Make variables more consistent:

- `DOCS_` for vars specific to the docs build.
- `<tool>_` for tool-specific vars, such as `VALE_DIR`.

Reorganise the list of vars.
@medubelko medubelko force-pushed the build-passthrough-improvements branch from 01e9516 to 26c953a Compare January 28, 2026 00:29
@medubelko medubelko merged commit e62325e into canonical:dev Jan 28, 2026
4 of 5 checks passed
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.

3 participants