Skip to content

hexya generate did not work completely in ubuntu, but windows and mac is ok. #129

Description

@gleke

hexya generate did not work completely. go mod is correct (in particular the 'replace' directive), but the pool package is not generated as it should.

hexya generate .

module github.com/myusername/myhexyaproject

go 1.14

replace github.com/hexya-erp/pool v1.0.2 => /home/gleke/hexya/myproject/pool

require (
        github.com/hexya-addons/web v0.1.7
        github.com/hexya-erp/hexya v0.1.7
        github.com/spf13/cobra v0.0.5
)

pool

gleke@gleke-QTJ5:~/hexya/myproject$ cd pool
gleke@gleke-QTJ5:~/hexya/myproject/pool$ ls
go.mod  h  m  q
gleke@gleke-QTJ5:~/hexya/myproject/pool$ 
go.mod

// This file is autogenerated by hexya-generate
// DO NOT MODIFY THIS FILE - ANY CHANGES WILL BE OVERWRITTEN

module github.com/hexya-erp/pool
gleke@gleke-QTJ5:~/hexya/myproject/pool$ cd h
gleke@gleke-QTJ5:~/hexya/myproject/pool/h$ ls
temp.go
gleke@gleke-QTJ5:~/hexya/myproject/pool/h$ cd m
temp.go

// This file is autogenerated by hexya-generate
// DO NOT MODIFY THIS FILE - ANY CHANGES WILL BE OVERWRITTEN

package h

hexya generate did not work completely in ubuntu, but windows and mac is ok.

func loadProgram(targetPaths []string) ([]*packages.Package, error) {
	conf := packages.Config{
		Mode: packages.LoadAllSyntax,
	}
	fmt.Println("loadProgram()------------")
	fmt.Println(targetPaths)
	fmt.Println(conf)
	packs, err := packages.Load(&conf, targetPaths...)
	fmt.Println(packs)
	return packs, err
}

log in windows

c:\hexya-demo>hexya generate .
Hexya Generate
        --------------
Modules paths:
 - github.com/hexya-addons/web
1/5 - Loading program...loadProgram()------------
[github.com/hexya-addons/web]
{991 <nil> <nil>  [] [] <nil> <nil> false map[]}
[github.com/hexya-addons/web]
[github.com/hexya-addons/web]

log in ubuntu

gleke@meet:~/mytest$ hexya generate .
Hexya Generate
	--------------
Modules paths:
 - github.com/hexya-addons/web
1/5 - Loading program...loadProgram()------------
[github.com/hexya-addons/web]
{991 <nil> <nil>  [] [] <nil> <nil> false map[]}
[command-line-arguments]
[command-line-arguments]
Ok

packages.Load return is [command-line-arguments] in ubuntu,why?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions