Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Since 1.12.x gitea can no more build with several options. #12136

Closed
7 tasks
ecsgh opened this issue Jul 4, 2020 · 12 comments
Closed
7 tasks

Since 1.12.x gitea can no more build with several options. #12136

ecsgh opened this issue Jul 4, 2020 · 12 comments

Comments

@ecsgh
Copy link

ecsgh commented Jul 4, 2020

  • Gitea version (or commit ref): 1.12.1
  • Git version: 2.26.2
  • Go version: 1.14
  • nodejversion: 10.21.0
  • npm version: 6.14.4
  • Operating system: openSUSE Leap 15.2
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • MSSQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

I have try several options to build.
1.) within rpm.spec
First problem here are the external sources wich can not downloaded through build server.
But this problem are exists in 1.11.x also and can fix this when i download modules from console myself and than generate extra node_modules.tar.gz source file for rpm.spec. And i can build for 1.11x.
But not build for 1.12.x since fomantic is needed.
I can not download and build fomantic local:

First there a deprecated issues:
gitea-1.12.1/webpack.config.js
npm WARN deprecated core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated request@2.88.2: request has been deprecated, see request/request#3142
npm WARN deprecated gulp-util@3.0.8: gulp-util is deprecated - replace it, following the guidelines at https://medium.com/gulpjs/gulp-util-ca3b1f9f9ac5
npm WARN deprecated popper.js@1.16.1: You can find the new Popper v2 at @popperjs/core, this package is dedicated to the legacy v1
npm WARN deprecated chokidar@2.1.8: Chokidar 2 will break on node v14+. Upgrade to chokidar 3 with 15x less dependencies.
npm WARN deprecated core-js@1.2.7: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
npm WARN deprecated gulp-header@1.8.12: Removed event-stream from gulp-header
npm WARN deprecated fsevents@1.2.13: fsevents 1 will break on node v14+ and could be using insecure binaries. Upgrade to fsevents 2.
npm WARN deprecated urix@0.1.0: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated resolve-url@0.2.1: https://github.com/lydell/resolve-url#deprecated

Then the error output:

fomantic-ui@2.8.4 install <my_directory>/gitea-1.12.1/node_modules/fomantic-ui
gulp install

sh: gulp: Kommando nicht gefunden.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.2.7 (node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN notsup Unsupported engine for watchpack-chokidar2@2.0.0: wanted: {"node":"<8.10.0"} (current: {"node":"10.21.0","npm":"6.14.4"})
npm WARN notsup Not compatible with your version of node/npm: watchpack-chokidar2@2.0.0
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules/watchpack/node_modules/chokidar/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! fomantic-ui@2.8.4 install: gulp install
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the fomantic-ui@2.8.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:

2.) build with source from github:

git clone https://github.com/go-gitea/gitea.git
git checkout v1.12.1
TAGS="bindata" make build

Than this is the error output:

npm install --no-save

fomantic-ui@2.8.4 install /home/eric/osc/home:ecsos:server/gitea/test/github/gitea/node_modules/fomantic-ui
gulp install

sh: gulp: Kommando nicht gefunden.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! fomantic-ui@2.8.4 install: gulp install
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the fomantic-ui@2.8.4 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/eric/.npm/_logs/2020-07-04T09_41_38_785Z-debug.log
make: *** [Makefile:581: node_modules] Fehler 1

3.) Trying source from gitea.io:
Using gitea-src-1.12.1.tar.gz

TAGS="bindata" make build

This is the error output:

go: inconsistent vendoring in <my_directory>:
src.techknowlogick.com/xgo@v0.0.0-20200602060627-a09175ea9056: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt

run 'go mod vendor' to sync, or use -mod=mod or -mod=readonly to ignore the vendor directory
CC= GOOS= GOARCH= go generate -mod=vendor -tags 'bindata'
go: inconsistent vendoring in <my_directory>:
src.techknowlogick.com/xgo@v0.0.0-20200602060627-a09175ea9056: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt

run 'go mod vendor' to sync, or use -mod=mod or -mod=readonly to ignore the vendor directory
make: *** [Makefile:518: generate] Fehler 1

After i run go mod vendor i can build.
But think the source is not up to date, not in sync with needed things.

So, all three options does not run.

...

Screenshots

@silverwind
Copy link
Member

silverwind commented Jul 5, 2020

Vendoring issue should be fixed next 1.12 release with df13fc8.

As for npm, I'm not sure. It's coming from fomantic's install script https://github.com/fomantic/Fomantic-UI/blob/master/package.json#L27 and it should use gulp from the dependencies but seems to try a global version. Does manually running npm install --no-save --ignore-scripts and then TAGS="bindata" make build work?

@lafriks
Copy link
Member

lafriks commented Jul 5, 2020

You can download source with precompiled frontend from dl.gitea.io and just use TAGS="bindata" make backend

@lafriks lafriks closed this as completed Jul 5, 2020
@lafriks lafriks reopened this Jul 5, 2020
@ecsgh
Copy link
Author

ecsgh commented Jul 6, 2020

You can download source with precompiled frontend from dl.gitea.io and just use TAGS="bindata" make backend

No i can't.
As i descriped under point three.

There error is:

go: inconsistent vendoring in <my_dir>:
src.techknowlogick.com/xgo@v0.0.0-20200602060627-a09175ea9056: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt

run 'go mod vendor' to sync, or use -mod=mod or -mod=readonly to ignore the vendor directory
CC= GOOS= GOARCH= go generate -mod=vendor -tags 'bindata'
go: inconsistent vendoring in <my_dir>:
src.techknowlogick.com/xgo@v0.0.0-20200602060627-a09175ea9056: is explicitly required in go.mod, but not marked as explicit in vendor/modules.txt

run 'go mod vendor' to sync, or use -mod=mod or -mod=readonly to ignore the vendor directory
make: *** [Makefile:518: generate] Fehler 1

Only after "go mod vendor".
But this does not run on build server.

@silverwind
Copy link
Member

As I said, go: inconsistent vendoring will be fixed in the next 1.12 release. The npm error could be an actual bug, please provide feedback for my question above.

@ecsgh
Copy link
Author

ecsgh commented Jul 6, 2020

As I said, go: inconsistent vendoring will be fixed in the next 1.12 release. The npm error could be an actual bug, please provide feedback for my question above.

Yes. And my answer was not for you. It was for lafriks.

I have now do npm install --no-save --ignore-scripts and then TAGS="bindata" make build
But does not run completely.

First npm install --no-save --ignore-scripts run without error.

Second TAGS="bindata" make build aks after compile about webpack-cli

[11:25:15] Finished 'build' after 35 s
rm -rf public/js public/css public/fonts public/serviceworker.js
npx webpack --hide-modules --display-entrypoints=false
npx: Installierte 343 in 102.065s
One CLI for webpack must be installed. These are recommended choices, delivered as separate packages:
 - webpack-cli (https://github.com/webpack/webpack-cli)
   The original webpack full-featured CLI.
We will use "npm" to install the CLI via "npm install -D".
Do you want to install 'webpack-cli' (yes/no):

Now i answer "yes" and the error was:

Installing 'webpack-cli' (running 'npm install -D webpack-cli')...
npm notice save webpack-cli is being moved from dependencies to devDependencies
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ webpack-cli@3.3.11
updated 1 package and audited 1811 packages in 10.327s
found 290 low severity vulnerabilities
  run `npm audit fix` to fix them, or `npm audit` for details
{ Error: Cannot find module 'webpack-cli'
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
    at Function.Module._load (internal/modules/cjs/loader.js:562:25)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at runCommand.then (<my_homedir>/.npm/_npx/8431/lib/node_modules/webpack/bin/webpack.js:143:5)
    at process._tickCallback (internal/process/next_tick.js:68:7) code: 'MODULE_NOT_FOUND' }
make: *** [Makefile:606: public/js/index.js] Fehler 1

The webpack-cli was in die node_modules from gitea. But when i see right, install will use it from homedir?
Why?

Another question:
Why can you not all nodejs-vendor-packages which are need for gitea put in source?
A build server has no rights to go outside.

@silverwind
Copy link
Member

npx should always prefer local modules, I'm not sure why it's looking for globals in your case. Any custom npm configuration?

Why can you not all nodejs-vendor-packages which are need for gitea put in source?

The src tarballs include node_modules and pre-built webpack files. You can just run make backend on them which does not even require Node.

@ecsgh
Copy link
Author

ecsgh commented Jul 14, 2020

The bug persists. But I wanted to announce the status and that I have now managed to create the new gitea version 12.2 in the BuildServer.

On the console of the PC:

- node_module installed for gitea
- node_module for fomatintic-ui installed
- fomantic-ui downloaded as tar
- unpacked fomantic-ui in node_modules
- tar created with all node_modules

Then the sources of gitea github and the created node_modules tarfile are inserted in rpm.spec.
Then in the spec:

npx ./node_modules/.bin/eslint web_src / js webpack.config.js
npx ./node_modules/.bin/stylelint web_src / less
cp web_src / fomantic / theme.config.less node_modules / fomantic-ui / src / theme.config
cp -r web_src / fomantic / _site / * node_modules / fomantic-ui / src / _site /
cp web_src / fomantic / css.js node_modules / fomantic-ui / tasks / build / css.js
npx ./node_modules/.bin/gulp -f node_modules / fomantic-ui / gulpfile.js build
npx ./node_modules/.bin/webpack --hide-modules --display-entrypoints = false
go build -mod = vendor

But should this be the solution?

@mrsdizzie
Copy link
Member

All that should be needed to build from source is download https://dl.gitea.io/gitea/1.12.2/gitea-src-1.12.2.tar.gz, decompress, and run make backend. That is the solution to building without npm etc... as we provide it

@ecsgh
Copy link
Author

ecsgh commented Jul 14, 2020

Possible.
But in 1.12.1 it was not possible because modules were missing.
And that was not the first time.

I am also so sure that I really only get the original nodejs modules.
And only those that I really need.
Something else is beautiful, however.

I don't understand the meaning of all the nodejs modules anyway.
The application worked the same way without the nodejs module, was significantly smaller and looked exactly the same.
For me, the nodejs modules are completely superfluous.

@zeripath
Copy link
Contributor

@ecsgh it's not clear from your last comment, but does make backend not work?

If it does work and produces a working Gitea then I think we can close this issue.

@silverwind
Copy link
Member

TAGS=bindata make backend off a src tarball does not need node_modules (but still ships them) or a internet connection for that matter and will should produce a working binary.

@stale
Copy link

stale bot commented Sep 12, 2020

This issue has been automatically marked as stale because it has not had recent activity. I am here to help clear issues left open even if solved or waiting for more insight. This issue will be closed if no further activity occurs during the next 2 weeks. If the issue is still valid just add a comment to keep it alive. Thank you for your contributions.

@stale stale bot added the issue/stale label Sep 12, 2020
@go-gitea go-gitea locked and limited conversation to collaborators Nov 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants