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

Merge swt.binaries repo in the swt one #2

Closed
Tracked by #10
iloveeclipse opened this issue Mar 31, 2022 · 62 comments · Fixed by eclipse-platform/eclipse.platform.swt#956
Closed
Tracked by #10

Merge swt.binaries repo in the swt one #2

iloveeclipse opened this issue Mar 31, 2022 · 62 comments · Fixed by eclipse-platform/eclipse.platform.swt#956
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@iloveeclipse
Copy link
Member

There was a good question asked on eclipse-platform/eclipse.platform#7 - why don't we use git LFS for SWT binaries? As of today, SWT is about 250 MB and it seems that the github provides 1 GB free bandwidth for git LFS repos, so it should be enough.

The benefit is surely that we don't need to synchronize two repos and have platform code & binaries in one, plus much faster clone.

@nnemkin
Copy link
Contributor

nnemkin commented Mar 31, 2022

Is the SWT binaries repo really necessary? What's the harm of building the natives on demand? Github provides build machines for the three main platforms, right? I was hoping to radically simplify SWT build process after the Github migration.

Also, if we combine SWT repos, we could attach platform specific source to the platform specific fragments and leave the main bundle empty. Physically, the source might stay in o.e.swt, but logically every binary project like o.e.swt.win32.win32_x86_64 would contain both the binaries and the source. No more .classpath switcheroo and it would be possible to work on all platforms from the same workspace simultaneously.

@iloveeclipse
Copy link
Member Author

If you bisect SWT bugs, you won't (and probably can't) build on every commit. Building natives locally is a non trivial task (requires extra dependencies to be installed with root rights etc).

@nnemkin
Copy link
Contributor

nnemkin commented Mar 31, 2022

You can't bisect across two repos anyway, can you? TBH I never tried to bisect SWT bugs.

We can make the natives build almost a trivial task, but dependencies are of course unavoidable. JDK is a dependency too, why single out native code?

@iloveeclipse
Copy link
Member Author

You can't bisect across two repos anyway, can you?

It is not the question of "can" but it is a "must have" because if you bisect SWT issues your native library version is essential to be able to start anything. And yes, I've bisected two repos and that is NOT FUN, because you have to look which commit corresponds to which native commit. Having both the code & binaries in LFS and in one repo would simplify that A LOT.

why single out native code

Because a "simple" java compile with maven doesn't need to install extra gtk/win native packages etc, and in order to do that you must be able to run tasks as a root / have access to the required packages at all. Once you have setup that, it's fine, but it is not trivial to setup. Most people don't even need that at all if they fix something in simple Java code.

@vogella
Copy link
Contributor

vogella commented Mar 31, 2022

Adding build artifacts to a Git repo also sounds wrong to me. We can publish the artifacts somewhere else to help with searching for errors. WDYT @akurtakov

@akurtakov
Copy link
Member

There have been already a discussion with @sravanlakkimsetti about that with potentially just using something like downloads.eclipse.org/eclipse/swt-natives/4567a/win32/ and having maven/ant download them.
If Git LFS could be used in an easier way - I'm all for that. The repository o.e.platform.swt.binaries is just an abomination no one dared to start the fight with. Thanks @iloveeclipse for starting this discussion.
@nnemkin let's keep the issue dedicated at getting rid of the binaries repo and merging both as what you speak of would be nice but has this one as a strong prereq.

@sravanlakkimsetti
Copy link
Member

Corporates rebuild older versions of eclipse including SWT to release eclipse based products. Building on demand is not exactly possible as many of the dependencies would not be available.

One solution is to store the built libraries in a separate repo(that is the current solution).

Regarding git LFS, The individual libraries are not that big to start with less than 1 MB. I am not sure we are qualified for the LFS here.

Adding build artifacts to a Git repo also sounds wrong to me. We can publish the artifacts somewhere else to help with searching for errors. WDYT @akurtakov

What we are doing is not wrong. These are intermediate files used for the build purposes. I feel most of the thought process is going towards building master. for master we will have machines and other dependencies available for the build purposes. But that cannot be said when we want to build older release.

For example IBM builds 4.23, 4.19, 4,15 regularly. By removing these artifacts you are forcing the end users to maintain native build infrastructure for different versions. A lot of duplicate effort and it turn into cost to the end users.

We will definitely need to have the binaries stored. Where is going to be a question. Also we should make building aggregator simpler. Before triggering a build we should not fetch artifacts by some other means.

Same problem exists for team, equinox.framework, filesystem components as well.

@laeubi
Copy link
Contributor

laeubi commented Mar 31, 2022

So probably instead of check them into the git, simply deploy them as an additional attached artifact along with the maven deployment?

@iloveeclipse
Copy link
Member Author

iloveeclipse commented Mar 31, 2022

So probably instead of check them into the git, simply deploy them as an additional attached artifact along with the maven deployment?

This is what git LFS seamlessly does for you without any 3rd party tool chain.

The individual libraries are not that big to start with less than 1 MB. I am not sure we are qualified for the LFS here.

The number of files in history does it. Cloning SWT binaries will move over wire ~1 GB just because every binary file is in the history. The sources itself are minimal, and with git LFS only last native libraries version will be needed to copy from server, not all of them.

@nnemkin
Copy link
Contributor

nnemkin commented Mar 31, 2022

@sravanlakkimsetti
Yeah, without a binaries repo, rebuilding historical releases will get more complicated, that's a real problem. But why are they rebuilding historical releases at all? Why not build them once and store in a maven/p2 repo forever?

@akurtakov
Copy link
Member

akurtakov commented Mar 31, 2022

We will definitely need to have the binaries stored. Where is going to be a question. Also we should make building aggregator simpler. Before triggering a build we should not fetch artifacts by some other means.

I believe we are all in agreement that for everyone but seasoned SWT developer having the native bits downloadable is beneficial. But this comes at a price - almost every release we have one broken build by bump of version of the host without doing so for the fragments. Not to mention other missed opportunities to simplify things. So the question is how do we organize a change in order to get more benefits than complications?

Same problem exists for team, equinox.framework, filesystem components as well.

One step at a time. Let's keep these discussions for other places. If we fix it in one place we will have better idea how to fix it in the other one. Btw, the team one is gone now after Linux moved to JNA 2 releases ago and Windows did so in master (https://bugs.eclipse.org/bugs/show_bug.cgi?id=578341). So we are getting there although the solution is totally different.

@merks
Copy link
Contributor

merks commented Mar 31, 2022

@iloveeclipse A big plus from migrating to github is that cloning is much faster. For me SWT binaries clones in just under 3 minutes...

@niraj-modi
Copy link
Member

Coping from(eclipse-platform/eclipse.platform#7 (comment)):

Merging of SWT repos will break all previous SWT build setups and back-porting of patches which will become challenging if we merge repos:

  • Also all old Eclipse build setups which we manage to work with might break(be it cherry-pick or SWT native builds)
  • And it's no brainier to rework any of the old Eclipse build setups(build scripts, libraries etc...)

Currently both of SWT-Sources & SWT-Binaries repo itself is combination of code from below 3 different platforms:

  • Windows
  • MAC
  • Linux

In general and specifically existing Eclipse/SWT wiki articles for setup/configuration are written with SWT(Source & Binaries) repo wise and it may also need to be fixed.

Sorry it's a NoGo for SWT(Sources & Binaries) repo merging.

Not only new comers but also all the existing corporate customers who just depend on Eclipse/SWT sources to build their products(on non-supported versions or non-supported platforms) are prone to break and may get out of picture for same set of reasons.

@sravanlakkimsetti
Copy link
Member

@sravanlakkimsetti Yeah, without a binaries repo, rebuilding historical releases will get more complicated, that's a real problem. But why are they rebuilding historical releases at all? Why not build them once and store in a maven/p2 repo forever?

One of the reasons could be a bug fix required in older releases. Atleast in IBM a product needs to be supported for 5 years. Any bugs reported needs to be fixed. so they end up rebuilding historical releases.

Making it difficult to build will make customers to backdown. This would a very bad idea.

I am all for optimizing. At the same time we should also make it simpler for customers to build their own products and make contributing easy. to me both are equally important one gets us funding and another gets us good fixes.

@iloveeclipse
Copy link
Member Author

iloveeclipse commented Mar 31, 2022

@merks : that depends on your provider / country.

@niraj-modi : I see your point.

Is moving SWT binaries to git LFS alone worth it then?

If we will go for LFS, we would need to:

  1. Rewrite history for SWT binaries (which shouldn't be a problem)?
  2. There should be no extra changes needed after that step (I think)
    Conversion info: https://github.com/git-lfs/git-lfs/blob/main/docs/man/git-lfs-migrate.1.ronn

Pros:

  1. Smaller clone size / faster checkout
  2. anything else?

Cons:

  1. One technology layer more
  2. anything else?

@vogella
Copy link
Contributor

vogella commented Mar 31, 2022

@niraj-modi is SWT doing a lot of backporting? Looks to me that 4.23, 4.22, 4.21 and 4.20 maintenance branch still points to commit tagged for the release.

@akurtakov
Copy link
Member

So let's try to summarize discussion so far to see whether we can come to an agreement.

  1. Biggest concern seems to be backporting fixes. If eclipse.platform.swt.binaries repository stays as it is for years, backports could be done without any breakage for old releases.
  2. When we speak about merging swt.binaries into swt repo I think no one had the intention to put actual dll/so files in swt repo but rather the rest manifests, pom, etc. I haven't looked into Git LFS so can't speak for it but one setup could be actual binaries being put in a structure like downloads.eclipse.org/eclipse/swt-natives/4567a/[gtk,mac,win] and on maven build hook download-maven-plugin to prepare-resources stage so it downloads the needed native bits for the fragment (e.g. https://github.com/eclipse/wildwebdeveloper/blob/master/org.eclipse.wildwebdeveloper/pom.xml#L34). Same could be achieved as ant builder for in workbench experience.
  3. With an approach as in 2. there will always be binaries available for people that can't/won't setup environments to rebuild natives.
  4. Fixing documentation - that is inevitable and we just have to do it.

Does it sound more applicable now?

@iloveeclipse
Copy link
Member Author

When we speak about merging swt.binaries into swt repo I think no one had the intention to put actual dll/so files in swt repo

Nope, exact that is the proposal. Have everything in one repo will simplify bisecting / changes a lot, we would not need to synchronize anything across two different repos / different locations, because everything will be in same git repository.

I haven't looked into Git LFS

Git LFS stores the text url to the file in a server in the commit, not the binary itself in the repository (it goes to the extra server storage). This means, we can push 10 MB binaries but the commit record itself will be few bytes.

@akurtakov
Copy link
Member

akurtakov commented Mar 31, 2022

When we speak about merging swt.binaries into swt repo I think no one had the intention to put actual dll/so files in swt repo

Nope, exact that is the proposal. Have everything in one repo will simplify bisecting / changes a lot, we would not need to synchronize anything across two different repos / different locations, because everything will be in same git repository.

I haven't looked into Git LFS

Git LFS stores the text url to the file in a server in the commit, not the binary itself in the repository (it goes to the extra server storage). This means, we can push 10 MB binaries but the commit record itself will be few bytes.

Thanks for explaining. What does it mean for clone time? When is the binary for given commit downloaded ? At clone time? If it practically means no slowdown for clone while having the binary when needed sounds exactly what we need.

@iloveeclipse
Copy link
Member Author

I think on clone you get only the last version of the binaries (with the checkout).
So clone should only transfer ~10 MB for SWT (8MB for all latest binaries and few MB for the entire history) I guess.

@niraj-modi
Copy link
Member

@iloveeclipse
Answering to you question posted on eclipse-platform/eclipse.platform#7 (comment): There is huge difference in sizes of SWT Source and SWT Binaries repo.

Your above comments suggests that the old SWT Binaries repo would be read-only.
Read only SWT binaries repo might be a problem with SWT build input(as we commits tag & updated binaries during native build), so we will need old SWT binaries repo in writable state to work with. Thanks!

@iloveeclipse
Copy link
Member Author

@niraj-modi : the whole point of git LFS is to avoid huge repo size.

So binaries are all on server and only fetched on checkout of a commit, in the "placeholder" there is just plain text link to the server url. I expect the SWT repo size after merge with SWT binaries be ~5 - 10 MB higher only (but I haven't tested, just looking how much space binaries taking on the actual binaries repo and how much the rest).

And for the read-only repo I meant the old one, not the new one (main SWT), which will be of course writable.

@niraj-modi
Copy link
Member

@niraj-modi : the whole point of git LFS is to avoid huge repo size.

So binaries are all on server and only fetched on checkout of a commit, in the "placeholder" there is just plain text link to the server url. I expect the SWT repo size after merge with SWT binaries be ~5 - 10 MB higher only (but I haven't tested, just looking how much space binaries taking on the actual binaries repo and how much the rest).

And for the read-only repo I meant the old one, not the new one (main SWT), which will be of course writable.

We will need writable repo not only for main master but also for maintenance branches as well(for SWT build input to work)

Note: At-least in IBM a product needs to be supported for 5 years and please check below log:
https://git.eclipse.org/c/platform/eclipse.platform.swt.binaries.git/log/?h=R4_8_maintenance

Hope you understand my concerns w.r.t. to SWT binaries repo and reason/importance of it to be writable on master/old as well :)

@akurtakov
Copy link
Member

akurtakov commented Mar 31, 2022

@iloveeclipse There is no requirement for old repo to become readonly, right? We can e.g. clean master stating that it's no longer used and is there only for support or old releases.
Do you think you can play a bit with some such repo of your own which we can play with to get better feeling of the possible implementation?

@iloveeclipse
Copy link
Member Author

Regarding read only: sure. I assumed no one need write access to the main repo and all rebuilds happen on local clones.

Regarding playing with git lfs: I surely can try if that all worka at all as planned.

@akurtakov
Copy link
Member

Regarding read only: sure. I assumed no one need write access to the main repo and all rebuilds happen on local clones.

@niraj-modi Do you have more principal concerns?

Regarding playing with git lfs: I surely can try if that all worka at all as planned.
Thanks!

@SyntevoAlex
Copy link
Member

SyntevoAlex commented Mar 31, 2022

github provides 1 GB free bandwidth for git LFS repos, so it should be enough

Note that this is 1GB bandwidth. Here are my calculations, correct me if I'm wrong:

  1. 7.28mb = sum of current *.so, *.dll, *.jnilib files in a single checkout.
  2. 1.53mb = same files compressed in .zip. Gives a rough ballpark of how much LFS bandwidth is used per checkout. Here I'm assuming that GitHub charges bandwidth in terms of transferred (compressed) git objects and not in terms of uncompressed data.
  3. This makes some 600 checkouts, for all people combined, per month.
  4. Now consider build bots. How many checkouts per month do they make? My estimate: too many.

My conclusion: Free GitHub bandwidth is not sufficient for SWT binaries repo. We could probably use a separate LFS server, but this approach sounds quite weird in the grand picture of trying to move things to GitHub.

@SyntevoAlex
Copy link
Member

SyntevoAlex commented Mar 31, 2022

Here's my attempt to summarize (and discuss) mentioned benefits:

  1. Faster clone - While I agree that cloning entire eclipse.platform.swt.binaries is slow, I need to mention that shallow clone (basically cloning just the top commit) of the repo is super fast. Takes around 1 second for me. See also Bug 562937.
  2. Easier bisecting - that's somewhat nice. On the other hand, I bisected a few times, and I can't say that manually checking out matching commit in binaries repo was a pain to me. For those who do bisecting more often, this can be further automated with a simple script (look up commit matching regex in SWT, look up same commit message in binaries, check it out there).
  3. The general "let's merge stuff" thing, which I see as a motto, but not as a justification for any action.

I'm not sure if merging is worth the trouble.

HannesWell added a commit to HannesWell/eclipse.platform.swt that referenced this issue Jan 7, 2024
Configure this Git-repository to store the SWT native binaries, i.e. all
*.dll, *.so and *jnilib files, using Git's Large File Storage (LFS) and
move the platform-specific SWT fragments from the
eclipse.platform.swt.binaries repository into the binaries folder in
this repository.

The platform specific projects are (minimally adjusted) copies of the
corresponding projects from
https://github.com/eclipse-platform/eclipse.platform.swt.binaries/tree/9cdcee51a79a3f72e10e074b87326f80d3d6ada2

The native binary files are not copied because the build triggered by
this commit will re-build and add them anyways.
Additionally the 'forceQualifier.txt' are also left out since the main
bundle only drives the qualifier.

The commit procedure when the binaries are re-build is changed to commit
the binary and pom changes in one commit.

Fixes eclipse-platform/eclipse.platform.swt.binaries#2
HannesWell added a commit to HannesWell/eclipse.platform.swt that referenced this issue Jan 8, 2024
Configure this Git-repository to store the SWT native binaries, i.e. all
*.so, *.dll and *jnilib files, using Git's Large File Storage (LFS) and
move the platform-specific SWT fragments from the
eclipse.platform.swt.binaries repository into the 'binaries' folder in
this repository.

The platform specific projects are copies (with only the adjustments
necessary due to the move) of the corresponding projects from
https://github.com/eclipse-platform/eclipse.platform.swt.binaries/tree/e58be4cbe6e638e5a190d019643bb11db49c3ade

The native binary files are not copied because the build triggered by
this commit will re-build and add them anyways.
Additionally the 'forceQualifier.txt' from the native fragments are also
left out since the main bundle only drives the qualifier.

The commit procedure when the binaries are re-build is changed to commit
the binary and pom changes in one commit.

Fixes eclipse-platform/eclipse.platform.swt.binaries#2
HannesWell added a commit to HannesWell/eclipse.platform.releng.aggregator that referenced this issue Jan 8, 2024
With eclipse-platform/eclipse.platform.swt#956
the swt native binaries are stored in the eclipse.platform.swt
repository using git-lfs. The eclipse.platform.swt.binaries repository
is therefore obsolete.

Part of eclipse-platform/eclipse.platform.swt.binaries#2
HannesWell added a commit to HannesWell/eclipse.platform.swt that referenced this issue Jan 8, 2024
Configure this Git-repository to store the SWT native binaries, i.e. all
*.so, *.dll and *jnilib files, using Git's Large File Storage (LFS) and
move the platform-specific SWT fragments from the
eclipse.platform.swt.binaries repository into the 'binaries' folder in
this repository.

The platform specific projects are copies (with only the adjustments
necessary due to the move) of the corresponding projects from
https://github.com/eclipse-platform/eclipse.platform.swt.binaries/tree/e58be4cbe6e638e5a190d019643bb11db49c3ade

The native binary files are not copied because the build triggered by
this commit will re-build and add them anyways.
Additionally the 'forceQualifier.txt' from the native fragments are also
left out since the main bundle only drives the qualifier.

The commit procedure when the binaries are re-build is changed to commit
the binary and pom changes in one commit.

Fixes eclipse-platform/eclipse.platform.swt.binaries#2
HannesWell added a commit to eclipse-platform/eclipse.platform.swt that referenced this issue Jan 8, 2024
Configure this Git-repository to store the SWT native binaries, i.e. all
*.so, *.dll and *jnilib files, using Git's Large File Storage (LFS) and
move the platform-specific SWT fragments from the
eclipse.platform.swt.binaries repository into the 'binaries' folder in
this repository.

The platform specific projects are copies (with only the adjustments
necessary due to the move) of the corresponding projects from
https://github.com/eclipse-platform/eclipse.platform.swt.binaries/tree/e58be4cbe6e638e5a190d019643bb11db49c3ade

The native binary files are not copied because the build triggered by
this commit will re-build and add them anyways.
Additionally the 'forceQualifier.txt' from the native fragments are also
left out since the main bundle only drives the qualifier.

The commit procedure when the binaries are re-build is changed to commit
the binary and pom changes in one commit.

Fixes eclipse-platform/eclipse.platform.swt.binaries#2
HannesWell added a commit to eclipse-platform/eclipse.platform.releng.aggregator that referenced this issue Jan 8, 2024
With eclipse-platform/eclipse.platform.swt#956
the swt native binaries are stored in the eclipse.platform.swt
repository using git-lfs. The eclipse.platform.swt.binaries repository
is therefore obsolete.

Part of eclipse-platform/eclipse.platform.swt.binaries#2
HannesWell added a commit to HannesWell/eclipse.platform.swt.binaries that referenced this issue Jan 8, 2024
HannesWell added a commit to HannesWell/eclipse.platform.swt.binaries that referenced this issue Jan 8, 2024
and add a README to inform about the move.

Last part of
eclipse-platform#2
HannesWell added a commit to HannesWell/eclipse.platform.swt.binaries that referenced this issue Jan 8, 2024
and add a README to inform about the move.

Last part of
eclipse-platform#2
HannesWell added a commit to HannesWell/eclipse.platform.swt.binaries that referenced this issue Jan 8, 2024
and add a README to inform about the move.

Last part of
eclipse-platform#2
HannesWell added a commit to HannesWell/eclipse.platform.swt.website that referenced this issue Jan 8, 2024
HannesWell added a commit to eclipse-platform/www.eclipse.org-swt that referenced this issue Jan 8, 2024
@iloveeclipse iloveeclipse added this to the 4.31 M2 milestone Jan 8, 2024
@iloveeclipse iloveeclipse added the enhancement New feature or request label Jan 8, 2024
@iloveeclipse iloveeclipse changed the title Store swt dll/so files on downloads.eclipse.org and merge swt.binaries repo in the swt one Merge swt.binaries repo in the swt one Jan 8, 2024
@iloveeclipse
Copy link
Member Author

@HannesWell : many thanks, it was really huge amount of hard work.

HannesWell added a commit that referenced this issue Jan 9, 2024
and add a README to inform about the move.

Last part of
#2
@HannesWell
Copy link
Member

@HannesWell : many thanks, it was really huge amount of hard work.

Thanks and you are welcome. It was indeed a lot of work but also a lot to learn.

Since there were no reports about any problems over the day I have completed this and merged #70 to clear and retire this repository.

HannesWell added a commit to HannesWell/eclipse.platform.releng.aggregator that referenced this issue Jan 14, 2024
Fix paths that are still relevant and remove obsolete occurrences.
Especially this fixes the provision of the SWT.zip files at the Eclipse
download page.

Part of eclipse-platform/eclipse.platform.swt.binaries#2
HannesWell added a commit to HannesWell/eclipse.platform.releng.aggregator that referenced this issue Jan 14, 2024
Fix paths that are still relevant and remove obsolete occurrences.
Especially this fixes the provision of the SWT.zip files at the Eclipse
download page.

Part of eclipse-platform/eclipse.platform.swt.binaries#2
HannesWell added a commit to eclipse-platform/eclipse.platform that referenced this issue Jan 14, 2024
HannesWell added a commit to eclipse-platform/eclipse.platform.releng.aggregator that referenced this issue Jan 14, 2024
Fix paths that are still relevant and remove obsolete occurrences.
Especially this fixes the provision of the SWT.zip files at the Eclipse
download page.

Part of eclipse-platform/eclipse.platform.swt.binaries#2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment