Skip to content

Not able to make executables #52

@alanjds

Description

@alanjds

google#366 opened by @gregoff82 on Jul 19, 2017

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions