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

JDK architecture on mac #1092

Open
rdmueller opened this issue Mar 27, 2023 · 10 comments
Open

JDK architecture on mac #1092

rdmueller opened this issue Mar 27, 2023 · 10 comments
Assignees

Comments

@rdmueller
Copy link
Member

on apple silicon, dctw can run with two different architectures which require two different jdks.

it is expected that dtcw downloads those jdks to two different folders and switches accordingly

@mh182
Copy link
Collaborator

mh182 commented Mar 28, 2023

This issue is related to #1082.

Since I do not have a Mac could someone post the architectures we are going to support? More exactly, what is the output of the arch, respective uname command for the two architectures?

@mh182
Copy link
Collaborator

mh182 commented Mar 28, 2023

Does docToolchain need a JDK or is a JRE enough?

To install different JDKs for different architectures (or versions) I would suggest following directory structure.

.doctoolchain/
└── jdk
    ├── 11
    │   ├── aarch64
    │   └── x84
    └── 17
        ├── aarch64
        └── x84

This means we would only support 1 version for each major Java version (which IMHO is enough).

I checked the content of the different JDKs. The JDKs provided for mac has the strange folder structure to the Java binary
$HOME/.doctoolchain/jdk/Contents/Home/bin.

@mh182
Copy link
Collaborator

mh182 commented Mar 29, 2023

#1084 (comment) has some references on how to detect the correct architecture for the JVM on Apple.

@mh182
Copy link
Collaborator

mh182 commented Mar 29, 2023

@rdmueller I just saw cc21314 was merged into ng.

Was the purpose of this ticket to support JDKs for both architectures or to enforce to use of x86_64 architecture?

@mh182
Copy link
Collaborator

mh182 commented Mar 31, 2023

Could someone with a Mac provide me the output of the following commands

  • with a native Bash shell as provided with MacOS
  • if your have an ARM chip, with arch -x86_64 bash
uname -m
uname -s
arch

I would like to write test cases for the implementation.

@PacoVK
Copy link
Collaborator

PacoVK commented Apr 14, 2023

Output on Mac with ARM chip, with arch -x86_64 bash

uname -m  --> x86_64
uname -s  --> Darwin
arch --> i386

Bear in mind that running arch -x86_64 bash hints the following:
The default interactive shell is now zsh

Running the same three commands on zsh prints:

uname -m  --> arm64
uname -s  --> Darwin
arch --> arm64

@mh182
Copy link
Collaborator

mh182 commented Apr 27, 2023

I have a question regarding architecture support.

Since @PacoVK upgraded a lot of components to the newest version, I would like to test if we still need the Rosetta simulator (i.e. without arch -x86_64 bash).

Could someone with an ARM Mac test if the current ng branch works without the simulator?

@rdmueller
Copy link
Member Author

Could someone with an ARM Mac test if the current ng branch works without the simulator?

already working on it

@rdmueller
Copy link
Member Author

still a problem with org.jbake.gradle.impl.JBakeWorkAction when you do a generateSite. But works for other tasks

@rdmueller
Copy link
Member Author

btw: now that we automagically activate the emulator, we should also fetch the right jdk for the emulator..., shouldn't we?

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

When branches are created from issues, their pull requests are automatically linked.

3 participants