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

Build sts4 for LoongArch #1227

Open
Panxuefeng-loongson opened this issue Apr 11, 2024 · 7 comments
Open

Build sts4 for LoongArch #1227

Panxuefeng-loongson opened this issue Apr 11, 2024 · 7 comments

Comments

@Panxuefeng-loongson
Copy link

Expected Behavior

Make sts4 work properly on the LoongArch[1] platform

Current Behavior

The binaries downloaded from https://spring.io/tools cannot run on the LoongArch platform

Context

From https://github.com/spring-projects/sts4?tab=readme-ov-file#installation, I learned that there are four distribution integration ways for the Spring Tool Suite. I want to build Spring Tools 4 for Eclipse distribution and Spring Tools 4 for Eclipse extensions for LoongArch. For the out-of-the-box distribution way of Spring Tools 4 for Eclipse distribution, because the LoongArch version of the Eclipse is not supported by the Eclipse community, I need to use our internal version. In the code, where is the URL specified for downloading Eclipse? I may need to modify the download URL to complete the build. Also, the internal LoongArch version of Eclipse and the specified version of sts4 build differ. Will this affect the build? For the construction of Spring Tools 4 for Eclipse extensions, what should I pay attention to?

[1] https://www.loongson.cn/EN/application/list?id=39

@Panxuefeng-loongson Panxuefeng-loongson changed the title Adapt sts4 for LoongArch Build sts4 for LoongArch Apr 11, 2024
@martinlippert
Copy link
Member

The main thing to look at for this will be the eclipse-distribution directory and all the things that are included in there. This is the place where we build the ready-to-use distributions from.

The most important definitions for the distribution builds are included in https://github.com/spring-projects/sts4/blob/main/eclipse-distribution/pom.xml. This pom.xml file specifies where the distribution build finds all the necessary parts.

The build spec contains profiles for the specific Eclipse versions that we build the distributions for. At the moment, those available profiles are: e432(the upcoming Eclipse 2024-06 release), e431(for the latest Eclipse release 2024-03) and e430 (for the previous Eclipse 2023-12 release that we support). Those profiles specify where to get the necessary bits and pieces for the build of the distribution. For that, each profile section contains the repositories defined with the URLs.

If you want to build the distribution using a specific Eclipse repository instead of the main one, you would have to modify that repository, e.g. https://github.com/spring-projects/sts4/blob/main/eclipse-distribution/pom.xml#L247 if you want to build against your own repository of the Eclipse 2024-03 release.

If you go down that path, I would strongly recommend to not put random Eclipse repositories in there, but choose the compatible version. So if your own Eclipse repository that you would like to use contains the Eclipse release bits for the 2024-03 release, use that in the profile e431. And don't put an older Eclipse repo into that profile. Other repositories of that profile contain artifacts that are only compatible with that specific Eclipse release and you will run into build issues if you try to mix and match those repositories.

Here is how I would approach things:

  1. start with a fresh copy of the sts4 repository, go to eclipse-distribution and run the script at https://github.com/spring-projects/sts4/blob/main/eclipse-distribution/local-build.sh for a local snapshot build. That will use the latest Eclipse release from its source, the latest snapshot bits from the STS4 components, etc.

  2. if that succeeds, replace the Eclipse repository at https://github.com/spring-projects/sts4/blob/main/eclipse-distribution/pom.xml#L247 with the one that you maintain, but make sure it contains the pieces from the Eclipse 2024-03 release. Run the script again and see if that succeeds.

  3. Go the next steps to incorporate the necessary changes to build the distribution for the platform architecture of your choice. At the moment, there are various places in the build definitions where the platform is references, e.g. https://github.com/spring-projects/sts4/blob/main/eclipse-distribution/pom.xml#L247 (the main target definition) or https://github.com/spring-projects/sts4/blob/main/eclipse-distribution/pom.xml#L247 (where we add the JustJ JREs, which you might want to skip, not sure if they are around for your hardware architecture).

Hope that helps and provides some steps to get started here.

@martinlippert
Copy link
Member

I would also strongly recommend to do all these steps from the main branch and not go back in time to a specific tag of older releases, etc. This will cause trouble due to moved p2 repositories, changed URLs, etc. Running from the main branch will be a lot easier.

@Panxuefeng-loongson
Copy link
Author

Panxuefeng-loongson commented Apr 11, 2024

Thank you for your response. Your answers have been very helpful to me. Our internal Eclipse version is shown in the attached image, and it seems that this version of Eclipse corresponds to sts3. Does this mean we cannot proceed with the build in sts4?

2024-04-11_17-20

@martinlippert
Copy link
Member

@Panxuefeng-loongson This is a very old version of Eclipse and you will definitely not be able to install any more recent versions of the Spring Tools 4 into that.

We have archived versions of p2 repositories around for a very old version of Spring Tools 4 what was built for Eclipse 4.10 as well as the corresponding STS3 p2 repositories, so you could take an existing Eclipse installation and try to (manually or automatically) install the Spring Tools components into that existing Eclipse installation, but you would end up with extremely old versions of the Spring Tools component. It should be technically possible, but we can't provide support or detailed help for those old and outdated versions anymore.

I would strongly recommend to move to a more recent, up-to-date version of Eclipse and go from there - you will have to do that sometime soon anyway. Otherwise, you could evaluate commercial support options, but I guess you would have to get a very special deal in place to get support for those old versions... ;-)

@martinlippert
Copy link
Member

martinlippert commented Apr 11, 2024

References to the old Spring Tools 3 components can be found here:
https://github.com/spring-attic/toolsuite-distribution/wiki/Spring-Tool-Suite-3
(there is no version listed for Eclipse 4.10, but you will probably be able to guess those URLs)

A list of older versions of the Spring Tools 4 can be found here:
https://github.com/spring-projects/sts4/wiki/Previous-Versions

@Panxuefeng-loongson
Copy link
Author

  • [ ]

so you could take an existing Eclipse installation and try to (manually or automatically) install the Spring Tools components into that existing Eclipse installation

Thank you very much for your reply. Is this approach the same as the Spring Tools for Eclipse extensions?

@martinlippert
Copy link
Member

  • [ ]

so you could take an existing Eclipse installation and try to (manually or automatically) install the Spring Tools components into that existing Eclipse installation

Thank you very much for your reply. Is this approach the same as the Spring Tools for Eclipse extensions?

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants