Skip to content

Declare the javax.xml.stream shims under :jolt/provides - #2

Merged
yogthos merged 1 commit into
jolt-lang:mainfrom
burinc:feat/declare-jolt-provides
Sep 19, 2026
Merged

yogthos merged 1 commit into
jolt-lang:mainfrom
burinc:feat/declare-jolt-provides

Conversation

@burinc

@burinc burinc commented Sep 19, 2026

Copy link
Copy Markdown
Contributor

Fixes #1.

What

Declares the JDK classes jolt.xml/install! already registers under
:jolt/provides, so a Maven-loaded namespace that imports javax.xml.stream
can resolve them.

Jolt resolves the class references in a dependency namespace against the
provides table before that namespace compiles, which is earlier than any
require in this library can run. Without the declaration, a project depending
on both this library and com.cognitect.aws/api fails with

No dependency provides javax.xml.stream.XMLStreamConstants

however early install! runs.

Scope

Three classes, exactly the ones install! registers:

  • javax.xml.stream.XMLInputFactory
  • javax.xml.stream.XMLStreamConstants
  • org.xml.sax.InputSource

javax.xml.stream.XMLStreamReader is deliberately absent. The reader is a
tagged table reached through __register-class-methods!, not a registered
class, so declaring it would claim something that does not exist. aws-api names
it only in type hints, which jolt does not resolve.

Comment-only change beyond the table itself; no code touched.

Verification

  • jolt -M:test on this branch: 7 tests, 7 assertions, 0 failures, 0 errors.
  • Acceptance test against a real consumer: removed the workaround from
    jlt-commons/aws-api-jolt
    entirely — both its own :jolt/provides table and the require-for-effect
    namespace it existed to point at — pointed it at this branch via
    :local/root, and ran its suite: 24 tests, 43 assertions, green. That is
    the check that matters: the consumer needs no table of its own once this
    lands.

Verified against upstream/main at dd7b80a on 2026-09-20.

Compatibility

Mildly breaking for anyone already carrying the workaround. Jolt refuses a
duplicate claim:

two dependencies both claim to provide the host class
javax.xml.stream.XMLInputFactory: jolt-lang/xml (jolt.xml) and this project

so such a consumer must drop its own table when picking this up. I hit this
while writing the acceptance test. Might be worth a release-note line.

jolt.xml registers XMLInputFactory, XMLStreamConstants and
org.xml.sax.InputSource, but deps.edn declared none of them. Jolt
resolves the class references in a dependency namespace against the
provides table before that namespace compiles, which is earlier than
any require can run, so a library loaded from ~/.m2 that imports
javax.xml.stream fails with

  No dependency provides javax.xml.stream.XMLStreamConstants

however early install! runs. cognitect aws-api's
cognitect.aws.util.xml is one such namespace: it imports
XMLInputFactory, XMLStreamConstants and XMLStreamReader directly, so
aws-api cannot load on jolt without this.

Verified by removing the local workaround from a project that had one
(jlt-commons/aws-api-jolt, which carried its own table plus a
require-for-effect namespace) and running its suite against this
branch: 24 tests, 43 assertions, green, with no table of its own.
jolt.xml's own tests stay green at 7/7.

XMLStreamReader is deliberately not declared. The reader is a tagged
table reached through __register-class-methods!, not a registered
class, so claiming it would claim something that does not exist.

Note for anyone carrying the workaround: jolt refuses a duplicate
claim ("two dependencies both claim to provide the host class ..."),
so a consumer that declared these classes itself must drop its table
when it picks this up.
@yogthos
yogthos merged commit 90706d5 into jolt-lang:main Sep 19, 2026
1 check passed
burinc added a commit to jlt-commons/aws-api-jolt that referenced this pull request Sep 19, 2026
jolt-lang/xml#2 is merged, so xml declares javax.xml.stream.XMLInputFactory,
javax.xml.stream.XMLStreamConstants and org.xml.sax.InputSource itself. This
library no longer needs to claim them.

Keeping the table is not merely redundant, it breaks the build: jolt refuses
a duplicate claim with "two dependencies both claim to provide the host class
javax.xml.stream.XMLInputFactory", so bumping the xml pin without this change
fails to start.

Removes deps.edn's :jolt/provides table, deletes the require-for-effect
namespace it pointed at, and drops that require from the three test
namespaces. Bumps the xml pin to 90706d5.

Offline 24 tests / 43 assertions and the live four-protocol suite both stay
green.
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.

javax.xml.stream shims are registered but not declared under :jolt/provides, so a Maven library importing them cannot load

2 participants