Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add Automatic-Module-Name #569

Open
pjfanning opened this issue Feb 26, 2022 · 5 comments
Open

add Automatic-Module-Name #569

pjfanning opened this issue Feb 26, 2022 · 5 comments

Comments

@pjfanning
Copy link
Member

sbt/sbt#3368 and maybe other factors seem to have lead to a lack of interest in supporting Jigsaw modules in Scala projects. I've seen reports of jackson-module-scala being used in some Java projects though and maybe adding an Automatic-Module-Name to the manifest.mf would be a good starting point.

@pjfanning pjfanning added the 2.14 label Feb 26, 2022
@cowtowncoder
Copy link
Member

One thing I would recommend is that if adding Automatic-Module-Name first, try to make sure that move to "real" module name later on will not break things. My impression is that this can be tricky. I wish I had more specific suggestion to give.

I usually refer to @GedMarc on module knowledge, maybe he could help here.
Change would go in 2.14.0.

@pjfanning
Copy link
Member Author

I have already added Automatic-Module-Name: com.fasterxml.jackson.module.scala on branch 2.14 and master but can remove it that is a bad idea - the module name seems like an ok one (consistent with the names of other jackson modules).

@cowtowncoder
Copy link
Member

I will defer this to you @pjfanning -- could maybe ask on jackson-dev mailing list.

Ideally I think regular module info would be nicer of course, but I don't know if Moditect usage works via SBT; I think there was no way to do that when it was briefly discussed earlier.
So maybe AMN is the best compromise here.

@GedMarc
Copy link

GedMarc commented Feb 26, 2022

@pjfanning it looks like you're going to need to wait a while longer - scala/scala-dev#139

Specifically nothing under JSE-251 has been implemented in scala, adding a module-info file will actually break it all, or simply just be ignored

Multi-Release jars still not supported, Runtime images not supported, so while adding automatic module name, might be doing something, it's certainly not doing what you think it is, with no support on the platform as yet -

Sure it builds, but what is it actually doing hmmm

The Scala compiler does not enforce the restrictions of the Java Platform Module System, which means that code that typechecks may incur linkage errors at runtime. Scala 2.13.x will eventually provide rudimentary support for this (perhaps only in nightlies built on JDK 11).

I wouldn't recommend doing this, based on the state of scala, I wouldn't infer modularity on Scala until version 3 comes out, the results will be very erratic

@pjfanning
Copy link
Member Author

@GedMarc thanks for advice. I'm aware that Scala users have little interest in Jigsaw - this issue is/was to facilitate any Java users who are. I have reverted the changes for now and will wait to see if there is general need for any Jigsaw support.

@pjfanning pjfanning removed the 2.14 label Feb 27, 2022
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

No branches or pull requests

3 participants