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

org.gradle.console=verbose breaks build config import #68

Open
super7ramp opened this issue Jul 14, 2023 · 3 comments
Open

org.gradle.console=verbose breaks build config import #68

super7ramp opened this issue Jul 14, 2023 · 3 comments

Comments

@super7ramp
Copy link

Describe the bug

conveyor make site on tutorial's JavaFx starter project fails with the following parsing error:

~/my-project> conveyor make site
❌ There was a problem parsing conveyor.conf.
Parse: Output of Gradle: 3: Key 'ay not be followed by token: '[' (if you intended '[' to be part of a key or string value, try
enclosing the key or value in double quotes)

~/my-project>

To Reproduce

  1. conveyor generate javafx com.example.my-project
  2. cd my-project
  3. ./gradlew jar
  4. conveyor make site
Complete logs
~> conveyor generate javafx com.example.my-project
💬 Generating sample project my-project
.
├─── .gitignore
├─── build.gradle
├─── conveyor.conf
├─── gradle
│    ╰─── wrapper
│         ├─── gradle-wrapper.jar
│         ╰─── gradle-wrapper.properties
├─── gradlew
├─── gradlew.bat
├─── settings.gradle
╰─── src
     ╰─── main
          ├─── java
          │    ├─── com
          │    │    ╰─── example
          │    │         ╰─── myproject
          │    │              ├─── HelloApplication.java
          │    │              ╰─── HelloController.java
          │    ╰─── module-info.java
          ╰─── resources
               ╰─── com
                    ╰─── example
                         ╰─── myproject
                              ├─── hello-view.css
                              ╰─── hello-view.fxml

A project directory has been generated for you at my-project. Now run:
 1. cd my-project
 2. ./gradlew jar
 3. conveyor make site
~> cd my-project/
~/my-project> ./gradlew jar

> Configure project :
Project : => 'com.example.myproject' Java module

> Task :compileJava
> Task :processResources
> Task :classes
> Task :jar

BUILD SUCCESSFUL in 3s
3 actionable tasks: 3 executed
~/my-project> conveyor -vvv make site
❯ Conveyor 9.3 starting up. Time is Fri, 14 Jul 2023 14:49:24 +0200
        • Command line:      -vvv
                             make
                             site 
        • Working directory: /home/antoine/dev/3-workspaces/conveyor/my-project
        • JVM arguments:     --add-modules=jdk.incubator.foreign
                             --enable-native-access=ALL-UNNAMED
                             --add-opens=java.base/sun.security.x509=ALL-UNNAMED
                             --add-opens=jdk.crypto.cryptoki/sun.security.pkcs11.wrapper=ALL-UNNAMED
                             -Dapp.dir=/home/antoine/dev/1-tools/conveyor-9.3/lib/app
                             -Dapp.displayName=Conveyor
                             -Dapp.fsname=conveyor
                             -Dapp.repositoryUrl=downloads.hydraulic.dev/conveyor
                             -Dapp.revision=0
                             -Dapp.vendor=Hydraulic
                             -Dapp.version=9.3
                             -Dflatlaf.nativeLibraryPath=system
                             -DjSerialComm.library.path=/home/antoine/dev/1-tools/conveyor-9.3/lib/app/../runtime/lib/
                             -Djava.net.useSystemProxies=true
                             -Djna.nosys=false
                             -Dpicocli.ansi=tty
                             -Djava.library.path=/home/antoine/dev/1-tools/conveyor-9.3/lib/app/../runtime/lib/:/home/antoine/dev/1-tools/conveyor-9.3/lib/app
                             -Dfile.encoding=UTF-8
        • JVM info:          Hydraulic 17.0.4.1 (17.0.4.1)
        • Running on:        Linux 6.3.4-1-default amd64
        • Config path:       /home/antoine/.config/hydraulic/conveyor
        • Cache path:        /home/antoine/.cache/hydraulic/conveyor/cache
        • Logging to:        /home/antoine/.cache/hydraulic/conveyor/logs/log.latest.txt
        You may specify TinyLog logging configuration in /home/antoine/.cache/hydraulic/conveyor/logs/logging.txt (see https://tinylog.org/v2/configuration/).
        
❯ Reached app startup in 2.594 seconds.
❯ (Re)loading build config
❯ Loading configuration from conveyor.conf [starting]
❯ Parsing HOCON [starting]
❯ Fetching https://ls2.hydraulic.software/conveyor/motd?version=9.3
❯ Including output of command in directory /home/antoine/dev/3-workspaces/conveyor/my-project: ./gradlew -q printConveyorConfig
❯ Starting operation: Including config from Gradle
❯ /usr/bin/env ./gradlew -q printConveyorConfig
❯ 
❯ 
❯ <-------------> 0% CONFIGURING [103ms]> root project<-------------> 0% CONFIGURING [203ms]<-------------> 0% EXECUTING [303ms]> :printConveyorConfig > Resolve dependencies of :runtimeClasspath// Generated by the Conveyor Gradle plugin.
❯ 
❯ // Gradle project data. The build directory is useful for importing built files.
❯ gradle.build-dir = /home/antoine/dev/3-workspaces/conveyor/my-project/build
❯ gradle.project-name = my-project
❯ app.fsname = my-project
❯ app.version = 1.0
❯ app.rdns-name = com.example.${app.fsname}
❯ 
❯ // Config from the OpenJFX plugin.
❯ include required("/stdlib/jvm/javafx/from-jmods.conf")
❯ javafx.version = 19
❯ app.jvm.modules = ${app.jvm.modules} [ javafx.controls, javafx.fxml ]
❯ 
❯ // Config from the application plugin.
❯ app.jvm.gui.main-class = com.example.myproject.HelloApplication
❯ app.linux.desktop-file."Desktop Entry".StartupWMClass = com.example.myproject.HelloApplication
❯ 
❯ // Config from the Java plugin.
❯ include required("/stdlib/jdk/17/openjdk.conf")
❯ 
❯ // Inputs from dependency configurations and the JAR task.
❯ app.inputs += /home/antoine/dev/3-workspaces/conveyor/my-project/build/libs/my-project-1.0.jar
❯ 
❯ 
❯ 
❯ <-------------> 0% WAITING> IDLE
❯ Finished after 5.802 seconds: Including config from Gradle
❯ Parsing HOCON [finished, took 6097 msec]
❯ Config exception whilst parsing
com.typesafe.config.ConfigException$Parse: Output of Gradle: 3: Key 'ay not be followed by token: '[' (if you intended '[' to be part of a key or string value, try enclosing the key or value in double quotes) @ com.typesafe.config.impl.ConfigDocumentParser$ParseContext.parseError(Unknown Source)
❯ Loading configuration from conveyor.conf [finished, took 6128 msec]
❌ There was a problem parsing conveyor.conf.
Parse: Output of Gradle: 3: Key 'ay not be followed by token: '[' (if you intended '[' to be part of a key or string value, try
enclosing the key or value in double quotes)

❯ User error, reported on the console:
        There was a problem parsing conveyor.conf.
                at hydraulic.config.BaseConfigView$Companion.rethrowErrors(Unknown Source)
                at hydraulic.config.VersionedConfigFileLoader.load(Unknown Source)
                at hydraulic.factory.config.BuildConfigFile.<init>(Unknown Source)
                at hydraulic.factory.config.ConfiguredBuildSystemApplication.createBuildConfigFile(Unknown Source)
                at hydraulic.conveyor.app.Conveyor.createBuildConfigFile(Unknown Source)
                at hydraulic.factory.config.ConfiguredBuildSystemApplication$buildConfigFile$2.invoke(Unknown Source)
                at hydraulic.factory.config.ConfiguredBuildSystemApplication$buildConfigFile$2.invoke(Unknown Source)
                at kotlin.SynchronizedLazyImpl.getValue(Unknown Source)
                at hydraulic.factory.config.ConfiguredBuildSystemApplication.getBuildConfigFile(Unknown Source)
                at hydraulic.factory.config.ConfiguredBuildSystemApplication.getConfig(Unknown Source)
                at hydraulic.conveyor.app.Conveyor.checkAuth(Unknown Source)
                at hydraulic.conveyor.app.Conveyor.checkAuthAndPrintMessages(Unknown Source)
                at hydraulic.conveyor.app.Conveyor.make(Unknown Source)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
                at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
                at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
                at java.base/java.lang.reflect.Method.invoke(Method.java:568)
                at picocli.CommandLine.executeUserObject(Unknown Source)
                at picocli.CommandLine$RunLast.executeUserObjectOfLastSubcommandWithSameParent(Unknown Source)
                at picocli.CommandLine$RunLast.handle(Unknown Source)
                at picocli.CommandLine$RunLast.handle(Unknown Source)
                at picocli.CommandLine$AbstractParseResultHandler.execute(Unknown Source)
                at picocli.CommandLine$RunLast.execute(Unknown Source)
                at hydraulic.app.impl.AppFrameworkInstance.execute(Unknown Source)
                at picocli.CommandLine.execute(Unknown Source)
                at hydraulic.app.impl.AppFrameworkRuntime.init(Unknown Source)
                at hydraulic.conveyor.app.ConveyorApplication.main(Unknown Source)
        Caused by: com.typesafe.config.ConfigException$Parse: Output of Gradle: 3: Key 'ay not be followed by token: '[' (if you intended '[' to be part of a key or string value, try enclosing the key or value in double quotes)
                at com.typesafe.config.impl.ConfigDocumentParser$ParseContext.parseError(Unknown Source)
                at com.typesafe.config.impl.ConfigDocumentParser$ParseContext.parseError(Unknown Source)
                at com.typesafe.config.impl.ConfigDocumentParser$ParseContext.parseObject(Unknown Source)
                at com.typesafe.config.impl.ConfigDocumentParser$ParseContext.parse(Unknown Source)
                at com.typesafe.config.impl.ConfigDocumentParser.parse(Unknown Source)
                at com.typesafe.config.impl.Parseable.rawParseValue(Unknown Source)
                at com.typesafe.config.impl.Parseable.rawParseValue(Unknown Source)
                at com.typesafe.config.impl.Parseable.parseValue(Unknown Source)
                at com.typesafe.config.impl.Parseable.parseValue(Unknown Source)
                at com.typesafe.config.impl.Parseable.parse(Unknown Source)
                at com.typesafe.config.ConfigFactory.parseString(Unknown Source)
                at hydraulic.config.ExecIncluder.include(Unknown Source)
                at com.typesafe.config.impl.SimpleIncluder$Proxy.include(Unknown Source)
                at com.typesafe.config.impl.ConfigParser$ParseContext.parseInclude(Unknown Source)
                at com.typesafe.config.impl.ConfigParser$ParseContext.parseObject(Unknown Source)
                at com.typesafe.config.impl.ConfigParser$ParseContext.parseValue(Unknown Source)
                at com.typesafe.config.impl.ConfigParser$ParseContext.parse(Unknown Source)
                at com.typesafe.config.impl.ConfigParser.parse(Unknown Source)
                at com.typesafe.config.impl.Parseable.rawParseValue(Unknown Source)
                at com.typesafe.config.impl.Parseable.rawParseValue(Unknown Source)
                at com.typesafe.config.impl.Parseable.parseValue(Unknown Source)
                at com.typesafe.config.impl.Parseable.parseValue(Unknown Source)
                at com.typesafe.config.impl.Parseable.parse(Unknown Source)
                at com.typesafe.config.ConfigFactory.parseFile(Unknown Source)
                at hydraulic.config.VersionedConfigFileLoader.pathToConfig(Unknown Source)
                at hydraulic.config.VersionedConfigFileLoader.parseAndMergeSources(Unknown Source)
                at hydraulic.config.VersionedConfigFileLoader.access$parseAndMergeSources(Unknown Source)
                at hydraulic.config.VersionedConfigFileLoader$load$2$1.invoke(Unknown Source)
                at hydraulic.config.VersionedConfigFileLoader$load$2$1.invoke(Unknown Source)
                ... 27 more
        
❯ Execution complete in 8.961 seconds
~/my-project>

Expected behavior

conveyor make site does not raise a parsing error.

Desktop:

  • OS: openSUSE Tumbleweed (20230604)
  • Conveyor 9.3
@mikehearn
Copy link
Member

Hi,

That's very odd - it looks like Gradle's progress output got sucked up despite the -q flag. Do you have some global Gradle settings or environment variables set that might be changing its behavior from the default?

If you run ./gradlew -q printConveyorConfig | cat then you should see only valid config - what do you get?

@super7ramp
Copy link
Author

Hi,

That's very odd - it looks like Gradle's progress output got sucked up despite the -q flag. Do you have some global Gradle settings or environment variables set that might be changing its behavior from the default?

Indeed, I have set the org.gradle.console property to verbose in my global gradle.properties. Removing it fixes the issue.

If you run ./gradlew -q printConveyorConfig | cat then you should see only valid config - what do you get?

./gradlew -q printConveyorConfig | cat
// Generated by the Conveyor Gradle plugin.

// Gradle project data. The build directory is useful for importing built files.
gradle.build-dir = /home/antoine/dev/3-workspaces/conveyor/my-project/build
gradle.project-name = my-project
app.fsname = my-project
app.version = 1.0
app.rdns-name = com.example.${app.fsname}

// Config from the OpenJFX plugin.
include required("/stdlib/jvm/javafx/from-jmods.conf")
javafx.version = 19
app.jvm.modules = ${app.jvm.modules} [ javafx.controls, javafx.fxml ]

// Config from the application plugin.
app.jvm.gui.main-class = com.example.myproject.HelloApplication
app.linux.desktop-file."Desktop Entry".StartupWMClass = com.example.myproject.HelloApplication

// Config from the Java plugin.
include required("/stdlib/jdk/17/openjdk.conf")

// Inputs from dependency configurations and the JAR task.
app.inputs += /home/antoine/dev/3-workspaces/conveyor/my-project/build/libs/my-project-1.0.jar

@mikehearn mikehearn changed the title conveyor make site on tutorial's JavaFx starter project fails with a parsing error org.gradle.console=verbose breaks build config import Jul 14, 2023
@mikehearn
Copy link
Member

Thanks. It can be argued it's a Gradle bug that -q isn't reliable, but that's life. We could try switching to the tooling API as a way to extract config rather than trying to keep stdout clean ,which is at any rate not always easy if people use println in their configure phase.

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