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

Code building fails on Ubuntu #1233

Open
PavelTurk opened this issue May 29, 2024 · 19 comments
Open

Code building fails on Ubuntu #1233

PavelTurk opened this issue May 29, 2024 · 19 comments

Comments

@PavelTurk
Copy link
Contributor

Code building fails on Ubuntu 20.04.3

pavel@pavel-home:~/Temp$ git clone https://github.com/FXMisc/RichTextFX
Cloning into 'RichTextFX'...
remote: Enumerating objects: 14225, done.
remote: Counting objects: 100% (758/758), done.
remote: Compressing objects: 100% (337/337), done.
remote: Total 14225 (delta 289), reused 665 (delta 231), pack-reused 13467
Receiving objects: 100% (14225/14225), 3.45 MiB | 8.11 MiB/s, done.
Resolving deltas: 100% (6066/6066), done.
pavel@pavel-home:~/Temp$ 
pavel@pavel-home:~/Temp/RichTextFX$ git pull origin pull/1232/head
From https://github.com/FXMisc/RichTextFX
 * branch            refs/pull/1232/head -> FETCH_HEAD
Updating b61a9ae..0a8e212
Fast-forward
 richtextfx/src/main/java/org/fxmisc/richtext/model/StyleSpan.java         | 17 ++++++++++++++++-
 richtextfx/src/main/java/org/fxmisc/richtext/model/StyleSpans.java        | 11 ++++++++++-
 richtextfx/src/main/java/org/fxmisc/richtext/model/StyleSpansBuilder.java | 13 ++++++++++++-
 richtextfx/src/test/java/org/fxmisc/richtext/model/ParagraphTest.java     |  3 +++
 4 files changed, 41 insertions(+), 3 deletions(-)
pavel@pavel-home:~/Temp/RichTextFX$ /opt/gradle-7.5.1/bin/gradle -Dorg.gradle.java.home=/opt/jdk-11.0.2 clean build
Starting a Gradle Daemon, 1 incompatible and 1 stopped Daemons could not be reused, use --status for details

> Configure project :richtextfx
Project :richtextfx => no module-info.java found

> Configure project :richtextfx-demos
Project :richtextfx-demos => no module-info.java found

> Task :richtextfx:compileJava
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :richtextfx:javadoc
javadoc: error - The code being documented uses packages in the unnamed module, but the packages defined in https://openjfx.io/javadoc/11/ are in named modules.
1 error

> Task :richtextfx:javadoc FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':richtextfx:javadoc'.
> Javadoc generation failed. Generated Javadoc options file (useful for troubleshooting): '/home/pavel/Temp/RichTextFX/richtextfx/build/tmp/javadoc/javadoc.options'

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 42s
7 actionable tasks: 5 executed, 2 up-to-date

@Jugen
Copy link
Collaborator

Jugen commented May 29, 2024

I don't have access to a Linux machine, so can someone please have a look into this.

On my Windows setup gradle javadoc completes successfully, with the only difference being that I'm using OpenJDK 64bit 11.0.20, while the above is on 11.0.2

@PavelTurk
Copy link
Contributor Author

@Jugen Maybe it is better to install:

  1. https://www.virtualbox.org/wiki/Downloads
  2. https://ubuntu.com/download/desktop

It will let you run tests anytime. Besides, as I remember I had problems with IT tests.

@PavelTurk
Copy link
Contributor Author

I tried to build it on Windows 7 in VirtualBox:

E:\RichTextFX>E:\gradle-7.5.1\bin\gradle.bat -Dorg.gradle.java.home=E:\jdk-11.0.0.2 clean build

Welcome to Gradle 7.5.1!

Here are the highlights of this release:
 - Support for Java 18
 - Support for building with Groovy 4
 - Much more responsive continuous builds
 - Improved diagnostics for dependency resolution

For more details see https://docs.gradle.org/7.5.1/release-notes.html

Starting a Gradle Daemon (subsequent builds will be faster)

> Configure project :richtextfx
Project :richtextfx => no module-info.java found

> Configure project :richtextfx-demos
Project :richtextfx-demos => no module-info.java found

> Task :richtextfx:compileJava
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :richtextfx:javadoc
javadoc: error - Error fetching URL: https://www.javadoc.io/doc/org.reactfx/reactfx/2.0-M5/
1 error

> Task :richtextfx:javadoc FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':richtextfx:javadoc'.
> Javadoc generation failed. Generated Javadoc options file (useful for troubleshooting): 'E:\RichTextFX\richtextfx\build\tmp\javadoc\javadoc.options'

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 1m 9s
7 actionable tasks: 5 executed, 2 up-to-date

E:\RichTextFX>

@Jugen
Copy link
Collaborator

Jugen commented Jul 3, 2024

Please try the following and let me know if it works.

In the richtextfx sub folder edit the "build.gradle" file.

Find the javadoc section (about a quater of the way down) and change the line under "// resolve links to ReactFX" to:
'https://www.javadoc.io/doc/org.reactfx/reactfx/latest/index.html'

Thanks

@PavelTurk
Copy link
Contributor Author

@Jugen This is what I did:

javadoc {
    // ignore missing Javadoc comments or tags
    options.addBooleanOption('Xdoclint:all,-missing,-accessibility', true)

    // support for JavaFX properties
    options.addBooleanOption('javafx', true);

    options.links = [
        // resolve links to Java and JavaFX Javadocs
        'https://docs.oracle.com/en/java/javase/11/docs/api/',
        'https://openjfx.io/javadoc/11/',

        // resolve links to ReactFX
        'https://www.javadoc.io/doc/org.reactfx/reactfx/latest/index.html',

        // resolve links to FXMisc projects
        'https://fxmisc.github.io/undo/javadoc/1.3.1/',
        'https://fxmisc.github.io/flowless/javadoc/0.6/',
        'https://fxmisc.github.io/wellbehaved/javadoc/0.3/'
    ]
}

And this is what I got:

E:\RichTextFX>E:\gradle-7.5.1\bin\gradle.bat -Dorg.gradle.java.home=E:\jdk-11.0.0.2 clean build

> Configure project :richtextfx
Project :richtextfx => no module-info.java found

> Configure project :richtextfx-demos
Project :richtextfx-demos => no module-info.java found

> Task :richtextfx:compileJava
Note: Some input files use unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.

> Task :richtextfx:javadoc
javadoc: error - Error fetching URL: https://www.javadoc.io/doc/org.reactfx/reactfx/latest/index.html/
1 error

> Task :richtextfx:javadoc FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':richtextfx:javadoc'.
> Javadoc generation failed. Generated Javadoc options file (useful for troubleshooting): 'E:\RichTextFX\richtextfx\build\tmp\javadoc\javadoc.options'

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 39s
7 actionable tasks: 6 executed, 1 up-to-date

E:\RichTextFX>

@Jugen
Copy link
Collaborator

Jugen commented Jul 3, 2024

Sorry, remove "index.html" from the line.

@PavelTurk
Copy link
Contributor Author

@Jugen No, didn't help:

Screenshot from 2024-07-03 15-43-15

@Jugen
Copy link
Collaborator

Jugen commented Jul 3, 2024

Then I don't know what the problem is ? The URL's exist and work fine in a browser.
And the VirtualBox has internet access, doesn't it ? So ..... ?

@PavelTurk
Copy link
Contributor Author

@Jugen Maybe it will help https://stackoverflow.com/a/47891403 . As I understand (I can be wrong) -J-Dhttp.agent=javadoc should be passed to javadoc plugin. But I don't know how to do in in gradle

@PavelTurk
Copy link
Contributor Author

@Jugen When I commented this line 'https://www.javadoc.io/doc/org.reactfx/reactfx/latest/' I got this result:

Screenshot from 2024-07-03 17-01-53

I think, it proves that internet connection works as expected. So, maybe the problem is really in user-agent for javadoc.io as I wrote in the previous post

@Jugen
Copy link
Collaborator

Jugen commented Jul 3, 2024

Glad you got it working :-)

@PavelTurk
Copy link
Contributor Author

PavelTurk commented Jul 3, 2024

@Jugen I din't get it working :) It is not OK if it is necessary to comment some lines to make it work, is it?

Could you say how to set user-agent for javadoc? We don't use gradle at all and I don't know how it could be done.

@PavelTurk
Copy link
Contributor Author

@Jugen But is seems that the problem was already solved in javadoc.io - maxcellent/javadoc.io#20 . So, the problem can be in VirtualBox connection or something else on the route to it.

@Jugen
Copy link
Collaborator

Jugen commented Jul 3, 2024

Can you try with the latest 64bit JDK 11.0.23 build please ?

@PavelTurk
Copy link
Contributor Author

@Jugen Thank you very much for your time and help. And this is result:

Windows 7, Oracle JDK

E:\>git clone https://github.com/FXMisc/RichTextFX.git
...
E:\>cd RichTextFX
E:\RichTextFX>echo %JAVA_HOME%
%JAVA_HOME%

E:\RichTextFX>E:\gradle-7.5.1\bin\gradle.bat -Dorg.gradle.java.home=E:\jdk-11.0.23 clean build
...
-------------------------------------------------------------------------
|  Results: SUCCESS (173 tests, 160 successes, 0 failures, 13 skipped)  |
-------------------------------------------------------------------------

BUILD SUCCESSFUL in 2m 8s
21 actionable tasks: 19 executed, 2 up-to-date

Ubuntu 20.04, Oracle JDK

pavel@pc:~/Temp$ git clone https://github.com/FXMisc/RichTextFX.git
...
pavel@pc:~/Temp$ cd RichTextFX/
pavel@pc:~/Temp/RichTextFX$ echo $JAVA_HOME

pavel@pc:~/Temp/RichTextFX$  /opt/gradle-7.5.1/bin/gradle -Dorg.gradle.java.home=/opt/jdk-11.0.23 clean build
....
-------------------------------------------------------------------------
|  Results: FAILURE (173 tests, 131 successes, 34 failures, 8 skipped)  |
-------------------------------------------------------------------------

173 tests completed, 34 failed, 8 skipped

> Task :richtextfx:integrationTest FAILED

FAILURE: Build failed with an exception.

Failed Tests:

AcceleratorsTests. typing_alt_control_combinations_dont_consume_events_if_they_dont_have_any_character_assigned
PageUpDownTests. page_down_leaves_caret_at_BOTTOM_of_viewport_when_LAST_line_IS_visible
PageUpDownTests. page_down_leaves_caret_at_TOP_of_viewport_when_LAST_line_NOT_visible
PageUpDownTests. page_up_leaves_caret_at_BOTTOM_of_viewport_when_FIRST_line_NOT_visible
PageUpDownTests. page_up_leaves_caret_at_TOP_of_viewport_when_FIRST_line_IS_visible
PageUpDownTests. shift_page_down_leaves_caret_at_top_of_viewport_and_makes_selection
PageUpDownTests. shift_page_up_leaves_caret_at_bottom_of_viewport_and_makes_selection
MultiLineGridlikeTextTests$When_No_Modifiers_Pressed. down_moves_caret_to_next_line
MultiLineGridlikeTextTests$When_No_Modifiers_Pressed. end_moves_caret_to_end_of_current_line
MultiLineGridlikeTextTests$When_No_Modifiers_Pressed. home_moves_caret_to_start_of_current_line
MultiLineGridlikeTextTests$When_No_Modifiers_Pressed. up_moves_caret_to_previous_line
MultiLineGridlikeTextTests$When_Shift_Is_Pressed. down
MultiLineGridlikeTextTests$When_Shift_Is_Pressed. end_selects_up_to_the_end_of_current_line
MultiLineGridlikeTextTests$When_Shift_Is_Pressed. home_selects_up_to_the_start_of_current_line
MultiLineGridlikeTextTests$When_Shift_Is_Pressed. up
MultiLineGridlikeTextTests$When_Shortcut_And_Shift_Pressed. end_selects_up_to_the_end_of_current_paragraph
MultiLineGridlikeTextTests$When_Shortcut_And_Shift_Pressed. home_selects_up_to_the_start_of_current_paragraph
MultiLineGridlikeTextTests$When_Shortcut_Is_Pressed. end_moves_caret_to_end_of_current_paragraph
MultiLineGridlikeTextTests$When_Shortcut_Is_Pressed. home_moves_caret_to_start_of_current_paragraph
MultiLineJaggedTextTests. pressing_down_moves_caret_to_next_line
MultiLineJaggedTextTests. pressing_up_moves_caret_to_previous_line
SingleLineTests$When_No_Modifiers_Pressed. left_moves_caret_one_position
SingleLineTests$When_No_Modifiers_Pressed. right_moves_caret_one_position
SingleLineTests$When_Shift_Is_Pressed. left_selects_previous_character
SingleLineTests$When_Shift_Is_Pressed. right_selects_next_character
SingleLineTests$When_Shortcut_And_Shift_Pressed. left_once_selects_up_to_left_boundary_of_current_word
SingleLineTests$When_Shortcut_And_Shift_Pressed. left_twice_selects_up_to_start_boundary_of_previous_word
SingleLineTests$When_Shortcut_And_Shift_Pressed. right_once_selects_up_to_right_boundary_of_current_word
SingleLineTests$When_Shortcut_And_Shift_Pressed. right_twice_selects_up_to_end_boundary_of_next_word
SingleLineTests$When_Shortcut_Is_Pressed. a_selects_all
SingleLineTests$When_Shortcut_Is_Pressed. left_once_moves_caret_to_left_boundary_of_current_word
SingleLineTests$When_Shortcut_Is_Pressed. left_twice_moves_caret_to_left_boundary_of_previous_word
SingleLineTests$When_Shortcut_Is_Pressed. right_once_moves_caret_to_right_boundary_of_current_word
SingleLineTests$When_Shortcut_Is_Pressed. right_twice_moves_caret_to_right_boundary_of_next_word

I would suggest to add detailed info how to build RichTextFX in readme (first of all gradle and JDK versions)

@PavelTurk
Copy link
Contributor Author

@Jugen Any ideas about building on ubuntu?

@Jugen
Copy link
Collaborator

Jugen commented Jul 8, 2024

Try gradle jar, or if you want dependencies included gradle fatJar.

@PavelTurk
Copy link
Contributor Author

@Jugen Yes, it works. But it seems to be a workaround but not the solution of the problem.

@Jugen
Copy link
Collaborator

Jugen commented Jul 8, 2024

Correct - unfortunately the proper solution is to investigate each of those failing tests and modify them so that they pass on Linux as well as on Windows.

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

No branches or pull requests

2 participants