Publishing a simple executable: problem with the upstream-url

Hi, I’m trying to publish a simple executable for mac but I am having an issue with the upstream URL:

 flox publish --publish-to https://github.com/etorreborre/floxpkgs.git --upstream-url https://github.com/etorreborre/scmpuff.git

I get

Cloning https://github.com/etorreborre/floxpkgs.git ...
Cloning into '/var/folders/kb/tjt27xcn6_dg095y88337mjm0000gn/T/tmp.rpheO54l'...
remote: Enumerating objects: 14, done.
remote: Counting objects: 100% (14/14), done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 14 (delta 0), reused 11 (delta 0), pack-reused 0
Receiving objects: 100% (14/14), 4.90 KiB | 4.90 MiB/s, done.
Building scmpuff ...
error: getting status of '/nix/store/a6lgvc36yklk1caf4glq9c15jpdk9g8p-source/flake.nix': Not a directory

ERROR: The local commit 'b46b5e521ba92dfc4cd5ce59668908fe1410a7c5'  was not found in upstream repository 'https://github.com/etorreborre/scmpuff.git'

However I can find that commit in the repository.

Is there anything I can do to fix this?

Thanks.

We are still iterating on what to call these concepts. In this situation the upstream-url should be your floxpkgs repository. Likely this is your current directory and the CLI should be reading the git repo’s origin and offering that as the default value for “upstream-url”.

For some background on what problem this option is trying to address: you may have only ssh transport access to write to your floxpkgs repo, but it might be publicly readable, in which case the “upstream-url” should be how people consuming your software can access it. We are redesigning this portion to provide a better set of defaults and improve how we explain the concept.

Currently I invoke flox publish in the scmpuff directory which contains the derivation I want to publish to my flox catalog. If I call flox publish ----publish-to https://github.com/etorreborre/floxpkgs.git then my scmpuff repository origin URL is detected as the upstream-url. Could you please describe what you think is the full proper command line invocation with all the parameters that I should use?

Also I just saw that the tutorial on publishing still refers to a remote-url

flox publish --publish-to . --remote-url .

The default case for publishing currently is:

from the repository that defines a package (lets take your scmpuff as an example)

flox publish -A scmpuff

will detect your current directory as a git repository (therefore defaulting --upstream-url to your origin remote.
The upstream-url is part of the published metadata to allow rebuilding of the published package from source.

--publish-to defines where these metadata files will be stored (since you need to access them somehow after all).
Normally this should point to your floxpkgs repository
flox will guess the repository from your published repositories origin url:

github.com/etorreborre/scmpuff
                               v
github.com/etorreborre/floxpkgs 
                                            =======                   

So to come back to your question,

to publish scmpuff you only need to run flox publish in the scmpuff repo.
the --publish-to and --upstream-url are confiremend interactively in that case.

If a single command is what you need it would be

flox publish -A scmpuff --upstream-url git+ssh://git@github.com/etorreborre/scmpuff.git --publish-to   git+ssh://git@github.com/etorreborre/floxpkgs

As @tomberek said the API is still experimental and were trying to find a good way to specify defaults without long cli invocations and repetitive/error prone interactive entries, stay tuned :slight_smile:

1 Like

Thanks Yannik, that’s more or less what I was doing at the beginning but I was using https urls to try to work around the fact that I have multiple ssh keys. Now that I used git+ssh I was able to:

  • publish my package
  • create a new channel for my catalog
  • subscribe to it
  • install my own package

And then discover that it already existed in the nix packages :slight_smile:.

3 Likes

just a quick heads up that ‘flox publish’ has been reworked and the updates will be in the next release (0.0.7) which is expected very soon now. We’ll make an announcement here in discourse once it is available. :slight_smile:

2 Likes