chapel-lang / mason-registry

Package registry for mason, Chapel's package manager
17 stars 25 forks source link

"Adding ForwardModeAD@0.1.0 package to registry via mason publish" #61

Closed lucaferranti closed 1 year ago

lucaferranti commented 2 years ago

A few questions

  1. Should I create a tag release manually before having this merged? Should I have created it before running mason publish? (see also #62 )
  2. How does mason find the right release? I would expect each release to be linked to a commit/tag, but I don't see related metadata in the toml-files. Is it so that if the version is X.Y.Z, then it looks for a tag vX.Y.Z from the given repository?
  3. If in the future I want to update the package and bump the version, can I still do that via mason publish?
lucaferranti commented 1 year ago

can this failure be related to the lack of tag release on the package repo (see also #62 ) ?

lucaferranti commented 1 year ago

ok my diagnosis was wrong, changing to https gives

Making the modules...
make[2]: Nothing to be done for 'default'.
cd tools/mason && make && make install
Building Mason...
make[1]: Nothing to be done for 'install'.
package detected from git diff: Bricks/ForwardModeAD/0.1.0.toml
package path: Bricks/ForwardModeAD/0.1.0.toml.end
0.1.0.toml
Cloning into 'newPackage'...
fatal: protocol ' https' is not supported
./util/runMasonCI.bash: line 46: cd: newPackage: No such file or directory
lucaferranti commented 1 year ago
package detected from git diff: Bricks/ForwardModeAD/0.1.0.toml
package path: Bricks/ForwardModeAD/0.1.0.toml.end

is this right?

lucaferranti commented 1 year ago

I tried to reproduce the steps locally with the following simplified bash script

#!/usr/bin/env bash

package=$(git diff --name-only HEAD HEAD~1)
end=".end"
path="$package$end"
cd "$(dirname "$path")" || exit 1
echo "package detected from git diff: ${package}"
echo "package path: ${path}"

FILE=$package
basename "$FILE"
f="$(basename -- "$FILE")"
source="$(grep source "$f" | cut -d= -f2)"
echo $source

fixed=$(echo "$source" | tr -d '"')
echo $fixed

basically, I just print the value of source and fixed for debugging and when running it I get

package detected from git diff: Bricks/ForwardModeAD/0.1.0.toml
package path: Bricks/ForwardModeAD/0.1.0.toml.end
0.1.0.toml
"git@github.com:lucaferranti/ForwardModeAD.git"
git@github.com:lucaferranti/ForwardModeAD.git
Cloning into 'newPackage'...
 git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
./test.bash: line 20: cd: newPackage: No such file or directory

so the source seems indeed correct 🤔.

Furthermore, manually doing git clone git@github.com:lucaferranti/ForwardModeAD.git newPackage works. So the authentication issue arises when trying to clone from a bash script.

I think this stack overflow question is relevant to understand the issue. If I read it correctly, there are two options

  1. add the ssh-key in the bash script
  2. use https instead of ssh (which however seemed to fail, see my second commit)

comments?