Skip to content
This repository has been archived by the owner on Mar 23, 2023. It is now read-only.

Not able to make executables #366

Open
gregoff82 opened this issue Jul 19, 2017 · 4 comments
Open

Not able to make executables #366

gregoff82 opened this issue Jul 19, 2017 · 4 comments

Comments

@gregoff82
Copy link

Hi all,

I'm trying to create an executeable by following the steps here:
https://github.com/google/grumpy#method-2-grumpc

The issue is when I try to build the go file. It creates a file roughly 21kB which seems too small nor is it executeable. Also, even after making a chmod +x on the file it cannot be run. The error that occurs is:

dev@mymachine:~/grumpy$ ./hello
./hello: line 1: syntax error near unexpected token `newline'
./hello: line 1: `!<arch>'

the go file produced from the command 'build/bin/grumpc hello.py > hello.go' is:

package __main__
import (
        πg "grumpy"
)
func initModule(πF *πg.Frame, _ []*πg.Object) (*πg.Object, *πg.BaseException) {
        var πTemp001 []*πg.Object
        _ = πTemp001
        var πE *πg.BaseException; _ = πE
        for ; πF.State() >= 0; πF.PopCheckpoint() {
                switch πF.State() {
                case 0:
                default: panic("unexpected function state")
                }
                // line 1: print "hello, world"
                πF.SetLineno(1)
                πTemp001 = make([]*πg.Object, 1)
                πTemp001[0] = πg.NewStr("hello, world").ToObject()
                if πE = πg.Print(πF, πTemp001, true); πE != nil {
                        continue
                }
                return nil, nil
        }
        return nil, πE
}
var Code *πg.Code
func init() {
        Code = πg.NewCode("<module>", "hello.py", nil, 0, initModule)
        πg.RegisterModule("__main__", Code)
}

if trying to build a simple go file with the code below, it works just fine (creates an executeable which i can run directly) so I don't think it's my Go installation that's been causing the issue.

package main

import "fmt"

func main() {
    fmt.Printf("hello, world\n")
}

I'm using go version go1.8.3 linux/amd64

@trotterdylan
Copy link
Contributor

Thanks for reporting this. There was a similar issue reported on the mailing list: https://groups.google.com/forum/#!forum/grumpy-users

Basically, I've been messing around with the toolchain and those instructions no longer work. I've since updated that section of the README.

I want to make it easier to build one-off binaries like in the old instructions, so I'm going to leave this issue open to track progress on that work.

@gregoff82
Copy link
Author

Hi,

Thanks for input! Now I know that that part is still a work in progress. Looking forward to the future instructions to build one-off binaries.

Thanks again!

@jwalters-gpsw
Copy link

Need any help with this?

@ymy0
Copy link

ymy0 commented May 25, 2018

I need help please,I have the same problem!!!
So if it can't work ,how should I deal with? Can I continue to use the GRUMPY?
Please

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants