Comments (23)
Thanks for opening this issue.
Are you sure the files are used from the appended zip? If rice doesn't detect the zip (which afaik is the case when setting zip offset failed), then it will use the files from disk. You can use (*Box).IsAppended()
to find out.
Please let me know!
from go.rice.
Hi, I have transferred the binary .exe file to another computer and tested it, it worked.
Also, it has roughly the same size as the binary generated using the embed-go
method
from go.rice.
let me try (*Box).IsAppended()
from go.rice.
Cool. And, the embed-go generated files are removed from the build for the appended version?
from go.rice.
(*Box).IsAppended()
returned true.
Actually I did not run the embed-go
version on another computer
from go.rice.
I think I know what's going on here.. What version of Go are you using?
from go.rice.
go version go1.4.2 windows/amd64
from go.rice.
Oh hmm, this is really strange... Can you share the commands you're executing?
from go.rice.
Inside src/app
, I executed
rice embed-go
go build
I waited for 1 hour and got a working binary, then I installed the GNU Zip from the link you provided, after setting the PATH, I executed
go build
rice append --exec app.exe
from go.rice.
Ah okay. So the files you're embedding are probably very large.. I guess the compiler had to use swap to load all data into memory (which caused a long compile time). I don't recommend using embed-go with large files.
So just to be sure: the files generated by embed-go were removed before the go build
for the appended version?
I can't think of anything else causing the exit code 3..
The zip tool is used to set the offset at which the zip is located. Go1.5 will support setting the offset as part of archive/zip
. But that's not being used by rice
yet. But when go1.5 is out I will add it to rice and then this error will definitely be gone.
from go.rice.
how do I know what files are generated by embed-go?
If you are taking about the .go
files, yes I have manually deleted them.
from go.rice.
I have also tried changing a javascript file and append again, the changed javascript was loaded during the execution of the binary so the append did work.
from go.rice.
Yes the .rice-box.go
files. Those can also be removed by running rice clean
inside src/app
.
And if you change the javascript file locally, but don't append. You get the older version that was appended earlier?
If so then the append worked fine. It's still really strange that an error is returned, afaik that didn't happen before. The exit code description is:
a generic error in the zipfile format was detected. Processing may have completed successfully anyway; some broken zipfiles created by other archivers have simple work-arounds.
So maybe we can ignore exitcode 3 safely. Maybe the zip created by archive/zip
doesn't conform completely to GNU zip's standard and triggers this error?
from go.rice.
Yes. Locally changed javascript files do not affect the already appended binary.
Maybe it is the nature of the files that I am trying to append? I have a few font files in various formats like otf
, eot
, ttf
, woff
, woff2
, etc.
from go.rice.
Well that shouldn't affect the zip format ofcourse..
I can't test this as I don't have a windows machine. But can you maybe try appending a box with only a .txt
file and see if the error still occurs?
from go.rice.
Yes. The error still occurs. The only file appended was a simple txt file.
from go.rice.
Do you think it's a good idea to catch exit code 3 and print a warning instead? Something like "Zip exited with code 3. [code 3 description here]. Please confirm that the append was successful." ?
I'll also keep this issue open until go1.5 is released and rice can use SetOffset
instead of calling (GNU) zip.
from go.rice.
Seems like I am the only one getting this error, Maybe wait and see if there are other people also having the same issue?
Meanwhile this thread can help people who have the error code.
from go.rice.
👍
from go.rice.
@paradite Are you still experiencing this problem?
from go.rice.
Hi, I am no longer working on the project so I have no further information to provide.
from go.rice.
Ok, then I'll close this issue.
from go.rice.
I guess this problem is the same as matrixik mentioned in #4
D:\Golibs\forks\src\github.com\pksunkara\alpaca>zip -A alpaca-full.exe
zip warning: central dir not where expected - could not adjust offsets
zip warning: (try -FF)zip error: Zip file structure invalid (alpaca-full.exe)
I am using git bash on Windows10 and got the same problem when using append zip. Though zip -A
failed, the binary is working as expected.
from go.rice.
Related Issues (20)
- golang:alpine can not install HOT 1
- Dockerize rice binary HOT 1
- Get fails on Ubuntu 16.04 HOT 5
- Nested html templates. HOT 4
- How to run rice from vendor folder?
- How to link CSS with template in box
- Getting rice-box.go file with byte Array instead of string. HOT 2
- github.com/akavel/rsrc dependency has removed coff.NewRDATA HOT 9
- "rice:command not found" after exec the two go get command HOT 1
- Problems with paths HOT 1
- Asset loading race condition causes unexpected panic
- lotus-miner and lotus-worker installation step error HOT 1
- rice append violates Mach-O file format
- Able to skip overwrite or omit creation/modification time in embed-go
- `rice embed-go` doesn't work for go modules beyond v1?
- Report a coding bug about unused result
- Improvement to the README file
- Go install doesn't work HOT 3
- use go install instead of go get
- Dependency daaku/[email protected] incompatible with Go 1.19 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from go.rice.