hexya-erp / hexya

Hexya business application development framework

Home Page:http://hexya.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

gleke opened this issue · comments

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?

@npiganeau I know the project has been frozen for some time, but it seemed interesting to me and I wanted to try it out but I have the same problem from Manjaro GNU/Linux.

go version go1.18.2 linux/amd64
lessc 4.1.2 (Less Compiler) [JavaScript]
postgres (PostgreSQL) 14.3

I have tried to create a "test" project but not all the files have been generated.

hexya]$ ls test/
go.mod  hexya.toml  main.go  pool
hexya]$ ls test/pool/h/
temp.go

I didn't want to give up, so I tried "hexya-demo", I managed to run the server and enter the web client but it doesn't seem to find the CSS besides other errors

hexya]$ ls hexya-demo/
go.mod  go.sum  hexya-demo  hexya.toml  LICENSE  main.go  pool  README.md  res
hexya]$ ls hexya-demo/pool/h/
attachment       company.go           cron              image_mixin.go       partner_title           translation
attachment.go    config_parameter     cron.go           lang                 partner_title.go        translation.go
bank             config_parameter.go  currency          lang.go              queue_channel           user
bank_account     config_settings      currency.go       model_mixin          queue_channel.go        user_change_password_wizard
bank_account.go  config_settings.go   currency_rate     model_mixin.go       queue_job               user_change_password_wizard.go
bank.go          country              currency_rate.go  partner              queue_job.go            user_change_password_wizard_line
base_mixin       country.go           filter            partner_category     sequence                user_change_password_wizard_line.go
base_mixin.go    country_group        filter.go         partner_category.go  sequence_date_range     user.go
common_mixin     country_group.go     group             partner.go           sequence_date_range.go  user_log
common_mixin.go  country_state        group.go          partner_industry     sequence.go             user_log.go
company          country_state.go     image_mixin       partner_industry.go  temp.go



./hexya-demo server
....
......
2022-06-16T01:00:50.927-0500	INFO	logging/logging.go:98		{"module": "server", "status": 200, "method": "GET", "path": "/static/web/src/xml/crash_manager.xml", "ip": "127.0.0.1", "latency": "185.149µs"}
2022-06-16T01:00:50.933-0500	INFO	logging/logging.go:98		{"module": "server", "status": 200, "method": "GET", "path": "/static/web/lib/fontawesome/fonts/fontawesome-webfont.woff2", "ip": "127.0.0.1", "latency": "24.321461ms"}
2022-06-16T01:01:59.182-0500	INFO	logging/logging.go:98		{"module": "server", "status": 303, "method": "GET", "path": "/web/session/logout", "ip": "127.0.0.1", "latency": "501.95µs"}
2022-06-16T01:01:59.212-0500	INFO	logging/logging.go:98		{"module": "server", "status": 200, "method": "GET", "path": "/web/login", "ip": "127.0.0.1", "latency": "2.679461ms"}
2022-06-16T01:01:59.351-0500	INFO	logging/logging.go:98		{"module": "server", "status": 304, "method": "GET", "path": "/web/assets/common.css", "ip": "127.0.0.1", "latency": "111.747µs"}
2022-06-16T01:01:59.370-0500	INFO	logging/logging.go:98		{"module": "server", "status": 200, "method": "GET", "path": "/web/assets/frontend.css", "ip": "127.0.0.1", "latency": "116.774µs"}
2022-06-16T01:01:59.440-0500	INFO	logging/logging.go:98		{"module": "server", "status": 200, "method": "GET", "path": "/web/binary/company_logo", "ip": "127.0.0.1", "latency": "16.026831ms"}
2022-06-16T01:03:20.554-0500	INFO	logging/logging.go:98	login successful	{"module": "base", "login": "demo", "user_id": 2}
2022-06-16T01:03:20.565-0500	INFO	logging/logging.go:98		{"module": "server", "status": 303, "method": "POST", "path": "/web/login", "ip": "127.0.0.1", "latency": "89.979957ms"}
2022-06-16T01:03:20.609-0500	INFO	logging/logging.go:98		{"module": "server", "status": 200, "method": "GET", "path": "/web/", "ip": "127.0.0.1", "latency": "35.384112ms"}
2022-06-16T01:03:20.728-0500	INFO	logging/logging.go:98		{"module": "server", "status": 304, "method": "GET", "path": "/web/assets/common.css", "ip": "127.0.0.1", "latency": "119.149µs"}
2022-06-16T01:03:20.801-0500	INFO	logging/logging.go:98		{"module": "server", "status": 200, "method": "GET", "path": "/web/assets/backend.css", "ip": "127.0.0.1", "latency": "93.727µs"}
2022-06-16T01:03:20.846-0500	INFO	logging/logging.go:98		{"module": "server", "status": 200, "method": "GET", "path": "/web/webclient/load_menus/1", "ip": "127.0.0.1", "latency": "749.048µs"}
2022-06-16T01:03:21.415-0500	INFO	logging/logging.go:98		{"module": "server", "status": 200, "method": "GET", "path": "/web/webclient/qweb/2", "ip": "127.0.0.1", "latency": "59.627142ms"}
2022-06-16T01:03:21.817-0500	INFO	logging/logging.go:98		{"module": "server", "status": 200, "method": "GET", "path": "/web/webclient/translations/3", "ip": "127.0.0.1", "latency": "252.685µs"}
2022-06-16T01:03:21.846-0500	INFO	logging/logging.go:98		{"module": "server", "status": 200, "method": "GET", "path": "/web/webclient/locale", "ip": "127.0.0.1", "latency": "259.531µs"}

hexia_client00
hexia_client01

Thanks!...

Hi,
Thanks for your interest in Hexya.
cd to your temp dir (as returned by Go's os.TempDir(), rm _web_assets_* and refresh your browser.
Does it help ?

Nice to receive your feedback, do you plan to re-update this project

@gleke It depends. See discussion here #130

Hi, Thanks for your interest in Hexya. cd to your temp dir (as returned by Go's os.TempDir(), rm _web_assets_* and refresh your browser. Does it help ?

@npiganeau why when generating a new project, there are fewer files in the /pool directory than when trying to run hexya-demo where there are more files in that directory?

Currently, do you think a hexya installation should be functional, all the repositories that hexya depends on on github to create a project are complete?

I removed that files from /tmp and refresh browser, but the result is same than images before. Not work for me... ;(

Files generated in the pool directory depend on the installed modules defined in hexya.toml config file. In hexya-demo, the web package is installed (which will automatically install also the base package). These two packages are about the only ones to be functional, but setting up a demo from hexya-demo should work (at least it works on my ubuntu PC).

Can you have a look in the network tab of your browser's developer tools, if there are any requests that are not OK ? (non 200 return code).

Files generated in the pool directory depend on the installed modules defined in hexya.toml config file. In hexya-demo, the web package is installed (which will automatically install also the base package). These two packages are about the only ones to be functional, but setting up a demo from hexya-demo should work (at least it works on my ubuntu PC).

@npiganeau sorry to bother you so much, trying all over again, creating a new project...
Am I doing something wrong? the /res directory is not created and in /pool/h I think some files are not being generated

... golang_projects]$ cd myHex/
... myHex]$ hexya project init github.com/username/myHex
go: creating new go.mod: module github.com/username/myHex
...myHex]$ ls
go.mod  hexya.toml
...myHex]$ cat go.mod 
module github.com/usename/myHex

go 1.18
... myHex]$ nano hexya.toml 
... myHex]$ hexya generate .
Hexya Generate
	--------------
Modules paths:
 - github.com/hexya-addons/web
1/5 - Loading program...Ok
2/5 - Generating symlinks...Ok
3/5 - Generating pool...Ok
4/5 - Checking the generated code...Ok
5/5 - Creating main.go in project...Ok
Pool generated successfully
... myHex]$ ls
go.mod  hexya.toml  main.go  pool        <=====**********Not generate /res directory
... myHex]$ ls pool/ 
go.mod  h  m  q
... myHex]$ ls pool/h/
temp.go                                                 <====********** just that file is generated
... myHex]$ 

Can you have a look in the network tab of your browser's developer tools, if there are any requests that are not OK ? (non 200 return code).

with hexya-demo, only "/locale" requests returns 301...everything else is 200 correctly
hexya-demo-error