When using make: flag provided but not defined #184

Closed
opened 2025-11-02 03:13:00 -06:00 by GiteaMirror · 5 comments
Owner

Originally created by @francoism90 on GitHub (Dec 30, 2016).

  • Gitea version (or commit ref): git (master)
  • Git version: 2.11.0
  • Operating system: Arch Linux x64
  • Database (use [x]):
    • PostgreSQL
    • MySQL
    • SQLite
  • Can you reproduce the bug at https://try.gitea.io:
    • Yes (provide example URL)
    • No
    • Not relevant
  • Log gist:

Description

Building gitea (master branch) on ArchLinux with makepkg fails:

GOPATH="/path/to/src" make DESTDIR="/path/to/pkg" generate build
..
code.gitea.io/gitea/cmd
code.gitea.io/gitea
# code.gitea.io/gitea
flag provided but not defined: -Wl,-O1,--sort-common,--as-needed,-z,relro
usage: link [options] main.o

Build becomes successful when unsetting LDFLAGS:
GOPATH="/path/to/src" LDFLAGS="" make DESTDIR="path/to/pkg" generate build
Seems flags should be unset/ignored or parsed differently (*sorry, not a Go-developer).


Also using TAGS="bindata" results in build errors:

# code.gitea.io/gitea/modules/templates
modules/templates/static.go:35: undefined: Asset
modules/templates/static.go:36: undefined: AssetDir
modules/templates/static.go:37: undefined: AssetInfo
modules/templates/static.go:38: undefined: AssetNames
modules/templates/static.go:51: undefined: AssetNames
modules/templates/static.go:60: undefined: Asset

Link to full log.

Thanks. :)

Link: https://aur.archlinux.org/packages/gitea-git/

Originally created by @francoism90 on GitHub (Dec 30, 2016). - Gitea version (or commit ref): git (master) - Git version: 2.11.0 - Operating system: Arch Linux x64 - Database (use `[x]`): - [ ] PostgreSQL - [X] MySQL - [ ] SQLite - Can you reproduce the bug at https://try.gitea.io: - [ ] Yes (provide example URL) - [ ] No - [X] Not relevant - Log gist: ## Description Building gitea (master branch) on ArchLinux with makepkg fails: ``` GOPATH="/path/to/src" make DESTDIR="/path/to/pkg" generate build .. code.gitea.io/gitea/cmd code.gitea.io/gitea # code.gitea.io/gitea flag provided but not defined: -Wl,-O1,--sort-common,--as-needed,-z,relro usage: link [options] main.o ``` Build becomes successful when unsetting LDFLAGS: ```GOPATH="/path/to/src" LDFLAGS="" make DESTDIR="path/to/pkg" generate build``` Seems flags should be unset/ignored or parsed differently (*sorry, not a Go-developer). ---- Also using TAGS="bindata" results in build errors: ``` # code.gitea.io/gitea/modules/templates modules/templates/static.go:35: undefined: Asset modules/templates/static.go:36: undefined: AssetDir modules/templates/static.go:37: undefined: AssetInfo modules/templates/static.go:38: undefined: AssetNames modules/templates/static.go:51: undefined: AssetNames modules/templates/static.go:60: undefined: Asset ``` Link to [full log](http://cryptb.in/Cfg2a#931a9b145daa170a205ca1109505716e). Thanks. :) Link: https://aur.archlinux.org/packages/gitea-git/
GiteaMirror added the type/bugtopic/deployment labels 2025-11-02 03:13:00 -06:00
Author
Owner

@bkcsoft commented on GitHub (Jan 2, 2017):

bindata has a separate dependency which should be pulled in by running make generate 😕

As for LDFLAGS, could you try removing the flags one-by-one (from /etc/makepkg.conf) and see which one makes it fail?

@bkcsoft commented on GitHub (Jan 2, 2017): `bindata` has a separate dependency which should be pulled in by running `make generate` 😕 As for `LDFLAGS`, could you try removing the flags one-by-one (from `/etc/makepkg.conf`) and see which one makes it fail?
Author
Owner

@bkcsoft commented on GitHub (Jan 2, 2017):

Seems like hugo overrides any LDFLAGS that the system sets... I wonder if that is considered "nice" by any packaging standard...

ref: https://github.com/spf13/hugo/blob/master/Makefile#L9

@bkcsoft commented on GitHub (Jan 2, 2017): Seems like [hugo](https://github.com/spf13/hugo) overrides any `LDFLAGS` that the system sets... I wonder if that is considered "nice" by any packaging standard... ref: https://github.com/spf13/hugo/blob/master/Makefile#L9
Author
Owner

@tboerger commented on GitHub (Jan 5, 2017):

Looks like we should also do that.

@tboerger commented on GitHub (Jan 5, 2017): Looks like we should also do that.
Author
Owner

@bkcsoft commented on GitHub (Jan 6, 2017):

@tboerger can you make a PR for that?

@bkcsoft commented on GitHub (Jan 6, 2017): @tboerger can you make a PR for that?
Author
Owner

@tboerger commented on GitHub (Jan 20, 2017):

@francoism90 should be solved via https://github.com/go-gitea/gitea/pull/709

@tboerger commented on GitHub (Jan 20, 2017): @francoism90 should be solved via https://github.com/go-gitea/gitea/pull/709
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/gitea#184