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

ImageJ: Add unstable git versions #1198

Closed
wants to merge 1 commit into from

Conversation

IAHM-COL
Copy link
Contributor

@IAHM-COL IAHM-COL commented Jul 4, 2023

This pull request adds ebuilds for Github unstable versioning of the imageJ package.

with remote-id: https://github.com/imagej/ImageJ

Pull request notes to consider:

  • The latest tagged release for the Github, 1.54d, added, and marked unstable, KEYWORDS=~amd64. It fetches the tarball using SRC_URI
  • On the commit log of the upstream repository, it is possible to identify other "Release version" labelled commits (1.54e, and 1.54f), but these were not tagged yet. No ebuild was made for these.
  • The current head (bleeding edge) was added version 9999. It fetches using the git-r3 class.

Regards

sci-biology/imagej/imagej-1.53t.ebuild Outdated Show resolved Hide resolved
sci-biology/imagej/imagej-9999.ebuild Show resolved Hide resolved
@Nowa-Ammerlaan
Copy link
Member

Could you please commit using pkgdev commit? This will automatically format the commit title correctly. Also, can you add a Signed-off-by: line to your commit message, pkgdev can do this automatically for you too.

@IAHM-COL
Copy link
Contributor Author

IAHM-COL commented Jul 4, 2023

Could you please commit using pkgdev commit? This will automatically format the commit title correctly. Also, can you add a Signed-off-by: line to your commit message, pkgdev can do this automatically for you too.

@AndrewAmmerlaan

$ pkgdev commit
error: gpg failed to sign the data
fatal: failed to write commit object

@Nowa-Ammerlaan
Copy link
Member

Could you please commit using pkgdev commit? This will automatically format the commit title correctly. Also, can you add a Signed-off-by: line to your commit message, pkgdev can do this automatically for you too.

@AndrewAmmerlaan

$ pkgdev commit
error: gpg failed to sign the data
fatal: failed to write commit object

This means git is not configured to use your gpg key, or gpg fails to sign with your key for some other reason.

@IAHM-COL
Copy link
Contributor Author

IAHM-COL commented Jul 4, 2023

Could you please commit using pkgdev commit? This will automatically format the commit title correctly. Also, can you add a Signed-off-by: line to your commit message, pkgdev can do this automatically for you too.

@AndrewAmmerlaan

$ pkgdev commit
error: gpg failed to sign the data
fatal: failed to write commit object

This means git is not configured to use your gpg key, or gpg fails to sign with your key for some other reason.

Indeed, it isnt. my gpg key is a different identity over the ssh used to github.

Seems I would be facing quite a workaround to pkgdev commit.

If you decide, you'll rebase rather than merge, so you could sign it. I'm Hoping.

@Nowa-Ammerlaan
Copy link
Member

This means git is not configured to use your gpg key, or gpg fails to sign with your key for some other reason.

Indeed, it isnt. my gpg key is a different identity over the ssh used to github.

Seems I would be facing quite a workaround to pkgdev commit.

git config --global user.signingkey <YOUR_KEY_ID_HERE> is all that is required to make it work.

If you decide, you'll rebase rather than merge, so you could sign it. I'm Hoping.

Signing does not matter, this is not required. But a sign-off is, the two concepts are confusingly similar named but are not the same. Signing is cryptographically proving the commit originates from you. Signing-off is simply adding a Signed-off-by line to your commit message as described here, all this does is state that you are legally allowed to contribute the code in the commit.

It is very useful to use pkgdev for committing because it does all these things automatically for you. For example, currently the title of the commit is also not according to policy, pkgdev does this automatically for you too.

@IAHM-COL
Copy link
Contributor Author

IAHM-COL commented Jul 4, 2023

@AndrewAmmerlaan

Thanks for the explanation.
I followed your recommendation and also:
https://docs.github.com/en/authentication/managing-commit-signature-verification/telling-git-about-your-signing-key#telling-git-about-your-gpg-key

However,

$ git config --global user.signingkey
****************BF88

After trying to save the commit after pkgdev commit, I still get;

error: gpg failed to sign the data
fatal: failed to write commit object

@IAHM-COL
Copy link
Contributor Author

IAHM-COL commented Jul 4, 2023

6ab7ca8

Add the Signed by line in the commit message,

Regards

@Nowa-Ammerlaan
Copy link
Member

6ab7ca8

Add the Signed by line in the commit message,

Regards

Thanks

After trying to save the commit after pkgdev commit, I still get;

Does it work if you gpg --sign some random file?

@IAHM-COL
Copy link
Contributor Author

IAHM-COL commented Jul 4, 2023

6ab7ca8
Add the Signed by line in the commit message,
Regards

Thanks

After trying to save the commit after pkgdev commit, I still get;

Does it work if you gpg --sign some random file?

Sure it does. It asks my passphrase, then creates a signed random.gpg file.

on this case, with pkgdev commit it opens an emacs commit log editor, but fails to ever ask my passphrase. It might be since I am working sshed to the gentoo terminal, and over a screen session? I am not sure, but once the emacs closes ready to commit it dies with the message above

I could try with magit, if you need it, or wait till I am physically on the gentoo box.

@Nowa-Ammerlaan
Copy link
Member

on this case, with pkgdev commit it opens an emacs commit log editor, but fails to ever ask my passphrase. It might be since I am working sshed to the gentoo terminal, and over a screen session? I am not sure, but once the emacs closes ready to commit it dies with the message above

Aaah yes, that explains the problem. To use a local gpg-agent (and thus local keys) on a remote client you'll need to forward the gpg socket over ssh. This is actually quiet simple, the procedure is described here: https://wiki.gnupg.org/AgentForwarding

In any case there is no rush to get it working, I still have to actually test this PR.

@IAHM-COL
Copy link
Contributor Author

IAHM-COL commented Jul 4, 2023

Aaah yes, that explains the problem. To use a local gpg-agent (and thus local keys) on a remote client you'll need to forward the gpg socket over ssh. This is actually quiet simple, the procedure is described here: https://wiki.gnupg.org/AgentForwarding

Interesting content. I never knew of forwarding the GPG to use it remotely!

Unlikely to be the issue, here today, as the gpg key I am attempting to use is on the remote, gentoo box, not on the client I used to connect to it.

Thanks for your patient guidance, tho.

@IAHM-COL
Copy link
Contributor Author

IAHM-COL commented Jul 6, 2023

@AndrewAmmerlaan

I had pushed a new commit to this pull request, 999bd01

Notes to commit:

Having KEYWORD=~amd64 both in 1.53t and 1.54d makes logical sense based on your comment that this is an overlay. However, when I tried to emerge -auDU @world, of course, emerge immediately bumped to 1.54d, unless accept keyword was set to **, accepting the bleeding edge.

The issue at hand was the plugins, which are only available in the zip for 1.53

I reasoned, that the best course of action was then to allow the most updated plugins to be also fetched and installed on the 1.54d and in the 9999 version ebuilds. The installation with those changes in the commit then install the plugins available. No apparent version error occurred and the software appeared to handle the plugins graciously, which made sense.

the current version of the ebuilds therefore allow using the USE=plugins for all the versions.

On another note;

The pkgdev commit works if I am locally on the gentoo, but not if I am sshing remotely. Most importantly,

  1. I created a new gpg key for the IAHMCOL identity
  2. I had to pass the command as pgkdev commit --gpg-sign
  3. It did not create the Signed-off-by: line in the commit, so I added it manually, while editing the commit log

I hope that sufficed

Regards
@IAHM-COL

@Nowa-Ammerlaan
Copy link
Member

It did not create the Signed-off-by: line in the commit, so I added it manually, while editing the commit log

For the sign-off line you'll need the --signoff argument or commit.signoff = true in .config/pkgdev/pkgdev.conf.

There's something weird going on with your patch and I can't merge it for testing:

andrew@andrew-gentoo-laptop imagej % pram -r gentoo/sci 1198 --no-signoff
--2023-07-07 11:55:02--  https://github.com/gentoo/sci/pull/1198.patch
Resolving github.com (github.com)... 140.82.121.3
Connecting to github.com (github.com)|140.82.121.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://patch-diff.githubusercontent.com/raw/gentoo/sci/pull/1198.patch [following]
--2023-07-07 11:55:02--  https://patch-diff.githubusercontent.com/raw/gentoo/sci/pull/1198.patch
Resolving patch-diff.githubusercontent.com (patch-diff.githubusercontent.com)... 140.82.121.3
Connecting to patch-diff.githubusercontent.com (patch-diff.githubusercontent.com)|140.82.121.3|:443... connected.
HTTP request sent, awaiting response... 200 OK
Cookie coming from patch-diff.githubusercontent.com attempted to set domain to github.com
Length: unspecified [text/plain]
Saving to: ‘/tmp/tmp.WOseb3u5rL/all.patch’

/tmp/tmp.WOseb3u5rL/all.patch                    [ <=>                                                                                        ]  15.27K  --.-KB/s    in 0.01s

2023-07-07 11:55:03 (1.32 MB/s) - ‘/tmp/tmp.WOseb3u5rL/all.patch’ saved [15633]

QSocketNotifier: Can only be used with threads started with QThread
QSocketNotifier: Can only be used with threads started with QThread
Do you want to merge this? (Y/n/q) y
Applying: ImageJ: add unstable git versions
error: sha1 information is lacking or useless (sci-biology/imagej/Manifest).
error: could not build fake ancestor
Patch failed at 0001 ImageJ: add unstable git versions
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
git am failed

Could you maybe squash all the commits together into a single patch? Not sure if that will fix it, but we like to use 1 commit per package change anyway.

@IAHM-COL
Copy link
Contributor Author

IAHM-COL commented Jul 7, 2023

Could you maybe squash all the commits together into a single patch? Not sure if that will fix it, but we like to use 1 commit per package change anyway.

Ok, that's strange, but we can try again, with efac488

Regards

Copy link
Member

@Nowa-Ammerlaan Nowa-Ammerlaan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, now merging works. Tested it and looks good, just some minor comments left.

sci-biology/imagej/imagej-1.54d.ebuild Show resolved Hide resolved
sci-biology/imagej/imagej-9999.ebuild Outdated Show resolved Hide resolved
Signed-off-by: IAHMCOL <IAHMCOL@thejabberwocky.net>
Co-authored-by: Andrew Ammerlaan <andrewammerlaan@gentoo.org>
@Nowa-Ammerlaan
Copy link
Member

Nice work, Thanks 👍

@IAHM-COL IAHM-COL deleted the imagej-update branch July 9, 2023 19:54
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

Successfully merging this pull request may close these issues.

2 participants