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

"easter egg" for showing language pair version #10

Open
unhammer opened this issue Jun 6, 2019 · 9 comments
Open

"easter egg" for showing language pair version #10

unhammer opened this issue Jun 6, 2019 · 9 comments

Comments

@unhammer
Copy link
Member

unhammer commented Jun 6, 2019

It'd be nice to be able to do something like

$ echo AP_PAIR_VERSION | apertium foo-bar
74a6bc782f95c94ebfd8238063e256df40e84bb8

where 74a6bc782f95c94ebfd8238063e256df40e84bb8 is the git commit of the language pair foo-bar.

This is easy by just adding

<e r="LR"><p><l>AP_PAIR_VERSION<s n="adv"/></l><r>74a6bc7…<s n="adv"/></r></p></e>
<e r="RL"><p><l>74a6bc7…<s n="adv"/></l><r>AP_PAIR_VERSION<s n="adv"/></r></p></e>

into bidix before compilation (so it'll come out as #74a6bc782f95c94ebfd8238063e256df40e84bb8 but that's fine?), but it has to be automatic somehow (an xslt right before lt-comp?).

@TinoDidriksen
Copy link
Member

Caveat: Packages have no knowledge of git commit or any other versioning information, beyond what I pass in. The builders don't have network access nor even git installed. So any such easter egg must take that into consideration - easter egg information may be null.

And it must not be a timestamp, because it must be a reproducible build.

Asides from those caveats, good idea.

unhammer added a commit to apertium/apertium-nob that referenced this issue Jun 6, 2019
unhammer added a commit to apertium/apertium-nno that referenced this issue Jun 6, 2019
unhammer added a commit to apertium/apertium-nno-nob that referenced this issue Jun 6, 2019
@TinoDidriksen
Copy link
Member

https://github.com/apertium/apertium-packaging/blob/master/make-deb-source.pl can inject the version, if space has been provided for it. I suggest placeholder APERTIUM_AUTO_VERSION (GITREV is too generic).

How should this behave with split languages? It'd be nice if a pair has AP_PAIR_VERSION for the combined, but also AP_LANG_VERSION for each direction separately. And if that's not possible, then it should be AP_SOURCE_VERSION to be generic.

@unhammer
Copy link
Member Author

unhammer commented Jun 6, 2019

Yeah, was wondering if the individual languages shouldn't have that too. That should be easy as well.

unhammer added a commit to apertium/apertium-nno-nob that referenced this issue Jun 6, 2019
unhammer added a commit to apertium/apertium-nno that referenced this issue Jun 6, 2019
unhammer added a commit to apertium/apertium-nob that referenced this issue Jun 6, 2019
@unhammer
Copy link
Member Author

unhammer commented Jun 6, 2019

nno-nob has AP_PAIR_VERSION and nno/nob have AP_LANG_VERSION with @APERTIUM_AUTO_VERSION@ now.

@kj7rrv
Copy link

kj7rrv commented Jun 6, 2020

"The builders don't have network access nor even git installed." How do you get the data on and off them? @TinoDidriksen

@TinoDidriksen
Copy link
Member

"The builders don't have network access nor even git installed." How do you get the data on and off them?

The controller prepares all the data and passes it off to a restricted offline Docker container that mounts the host build folder. That way the part that runs as root never gets to run user-provided code.

@kj7rrv
Copy link

kj7rrv commented Jun 6, 2020

Oh, okay. What would be involved in passing in a git commit id?

@TinoDidriksen
Copy link
Member

Oh, okay. What would be involved in passing in a git commit id?

That part is already done. It was implemented a year ago in apertium/packaging@630cf3a

This issue is kept open because not all languages and pairs have these entries yet. The respective placeholders need to be added to everything, and apertium-init.

Alternatively, make-deb-source.pl needs to inject all the information during tarball generation. That's harder, but doable.

@kj7rrv
Copy link

kj7rrv commented Jun 6, 2020 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants