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

grumpc cannot compile grumpc #35

Closed
omeid opened this issue Jan 5, 2017 · 3 comments
Closed

grumpc cannot compile grumpc #35

omeid opened this issue Jan 5, 2017 · 3 comments

Comments

@omeid
Copy link

omeid commented Jan 5, 2017

Grumpy doesn't seem to be able to generate a working grumpyc in go.

$ git clone https://github.com/google/grumpy && cd grumpy
$ make
$ export GOPATH=$PWD/build
$ export PYTHONPATH=$PWD/build/lib/python2.7/site-packages
$ tools/grumpyc tools/grumypc > grumpyc.go && go build -o gorumpyc grumpyc.go 
grumpc.go:4:2: cannot find package "grumpy/lib/argparse" in any of:
	/usr/lib/go/src/grumpy/lib/argparse (from $GOROOT)
	/home/omeid/go/src/github.com/google/grumpy/build/src/grumpy/lib/argparse (from $GOPATH)
grumpc.go:5:2: cannot find package "grumpy/lib/ast" in any of:
	/usr/lib/go/src/grumpy/lib/ast (from $GOROOT)
	/home/omeid/go/src/github.com/google/grumpy/build/src/grumpy/lib/ast (from $GOPATH)
grumpc.go:6:2: cannot find package "grumpy/lib/grumpy" in any of:
	/usr/lib/go/src/grumpy/lib/grumpy (from $GOROOT)
	/home/omeid/go/src/github.com/google/grumpy/build/src/grumpy/lib/grumpy (from $GOPATH)
grumpc.go:7:2: cannot find package "grumpy/lib/grumpy/compiler" in any of:
	/usr/lib/go/src/grumpy/lib/grumpy/compiler (from $GOROOT)
	/home/omeid/go/src/github.com/google/grumpy/build/src/grumpy/lib/grumpy/compiler (from $GOPATH)
grumpc.go:8:2: cannot find package "grumpy/lib/grumpy/compiler/block" in any of:
	/usr/lib/go/src/grumpy/lib/grumpy/compiler/block (from $GOROOT)
	/home/omeid/go/src/github.com/google/grumpy/build/src/grumpy/lib/grumpy/compiler/block (from $GOPATH)
grumpc.go:9:2: cannot find package "grumpy/lib/grumpy/compiler/stmt" in any of:
	/usr/lib/go/src/grumpy/lib/grumpy/compiler/stmt (from $GOROOT)
	/home/omeid/go/src/github.com/google/grumpy/build/src/grumpy/lib/grumpy/compiler/stmt (from $GOPATH)
grumpc.go:10:2: cannot find package "grumpy/lib/grumpy/compiler/util" in any of:
	/usr/lib/go/src/grumpy/lib/grumpy/compiler/util (from $GOROOT)
	/home/omeid/go/src/github.com/google/grumpy/build/src/grumpy/lib/grumpy/compiler/util (from $GOPATH)
grumpc.go:12:2: cannot find package "grumpy/lib/textwrap" in any of:
	/usr/lib/go/src/grumpy/lib/textwrap (from $GOROOT)
	/home/omeid/go/src/github.com/google/grumpy/build/src/grumpy/lib/textwrap (from $GOPATH)

is this because third_party/stdlib uses exec and eval? If that is the case, it would be nice if tools/grumpyc actually give error or at least warnings when generating the go file.

@aniljava
Copy link

aniljava commented Jan 5, 2017

tools/grumpc is a transpiler and only does code to code translation without resolving any dependencies. You can put import something_that_doesnot_exist and it still translates to a go code. Syntax are checked by python runtime automatically as (tool/grumpc) is using python for parsing.

go build is the one that is checking the dependencies.

i dont think ast, argparse,textwrap is implemented yet for Grumpy std libs.

@S-YOU
Copy link
Contributor

S-YOU commented Jan 7, 2017

tools/grumpyc tools/grumypc

there is no such file as tools/grumypc, and you can't compile compiler itself to go even if that was a typo.

@trotterdylan trotterdylan changed the title Grumpyc failes to generate working grumpyc grumpc cannot compile grumpc Jan 9, 2017
@omeid
Copy link
Author

omeid commented Feb 12, 2017

@aniljava Thank you, that makes sense. I thought grumpy went all the way down the rabbit hole.

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

3 participants