Comments (12)
@mpanczyk aha sorry! thought you might be the maintainer of this package https://pkgs.alpinelinux.org/package/edge/testing/x86_64/fq
from fq.
gojq does this by keeping the latest released in a go file https://github.com/itchyny/gojq/blob/main/cli/cli.go#L19 and also has a "revision" variable set to "HEAD" by default and is changed it building via make. Feel like a good solution i think.
from fq.
This is now fixed on Alpine via alpinelinux/aports@1974aa4. I don't think that you need to change how the version string is set. A lot of software use goreleaser and pass some flags using ldflags. It's nothing wrong with that.
from fq.
@danfe @mpanczyk Hey, just published version 0.0.4 and it embeds the version so build flags is not needed anymore.
from fq.
Hmm, there is no way to include this information using standard "go build"?
from fq.
There is but not automatically, in go 1.18 go build will start to include some VCS information automatically i think. But that wont help for source archive builds. For binaries I currently i use goreleaser to pass go build flags to set the variable main.version
.
I see that the nix builds sets verison https://github.com/NixOS/nixpkgs/blob/master/pkgs/development/tools/fq/default.nix#L24
but alpine does not https://git.alpinelinux.org/aports/tree/testing/fq/APKBUILD
I don't really follow how nix, alpine etc downloads the source, clones a git tag or downloads release archive?
I'll think and investigate a bit more, maybe can make goreleaser generate a version file while arching? but feels a bit ugly
from fq.
@mpanczyk hey, what do you think about this?
from fq.
@wader Sorry, but I think you have me confused with someone else.
from fq.
@mpolanski 👍 ill let you know if i switch to baking the version number into the source somehow, might be nice for ppl who build from source archives
from fq.
@danfe Looking at the freebsd ports Makefile i guess it also shows "dev" as version? if so, any preference to how to fix?
from fq.
Looking at the FreeBSD ports
Makefile
I guess it also showsdev
as version?
That's right, it does show dev
when running fq --version
.
If so, any preference to how to fix?
This is one of those things we lost upon entering modern era which replaced traditional, properly bootstrapped and $version
expanded release tarballs with git tags (git does not even support keyword expansion which makes it even harder). Archived sources from GitHub (which packagers download, it's not the same as compressed git clone
) do not contain any git metadata, so there's nowhere to derive version from (ditto for the commit hash). I personally simply edit files with sed(1)
to fill in correct values prior to building. I can't think of an elegant solution (with git) other than generating proper release tarball like in the old times.
from fq.
This is one of those things we lost upon entering modern era which replaced traditional, properly bootstrapped and
$version
expanded release tarballs with git tags (git does not even support keyword expansion which makes it even harder). Archived sources from GitHub (which packagers download, it's not the same as compressedgit clone
) do not contain any git metadata, so there's nowhere to derive version from (ditto for the commit hash). I personally simply edit files withsed(1)
to fill in correct values prior to building. I can't think of an elegant solution (with git) other than generating proper release tarball like in the old times.
Yeah i think your right. I will probably keep the latest release version in a file somehow. Also noticed now that goreleaser (a go release tool) seems to not produce source archives on it own, instead links to archive tags somehow, should look into that.
Thanks for your thoughts
from fq.
Related Issues (20)
- [Feature request] Support cwf, swf, zwf HOT 1
- [Feature request] Support pdf HOT 1
- [Feature] Support for Doom WAD Files HOT 5
- [feature] add decimal floating-point number support HOT 2
- mp3 file with id3 2.4.0 got killed from console output HOT 6
- typo HOT 3
- [Documentation] Any interest in creating a man page? HOT 5
- Feature request: zero-length start/end properties HOT 7
- Support for non-canonical tags with html HOT 5
- Color output is unreadable on terminals using light backgrounds. HOT 4
- make use of kaitai struct for additional formats? HOT 4
- [Feature request] Support image/bmp HOT 1
- Format Decoder Conventions HOT 3
- zip: last_modification_date and last_modification_time are mislabeled or swapped HOT 2
- gzip files can contain multiple concatenated gzips HOT 8
- Investigate Data Format Description Language (DFDL) HOT 4
- Consider relicensing internal/mathex/float80.go HOT 3
- Enhancing Stream Processing Capabilities for Real-Time Binary Data Analysis HOT 1
- Winget support HOT 1
- readline upgrade HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fq.