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

Support Mac-arm64 target #218

Closed
electrum opened this issue Aug 24, 2021 · 11 comments · May be fixed by gnodet/jansi#1
Closed

Support Mac-arm64 target #218

electrum opened this issue Aug 24, 2021 · 11 comments · May be fixed by gnodet/jansi#1
Milestone

Comments

@electrum
Copy link

It would be nice if Jansi worked on the M1 so that colors work in Maven.

@mattsalt
Copy link

mattsalt commented Aug 24, 2021

Colours worked on maven 3.8.1 using Jansi 1.17.1 but not in maven 3.8.2 using Jansi 2.3.4.

Confirmed using the example snippet in the README.
System.out.println( ansi().eraseScreen().fg(RED).a("Hello").fg(GREEN).a(" World").reset() );

1.17.1
image

2.3.4
image

Stopped working in 2.1.1

@mattsalt
Copy link

Looks like there was no native method in 2.0.1 either but the exception was caught and defaulted to RESET_ANSI_AT_CLOSE

@electrum
Copy link
Author

I found that colors still work with -Dstyle.color=always.

@mattsalt
Copy link

That's handy. alias mvn="mvn -Dstyle.color=always it is then.

@davsclaus
Copy link
Member

Anyone tracked down why colors stopped workin in 2.1.1?

I dont have colours either in mvn 3.8.2

@davsclaus
Copy link
Member

$ uname -a
Darwin davsclaus-mini.local 20.6.0 Darwin Kernel Version 20.6.0: Wed Jun 23 00:26:27 PDT 2021; root:xnu-7195.141.2~5/RELEASE_ARM64_T8101 arm64

Its a apple m1 mac mini

@davsclaus
Copy link
Member

@gnodet btw when you use maven 3.8.3, and mvnd 0.6.0 then you have this on aarch64 mac apple m1

mvnd --version
Exception in thread "main" java.lang.ExceptionInInitializerError
	at org.mvndaemon.mvnd.client.DefaultClient.main(DefaultClient.java:91)
Caused by: java.lang.RuntimeException: Unable to load jansi native library
	at org.fusesource.jansi.internal.JansiLoader.initialize(JansiLoader.java:62)
	at org.fusesource.jansi.internal.CLibrary.<clinit>(CLibrary.java:30)
	... 1 more
Caused by: java.lang.Exception: No native library found for os.name=Mac, os.arch=aarch64, paths=[/opt/homebrew/Cellar/mvnd/0.6.0/libexec/mvn/lib/jansi-native/Mac/aarch64:/opt/homebrew/Cellar/mvnd/0.6.0/libexec/mvn/lib/jansi-native:/Users/davsclaus/Library/Java/Extensions:/Library/Java/Extensions:/Network/Library/Java/Extensions:/System/Library/Java/Extensions:/usr/lib/java:.]
	at org.fusesource.jansi.internal.JansiLoader.loadJansiNativeLibrary(JansiLoader.java:333)
	at org.fusesource.jansi.internal.JansiLoader.initialize(JansiLoader.java:60)
	... 2 more

So if we can get jansi to support aarch64 and into a new release then mvnd could use that and get this working ;)

gnodet added a commit to gnodet/jansi that referenced this issue Oct 5, 2021
@gnodet
Copy link
Member

gnodet commented Oct 5, 2021

Could you try the #222 PR and see if the library is valid ?
Simply building jansi and replacing the binary in mvnd / mvn installation should do the trick...
I can't really test it with my x64 Mac ;-)

@davsclaus
Copy link
Member

davsclaus commented Oct 5, 2021

@gnodet not sure if I should build it in another way, this is what I did, see the gist
https://gist.github.com/davsclaus/28fb6898dbe23cf8971a43aa892cdbfe

And this is with your PR merged.

commit 5fe9293 (HEAD -> gnodet-mac-arm64)
Author: Guillaume Nodet gnodet@gmail.com
Date: Tue Oct 5 11:54:15 2021 +0200

Support Mac-arm64 target, fixes #218

@gnodet
Copy link
Member

gnodet commented Oct 5, 2021

@gnodet not sure if I should build it in another way, this is what I did, see the gist https://gist.github.com/davsclaus/28fb6898dbe23cf8971a43aa892cdbfe

And this is with your PR merged.

commit 5fe9293 (HEAD -> gnodet-mac-arm64) Author: Guillaume Nodet gnodet@gmail.com Date: Tue Oct 5 11:54:15 2021 +0200

Support Mac-arm64 target, fixes #218

@davsclaus , this looks like maven is shading the being-built version of jansi. Could you comment the exec-maven-plugin plugin from the pom so that you can actually build jansi ?

Then simply run the following command and give the output ?

java -jar target/jansi-2.3.5-SNAPSHOT.jar

@davsclaus
Copy link
Member

gnodet added a commit to gnodet/jansi that referenced this issue Oct 13, 2021
@gnodet gnodet changed the title No native library for Mac arm64 Support Mac-arm64 target Oct 13, 2021
@gnodet gnodet closed this as completed in 454d858 Oct 13, 2021
@gnodet gnodet added this to the 2.4.0 milestone Oct 13, 2021
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 a pull request may close this issue.

4 participants