Skip to content

"Adding [email protected] package to registry via mason publish" #61

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

Merged
merged 4 commits into from
Nov 4, 2022

Conversation

lucaferranti
Copy link
Contributor

@lucaferranti lucaferranti commented Oct 30, 2022

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 mason publish did not create a tag #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
Copy link
Contributor Author

lucaferranti commented Nov 3, 2022

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

chplVersion = "1.28.0"
license = "MIT"
name = "ForwardModeAD"
source = "[email protected]:lucaferranti/ForwardModeAD.git"
Copy link
Contributor Author

@lucaferranti lucaferranti Nov 3, 2022

Choose a reason for hiding this comment

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

The error message

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'...
Warning: Permanently added the ECDSA host key for IP address '192.30.255.112' to the list of known hosts.
 [email protected]: Permission denied (publickey).
fatal: Could not read from remote repository.

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

maybe this should be specified as https link? (Edit: just tried let's see what happens)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It might be it , because also the example in the readme uses https.

I think this file was automatically generated though, maybe this is something should be fixed in mason publish?

@lucaferranti
Copy link
Contributor Author

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
Copy link
Contributor Author

lucaferranti commented Nov 3, 2022

package detected from git diff: Bricks/ForwardModeAD/0.1.0.toml
package path: Bricks/ForwardModeAD/0.1.0.toml.end

is this right?

@lucaferranti
Copy link
Contributor Author

lucaferranti commented Nov 4, 2022

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
"[email protected]:lucaferranti/ForwardModeAD.git"
[email protected]:lucaferranti/ForwardModeAD.git
Cloning into 'newPackage'...
 [email protected]: 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 [email protected]: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?

@arezaii arezaii merged commit a4d305e into chapel-lang:master Nov 4, 2022
@lucaferranti lucaferranti deleted the ForwardModeAD branch February 28, 2024 19:35
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