-
Notifications
You must be signed in to change notification settings - Fork 84
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
Version watermarking by Dune #167
base: master
Are you sure you want to change the base?
Conversation
2d025b8
to
956291b
Compare
#125 is resolved and this pull req is now ready for review :) |
956291b
to
68f8de1
Compare
@@ -10,6 +9,7 @@ dev-repo: "git+https://github.com/gfngfn/SATySFi.git" | |||
bug-reports: "https://github.com/gfngfn/SATySFi/issues" | |||
build: [ | |||
["mkdir" "-p" "temp"] | |||
["dune" "subst"] {pinned} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm curious. Why is this line executed only when the package is pinned, but not when a non-pinned version is being installed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirmed %%VERSION%%
was not substituted when it was installed as a non-pinned package.
# Adding a package pointing to `git+https://github.com/nekketsuuu/SATySFi.git#68f8de124503634b05608f993b693dcf792d437b` to a local repository
$ opam install satysfi
$ satysfi --version
SATySFi version %%VERSION%%
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please read #167 (comment)
This is intended; I think the version string is confusing and not needed for the development period. If needed, use
opam pin add
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, Ioverlooked the paragraph. Sorry. So, this PR changes the release process as well: dune-release tag
instead of git tag -a
. It will be helpful if the new release process is explicitly described somewhere in the repo. Just my two cents.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this pull request doesn't change the release process of SATySFi. Just running git tag -a
is enough.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Then it's out of scope of this pull request. I don't intend to change the way to release a new version. dune-release
is not fit to current SATySFi.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a consequence of this PR, which changes how SATySFi should be released.
As OPAM repos prefers a source tarball in url
section rather than source repos (especially, the official OPAM repo prohibits source repos there), there are only two ways to substitute watermarks:
- Release a prepared distribution, in other words, source code preprocessed by dune-subst;
- Or upload a OPAM file which has a line like
["find" "." "-iname" "*.ml" "-exec" "sed" "-i.bak" "-e" "s/%%VERSION%%/v0.0.6/" "{}" ";"]
instead of["dune" "subst"] {pinned}
.
Do you think “dune-release
is not fit to current SATySFi” because it automatically attempts to release SATySFi to GitHub and to send a PR to the official OPAM repository?
I edited my previous comment with dune-release distrib
that only generates a prepared distribution. Does that make sense to you?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, even though it is a consequence, it can be handled by another issue/PR. You're right. Shall I file one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I filed #237 since I don't want to block you on this. Today I learned a lot. Thank you for a fruitful discussion!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think this pull req changes the current release process, though.... I commented my opinion to that issue #237 (comment). Let's continue this discussion there.
It turns out by @na4zagin3 that this pull req removes a concrete version string from assets for a git tag, which is currently automatically created by GitHub (e.g. https://github.com/gfngfn/SATySFi/releases/tag/v0.0.5). There are three ways to handle this issue.
@gfngfn Which resolution do you prefer? Any method is fine with me. Since you are responsible for releasing new versions of SATySFi, you can choose how to handle this issue =) |
@gfngfn FYI, if you chose the second option, there would be two methods: with
|
BTW, why not use |
What's new?
This PR implements more detailed version strings.
In the version string
v0.0.4-1-gb0b3c65
in the nearly last line,1
means that it is 1 commit ahead from v0.0.4, andgb0b3c65
means its commit hash "b0b3c65..." by git. This is the same as the output ofgit describe --dirty --always
.By this PR, we can:
Miscellaneous notes
satysfi --version
outputsSATySFi version vm1.0z-****-g****
because tagsv0.0.1
,v0.0.2
, andv0.0.3
are lightweight tags (How about using annotated tags for releases? #125).vm1.0z
is an annotated tag for old Macrodown. So this is not a bug of this PR.dune subst
, which is documented here.opam pin add
,opam reinstall
, ordune-release
. In contrast, simplemake
ordune build
doesn't replace it, and show%%VERSION%%
for the version string. This is intended; I think the version string is confusing and not needed for the development period. If needed, useopam pin add
.dune build
ocaml/dune#1539). Although I believe my method is better for SATySFi to handle versions, it will be worth reading those issues for future possible changes of Dune.