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

Add Linux X64 Support #119

Merged
merged 10 commits into from Jul 14, 2020
Merged

Add Linux X64 Support #119

merged 10 commits into from Jul 14, 2020

Conversation

napperley
Copy link
Contributor

This PR partly addresses issue #45 by only adding support for a single Kotlin Native target (linuxX64), and is the successor to PR #103 . Implementation of this PR is based on the existing JS implementation with some minor adaptations made to make it work with the Kotlin Native linuxX64 target. Use of dependencies is minimal with only the Kotlin Native Standard library, and POSIX being used. Most Linux distributions have built-in support for POSIX (Android is one of the main exceptions).

The latest stable version of Kotlin is used due to Kotlin Native currently not having proper backwards compatibility. It remains unknown if this situation will be resolved with the Kotlin 1.4 release that is arriving soon.

build.gradle.kts Outdated Show resolved Hide resolved
src/linuxX64Main/kotlin/mu/Appender.kt Show resolved Hide resolved
build.gradle.kts Outdated Show resolved Hide resolved
@oshai
Copy link
Owner

oshai commented Jun 23, 2020

@napperley is the PR ready to be merged from your perspective? If so I will create an artifact from this to verify it's ok and after we test that I will merge.

@napperley
Copy link
Contributor Author

The PR is ready to be merged.

@oshai
Copy link
Owner

oshai commented Jun 24, 2020

@napperley I tried to deploy 1.8.0.1.
bintray publish seems fine but I couldn't publish to github packages with the following error:

Caused by: org.gradle.internal.resource.transport.http.HttpErrorStatusCodeException: Could not PUT 'https://maven.pkg.github.com/MicroUtils/kotlin-logging/io/github/microutils/kotlin-logging-js/1.8.0.1/kotlin-logging-js-1.8.0.1.jar'. Received status code 422 from server: Unprocessable Entity

Did you encounter something similar?

@napperley
Copy link
Contributor Author

I have encountered the 422 error before but haven't found a way to resolve it. One theory for the error is that the same artifact (GitHub package) exists on GitHub Packages therefore the publishing fails. Unfortunately GitHub doesn't provide a way to remove a individual artifact (GitHub package) from GitHub Packages.

@oshai
Copy link
Owner

oshai commented Jun 25, 2020

I managed to release only the native artifact to github in version 1.8.0.3. Can you check that it looks ok?
If so, we might be able to exclude the js and jvm from the github publish and continue like that. Right now I just did it by commenting out those modules.

@napperley
Copy link
Contributor Author

Did a quick visual inspection of the GitHub package. Everything looks ok 👍 .

@napperley
Copy link
Contributor Author

napperley commented Jun 25, 2020

All is not well. Tried to use the GitHub linuxx64 Package in a test project, and Gradle cannot find it. Using the following in the build file:

// ...
repositories {
    jcenter()
    mavenCentral()
    maven {
        url = uri("https://maven.pkg.github.com/MicroUtils/kotlin-logging")
    }
}

kotlin {
    linuxX64 {
        compilations.getByName("main") {
            dependencies {
                val kotlinLoggingVer = "1.8.0.3"
                implementation("kotlin-logging:kotlin-logging:$kotlinLoggingVer")
            }
        }
        // ...
    }
}
// ...

Note that the base URL works: https://maven.pkg.github.com

@oshai
Copy link
Owner

oshai commented Jun 25, 2020

I think that there is a line that should be changed:

implementation("kotlin-logging:kotlin-logging-linuxx64:$kotlinLoggingVer")

Note the artifact id: kotlin-logging-linuxx64

@napperley
Copy link
Contributor Author

napperley commented Jun 25, 2020

That doesn't make a difference. Usually with Kotlin Native libraries the name of the module is omitted when adding a Kotlin Native library as a dependency, eg:
implementation("kotlin-logging:kotlin-logging:1.8.0.3")

@oshai
Copy link
Owner

oshai commented Jun 25, 2020

Might be, but as far as I understand that is how gradle find the artifact. See here: https://github.com/MicroUtils/kotlin-logging/packages/286126

@oshai
Copy link
Owner

oshai commented Jun 25, 2020

Can you try also to see if there is a difference from the version you managed to publish?

@napperley
Copy link
Contributor Author

napperley commented Jun 25, 2020

Turns out one has to authenticate (via a username and token) in order to access the GitHub Packages Maven repository which isn't going to work (the Maven repositories are private) 😦 . GitLab Maven repositories by comparison can be accessed by anyone (are public) for downloading artifacts via Gradle or Maven.

@oshai
Copy link
Owner

oshai commented Jun 25, 2020

Turns out one has to authenticate in order to access the GitHub Packages Maven repository which isn't going to work 😦 .

This is strange, because via the ui you can download it without even being signed-in.

@oshai
Copy link
Owner

oshai commented Jul 13, 2020

@napperley it seems we are a bit stuck here. What do you think about merging the code changes without the changes in the build? so we actually won't publish those artifacts yet but we'll have the code ready until we solve it, maybe with changes to multiplatform framework in kotlin.

@napperley
Copy link
Contributor Author

@oshai - If you are referring to removing the configuration for GitHub Packages then I can have it removed from the build file. Hopefully artifacts hosted by GitHub Packages in the future will be publicly accessible through Gradle.

@oshai oshai merged commit c7460f4 into oshai:master Jul 14, 2020
@oshai
Copy link
Owner

oshai commented Jul 14, 2020

Thanks @napperley , I merged it. Hope the packaging issue will be solved soon.

@oshai oshai mentioned this pull request Jul 14, 2020
thadcodes pushed a commit to thadcodes/kotlin-logging that referenced this pull request Jul 16, 2020
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

Successfully merging this pull request may close these issues.

None yet

4 participants