fsprojects / fsprojects/Paket

No way to set the source encoding when using Paket Pack

Open
#1,503 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
F#
Stars
2.1k
Forks
528
Avg merge
1d 12m
Merged PRs (30d)
54

Description

I'm receiving an error when pushing a nuget package to my Nexus repository. This package is built using Paket Pack output ./. I use the exact same command on other packages, and there are no issues. After some research I've narrowed it down to the error below; ZipException invalid stored block lengths. Which seems to be associated with the source encoding. I see that paket supports preserving nuget's source encoding when converting a nuget package, but I do not see anything for specifying it when packaging.

It would be nice if we could specify the encoding in the package template and/or on the command line.

Error:

jvm 1    | Caused by: java.util.zip.ZipException: invalid stored block lengths
jvm 1    |  at java.util.zip.InflaterInputStream.read(InflaterInputStream.java:164) ~[na:1.8.0_45]
jvm 1    |  at java.util.zip.ZipInputStream.read(ZipInputStream.java:194) ~[na:1.8.0_45]
jvm 1    |  at java.util.zip.ZipInputStream.closeEntry(ZipInputStream.java:140) ~[na:1.8.0_45]
jvm 1    |  at java.util.zip.ZipInputStream.getNextEntry(ZipInputStream.java:118) ~[na:1.8.0_45]
jvm 1    |  at com.sonatype.nexus.plugins.nuget.odata.NuspecSplicer.extractNuspec(NuspecSplicer.java:133) ~[na:na]

Reference: http://stackoverflow.com/questions/25235229/extracting-zipped-file-from-resourcestream-throws-error-invalid-stored-block-le

Reproduction steps:

  1. Make a package from here: https://github.com/amplitude/unity-plugin/tree/master/Assets
  2. And attempt to upload the package to a nexus server ~v2.12.
    Note: Unzipping on the command line seems to understand it fine.

Thanks!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the Paket Pack command and the existing source-encoding preservation behavior used when converting a NuGet package. Check how package templates and command-line options are parsed, then reproduce the upload against Nexus v2.12 using the linked Unity package. Done means an encoding can be specified through the template or command line and the resulting package is accepted by Nexus.

Written by the indexing model from the issue text.

Assessment

Tech stack
fsharp
Domain
build-system, cli
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.