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

Initial shot for snapcraft.yaml #2345

Merged
merged 1 commit into from
Aug 11, 2017
Merged

Initial shot for snapcraft.yaml #2345

merged 1 commit into from
Aug 11, 2017

Conversation

koppor
Copy link
Member

@koppor koppor commented Dec 7, 2016


Future tracking of SnapCraft at #3121


This outlines how we could get into the app store of Ubuntu (https://developer.ubuntu.com/en/desktop/ and https://shop.canonical.com/index.php?cPath=19). The issue is that snap is only supported in Ubuntu 16.04 LTS. Thus, this PR fails. We have to interpret following gist https://gist.github.com/evandandrea/c754964bfdfb176844f26f605ebbb8db and try to adapt it.

It seems that the IRC channel is the only help out there. The gradle support is very new (see canonical/snapcraft#912).

Is there some Linuxer out there who wants to take over?

Howto install and update

  • snap install jabref --edge --devmode
  • snap refresh jabref --edge --devmode

Current state

Snap Status

Steps after merging

  • adapt travis.yml to build snap only at the master branch (and not snapcraft).

Howto build locally

  1. docker run -it -v /d/git-repositories/jabref/jabref:/tmp/snap koppor/docker-snapcraft-java-de bash
  2. cd /tmp/jabref
  3. Read along at https://snapcraft.io/docs/build-snaps/publish

References

@koppor koppor mentioned this pull request Dec 7, 2016
6 tasks
@koppor koppor force-pushed the snapcraft branch 2 times, most recently from 69f05c2 to a7a8b3e Compare July 19, 2017 05:29
@koppor koppor force-pushed the snapcraft branch 21 times, most recently from 9b71e35 to af78a63 Compare July 23, 2017 13:31
@koppor koppor mentioned this pull request Jul 23, 2017
@koppor koppor added the status: waiting-for-feedback The submitter or other users need to provide more information about the issue label Jul 23, 2017
@koppor koppor changed the title [WIP] Initial shot for snapcraft.yaml Initial shot for snapcraft.yaml Jul 23, 2017
@koppor
Copy link
Member Author

koppor commented Jul 23, 2017

I currently cannot test, no working VM with X11. Maybe someone else has?

@Siedlerchr
Copy link
Member

Siedlerchr commented Jul 28, 2017

I get the same problems with the diriver:

libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
X Error:  BadValue
  Request Major code 154 (GLX)
  Request Minor code 24 ()
  Value 0x0
  Error Serial #32
  Current Serial #33

I found this issues which are similar and there seems to be some libgl stuff missing or whatever (not an expert in that area)
https://forum.snapcraft.io/t/build-fotoxx-snap-need-help/1355/14
https://forum.snapcraft.io/t/libgl-error-unable-to-load-driver-i965-dri-so/733

@koppor koppor force-pushed the snapcraft branch 2 times, most recently from d4be7e5 to c2f1bfb Compare August 8, 2017 06:18
@LinusDietz
Copy link
Member

@koppor do you think this is feasible for 4.0? I would really like to include this in 4.0, but then we would have to include it into a beta version, so people can test it.

@koppor
Copy link
Member Author

koppor commented Aug 8, 2017

Yes, I do think so. We also testers, so it is a very good idea to include it in beta-3.

@koppor koppor added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Aug 8, 2017
@koppor koppor changed the title [WIP] Initial shot for snapcraft.yaml Initial shot for snapcraft.yaml Aug 8, 2017
@LinusDietz LinusDietz added this to the v4.0 milestone Aug 8, 2017
.gitignore Outdated
@@ -51,83 +51,23 @@ jabref.xml



# Created by https://www.gitignore.io/api/gradle,java,jabref,intellij,eclipse,netbeans,windows,linux,macos
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened to the gitignore? This diff seems strange to me if I think about the purpose of the PR.

Copy link
Member Author

@koppor koppor Aug 8, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I just regenerated it - i regenerated using gitigonre.io 😇

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More specifically, I added snapcraft to the API call. Instead of sorting the updates out, I just replaced the whole output

Created by https://www.gitignore.io/api/gradle,java,jabref,intellij,eclipse,netbeans,windows,linux,macos,snapcraft

.gitignore Outdated
@@ -269,4 +296,5 @@ gradle-app.setting

# # Work around https://youtrack.jetbrains.com/issue/IDEA-116898
# gradle/wrapper/gradle-wrapper.properties
scenicView.properties

# End of https://www.gitignore.io/api/gradle,java,jabref,intellij,eclipse,netbeans,windows,linux,macos,snapcraft
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is this binary file below good for?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

.snapcraft/travis_snapcraft.cfg is the travis-encrypted file with my personal credentials enabling an upload to the Ubuntu app store.

.travis.yml Outdated
- if [ "$TEST_SUITE" == "checkstyle" ]; then ./gradlew checkstyleMain checkstyleTest checkstyleJmh; fi
- if [ "$TEST_SUITE" == "guiTest" ]; then ./buildres/gui-tests.sh; fi

after_success:
# enable codecov report
- ./gradlew jacocoTestReport
- bash <(curl -s https://codecov.io/bash)
- if [ "$TEST_SUITE" != "checkstyle" ] && [ "$TEST_SUITE" != "snapcraft" ]; then ./gradlew jacocoTestReport && bash <(curl -s https://codecov.io/bash); fi
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happens here? Why do you run it with checkstyle && snapcraft only?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not checkstyle and not snapcraft makes guitest and normal test... checkstyle does not run any tests and snapcroft doesn't too.

build.gradle Outdated
rename { String fileName ->
fileName.replace('-fat', '')
}
}
file("$buildDir/releases/JabRef-${project.version}.jar").setExecutable(true, true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

snapcraft.yaml Outdated
# based on https://github.com/snapcore/snapcraft/blob/master/demos/gradle/snap/snapcraft.yaml

name: jabref
version: '4.0-dev'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value needs to be documented (that it has to be changed) if it cannot be parametrized.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

run-snapcraft.sh line 3: The value is changed upon run

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll document that.

@stefan-kolb
Copy link
Member

It's not so cool that we mix our build environments again but hey...

@koppor
Copy link
Member Author

koppor commented Aug 8, 2017

Yeah, I also don't like it. However, snapcraft is supported for CircleCI 2.0 only. I tried to port our build to CircleCI 2.0 at https://github.com/JabRef/jabref/tree/circleci20, but I did not succeed. Needs much more work...

@Siedlerchr
Copy link
Member

We can also use launchpad to build snaps: It checks for new commits 4 times a day from github:
https://snapcraft.io/docs/build-snaps/ci-integration

@Siedlerchr
Copy link
Member

While JabRef now starts and runs fine, I still get the xprops error:

java.io.IOException: Cannot run program "/usr/bin/xprop": error=2, No such file or directory
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048)
	at java.lang.Runtime.exec(Runtime.java:620)
	at java.lang.Runtime.exec(Runtime.java:450)
	at java.lang.Runtime.exec(Runtime.java:347)
	at org.GNOME.Accessibility.AtkWrapper.<clinit>(AtkWrapper.java:34)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
	at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
	at java.lang.Class.newInstance(Class.java:442)
	at java.awt.Toolkit.loadAssistiveTechnologies(Toolkit.java:805)
	at java.awt.Toolkit.getDefaultToolkit(Toolkit.java:886)
	at java.awt.Toolkit.getEventQueue(Toolkit.java:1734)
	at java.awt.EventQueue.invokeLater(EventQueue.java:1266)
	at javax.swing.SwingUtilities.invokeLater(SwingUtilities.java:1290)
	at org.jabref.JabRefMain.start(JabRefMain.java:53)
	at com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$8(LauncherImpl.java:863)
	at com.sun.javafx.application.PlatformImpl.lambda$runAndWait$7(PlatformImpl.java:326)
	at com.sun.javafx.application.PlatformImpl.lambda$null$5(PlatformImpl.java:295)
	at java.security.AccessController.doPrivileged(Native Method)
	at com.sun.javafx.application.PlatformImpl.lambda$runLater$6(PlatformImpl.java:294)
	at com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
	at com.sun.glass.ui.gtk.GtkApplication._runLoop(Native Method)
	at com.sun.glass.ui.gtk.GtkApplication.lambda$null$5(GtkApplication.java:139)
	at java.lang.Thread.run(Thread.java:748)
Caused by: java.io.IOException: error=2, No such file or directory
	at java.lang.UNIXProcess.forkAndExec(Native Method)
	at java.lang.UNIXProcess.<init>(UNIXProcess.java:247)
	at java.lang.ProcessImpl.start(ProcessImpl.java:134)
	at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029)
	... 24 more

@koppor koppor mentioned this pull request Aug 10, 2017
@koppor
Copy link
Member Author

koppor commented Aug 10, 2017

I don't get the reason for the issue with x11-prop. x11-utils is included in the snap build: https://github.com/JabRef/jabref/pull/2345/files#diff-184032a532406b07009403e26f4fc62fR24 and:

$ apt-cache search xprop
x11-utils - X11 utilities

@koppor koppor changed the title Initial shot for snapcraft.yaml [WIP] Initial shot for snapcraft.yaml Aug 10, 2017
@koppor koppor removed the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Aug 10, 2017
@koppor koppor changed the title [WIP] Initial shot for snapcraft.yaml Initial shot for snapcraft.yaml Aug 10, 2017
@koppor koppor added the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Aug 10, 2017
@Siedlerchr
Copy link
Member

I get the same output, and locate xprop says:

/usr/bin/xprop
/usr/share/man/man1/xprop.1.gz

As these ATK is some gnome stuff, I believe it has to do with my Xfce desktop environment. So maybe someone with gnome or KDE can test this

I also tried to install java-atk-wrapper, not still same error
https://launchpad.net/ubuntu/+source/java-atk-wrapper

@koppor
Copy link
Member Author

koppor commented Aug 10, 2017

I would propose

  1. Merge this PR
  2. me tries to get https://snapcraft.io/docs/build-snaps/ci-integrationhttps://build.snapcraft.io/ running
  3. In parallel, we fix snapcraft.yml via PRs
  4. If the issue is fixed, we can make a JabRef release also on SnapCraft.

@koppor
Copy link
Member Author

koppor commented Aug 11, 2017

  1. The current state does not change our build system
  2. I worked in the comments of @stefan-kolb in build.gradle
  3. @Siedlerchr agreed to Initial shot for snapcraft.yaml #2345 (comment)

Thus, I merge. 😇

@koppor koppor merged commit 18fffc6 into master Aug 11, 2017
@koppor koppor deleted the snapcraft branch August 11, 2017 17:01
@koppor koppor removed the status: ready-for-review Pull Requests that are ready to be reviewed by the maintainers label Aug 11, 2017
@koppor
Copy link
Member Author

koppor commented Aug 11, 2017

Current state: gradle binary cannot be downloaded from http://build.snapcraft.io. See: canonical-web-and-design/build.snapcraft.io#918

@koppor
Copy link
Member Author

koppor commented Aug 16, 2017

The new location is handled at #3107.

@koppor
Copy link
Member Author

koppor commented Aug 18, 2017

Future tracking of SnapCraft is tracked at #3121

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

Successfully merging this pull request may close these issues.

4 participants