cbeust / kobalt

A Kotlin-based build system for the JVM.
Apache License 2.0
428 stars 60 forks source link

kobaltw --init kotlin failes to download kobalt zip #503

Closed still-dreaming-1 closed 5 years ago

still-dreaming-1 commented 5 years ago

I am using: Ubuntu 16.04 with the latest updates installed. openjdk 11.0.3 2019-04-16 LTS - installed via SDKMAN Kotlin version 1.3.40-release-123 (JRE 11.0.3+7-LTS) - installed via SDKMAN

I just downloaded kobalt for the first time (1.0.123), unzipped it, and added it to my path. From my project directory (it's a kotlin project), I ran kobaltw --init kotlin, and here is the output:

[Wrapper] Warning: couldn't download https://beust.com/kobalt/kobalt-1.0.123.zip
[Wrapper] Warning: couldn't download https://beust.com/kobalt/kobalt-1.0.123.zip
[Wrapper] Warning: couldn't download https://beust.com/kobalt/kobalt-1.0.123.zip
Exception in thread "main" java.nio.file.NoSuchFileException: /home/jesse/.kobalt/wrapper/dist/kobalt-1.0.123.zip
    at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
    at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:116)
    at java.base/sun.nio.fs.UnixFileAttributeViews$Basic.readAttributes(UnixFileAttributeViews.java:55)
    at java.base/sun.nio.fs.UnixFileSystemProvider.readAttributes(UnixFileSystemProvider.java:145)
    at java.base/sun.nio.fs.LinuxFileSystemProvider.readAttributes(LinuxFileSystemProvider.java:99)
    at java.base/java.nio.file.Files.readAttributes(Files.java:1763)
    at java.base/java.util.zip.ZipFile$Source.get(ZipFile.java:1225)
    at java.base/java.util.zip.ZipFile$CleanableResource.<init>(ZipFile.java:727)
    at java.base/java.util.zip.ZipFile$CleanableResource.get(ZipFile.java:844)
    at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:247)
    at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:177)
    at java.base/java.util.zip.ZipFile.<init>(ZipFile.java:191)
    at com.beust.kobalt.wrapper.Main.extractZipFile(Main.java:335)
    at com.beust.kobalt.wrapper.Main.installDistribution(Main.java:188)
    at com.beust.kobalt.wrapper.Main.installAndLaunchMain(Main.java:81)
    at com.beust.kobalt.wrapper.Main.main(Main.java:17)

Despite the error, a few changes to my files did appear. My project directory now has a kobalt/ directory with a wrapper/ subdirectory with a kobalt-wrapper.properties file inside. I also notice my home directory has a .kobalt/ directory with a wrapper/ subdirectory with a dist/ subdirectory (where it was trying to download the zip), but there are no files or anything else there.

still-dreaming-1 commented 5 years ago

I tried manually downloading the zip file (using a web browser) from that URL (from https://beust.com/kobalt/kobalt-1.0.123.zip) to that location (to /home/jesse/.kobalt/wrapper/dist/kobalt-1.0.123.zip), and then running the init command again. It did complete, but not without showing some scary sounding warnings:

kobaltw --init kotlin
[Wrapper] Warning: couldn't download https://beust.com/kobalt/kobalt-1.0.123.zip
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by com.google.inject.internal.cglib.core.$ReflectUtils$1 (file:/home/jesse/.kobalt/wrapper/dist/kobalt-1.0.123/kobalt/wrapper/kobalt-1.0.123.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of com.google.inject.internal.cglib.core.$ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
              __ __           __              __   __ 
             / //_/  ____    / /_   ____ _   / /  / /_
            / ,<    / __ \  / __ \ / __ `/  / /  / __/
           / /| |  / /_/ / / /_/ // /_/ /  / /  / /_  
          /_/ |_|  \____/ /_.___/ \__,_/  /_/   \__/  1.0.123

Downloaded artifact org.jetbrains.kotlin:kotlin-compiler-embeddable:pom:1.2.70 from Maven (https://repo1.maven.org/maven2/, default, releases+snapshots)
Downloaded artifact org.jetbrains.kotlin:kotlin-stdlib:pom:1.2.70 from Maven (https://repo1.maven.org/maven2/, default, releases+snapshots)
Downloaded artifact org.jetbrains.kotlin:kotlin-stdlib-common:pom:1.2.70 from Maven (https://repo1.maven.org/maven2/, default, releases+snapshots)
Downloaded artifact org.jetbrains:annotations:pom:13.0 from Maven (https://repo1.maven.org/maven2/, default, releases+snapshots)
Downloaded artifact org.jetbrains.kotlin:kotlin-script-runtime:pom:1.2.70 from Maven (https://repo1.maven.org/maven2/, default, releases+snapshots)
Downloaded artifact org.jetbrains.kotlin:kotlin-reflect:pom:1.2.70 from Maven (https://repo1.maven.org/maven2/, default, releases+snapshots)
Downloaded artifact org.jetbrains.kotlin:kotlin-compiler-embeddable:jar:1.2.70 from Maven (https://repo1.maven.org/maven2/, default, releases+snapshots)
Downloaded artifact org.jetbrains.kotlin:kotlin-stdlib:jar:1.2.70 from Maven (https://repo1.maven.org/maven2/, default, releases+snapshots)
Downloaded artifact org.jetbrains.kotlin:kotlin-stdlib-common:jar:1.2.70 from Maven (https://repo1.maven.org/maven2/, default, releases+snapshots)
Downloaded artifact org.jetbrains:annotations:jar:13.0 from Maven (https://repo1.maven.org/maven2/, default, releases+snapshots)
Downloaded artifact org.jetbrains.kotlin:kotlin-script-runtime:jar:1.2.70 from Maven (https://repo1.maven.org/maven2/, default, releases+snapshots)
Downloaded artifact org.jetbrains.kotlin:kotlin-reflect:jar:1.2.70 from Maven (https://repo1.maven.org/maven2/, default, releases+snapshots)
  Regular compilation time: 2304 ms

Template "kotlin" installed
Now you can run either `./kobaltw test` or `./kobaltw run`

I guess I will try using it anyways...

johanhaleby commented 5 years ago

This affects the kobaltw as well. Now I cannot build the project on travis since the wrapper cannot download the zip file.

cbeust commented 5 years ago

The warnings are not scary, the problem is https :-(

For some reason, curl is refusing to download the zip file from that location as well, but it works fine if I download from "http".

cbeust commented 5 years ago

Fixed in 1.0.125. Your next ./kobaltw assemble should update to 1.0.125 and fix that problem.

ryanthemadone commented 4 years ago

So I just downloaded kobalt for the first time and am getting this exact issue, I'm using version 1.0.129 on Windows.

still-dreaming-1 commented 4 years ago

So I just downloaded kobalt for the first time and am getting this exact issue, I'm using version 1.0.129 on Windows.

Yeah, I heard Gradle was impossible to understand, and Kobalt was made for that reason, so I tried it first. It didn't work at all. Then I tried Gradle. It somewhat works, but is extremely complicated and confusing. Eventually I ran into a problem where I couldn't get it to install what should be a very easy library to add, JUnit. I couldn't get Gradle to install it. This drove me mad, it shouldn't be this difficult just to add a simple library to my project. So I went back to a tool I knew I could use, even though I don't like it, PHP. At least there we have composer, which is very easy to use. But then I found out php-gui is basically broken and abandoned, and that was the only path that provided relatively easy to use library for making a desktop GUI. So I reexamined a language I used to use, had previously considered using for my current project, and had previously decided not to use, C#. But now everything has changed. .NET is not just a Windows thing anymore. .NET Core is actually now the most supported version of .NET by Microsoft, it gets the latest features first, and works well on Windows, Mac, and Linux. .NET Core supports both WPF and Windows Forms applications, which are both at least decent options for making a desktop GUI program like I am. The free version of Visual Studio is now Visual Studio 2019 community edition, and unlike in the past, this is actually a fairly full featured, robust IDE, not just a dumbed down version they will throw at you for free. It is even free to use for some commercial purposes, just not for enterprise use. VS runs on Windows and Mac, and I would be very surprised if they don't start supporting Linux within the somewhat near future. The .NET community has finally settled on a package manager, NuGet. I can't say too much about it, as I have intentionally never looked at a NuGet config file or learned anything about it. But that is what has been great about it so far, I haven't had to! I just use Visual Studio to search for a NuGet package I want to add to my project, install it right there through the IDE, and it just works! I have been trying to make this side project program idea of mine for years now, have tried various languages and technologies, only to always get stuck somewhere along the way, having to start over again with a new tech stack. Now one month into my latest attempt to write it in C#, and I have finished implementing the first version! Also within the last 2 days, I have started another side project, a Wear OS app for my smartwatch, and within two days I went from never even pondering developing anything for a smartwatch, to getting 37% complete with finishing the first version of my app, all still in C# still with Visual Studio 2019 Community!

I think Microsoft has a bright future ahead of them. All the other languages have ecosystems that are either too scattered, without any major official frameworks, or they are too outdated, or they are not backed by a company investing a lot of resources, just someone's side project that they inevitably lose interest in. But now that Microsoft is finally embracing other operating systems and open source, they are beginning to be a good option for development tools. If you use C# in Visual Studio, and use their official frameworks and libraries, you can have the language, IDE, runtime, and framework all made and backed by the same company, heavily investing their wealth of resources into making it a good developer experience!

Okay, rant over.

cbeust commented 4 years ago

That's a great rant :-)

I still think Kobalt has a more tractable DSL and plug-in model overall, but obviously, I'm biased. I just can't dedicate that much time on it any more, unless it starts gaining traction, which is probably unlikely.

Just today, and these past two days, I've had to wrestle with Gradle's arcane build syntax and all its caveats and oddities, copy/pasting snippets of build files from StackOverflow in the hope that it will work (9/10 times, it doesn't because these answers are obsolete and Gradle introduced breaking changes since then). Even maintaining the Google search results to just the past year yields outdated answers. It's maddening.

Anyway. Sorry you are being frustrated, I am too. I hate yak shaving. I want to write code and have tools magically work. But that seems to be too much to ask in 2020.

There's always 2025.