# Publishing a simple executable: problem with the upstream-url

**URL:** <https://discourse.flox.dev/t/publishing-a-simple-executable-problem-with-the-upstream-url/470>\
**Category:** Help\
**Created:** [November 3, 2022, 11:02pm UTC](https://discourse.flox.dev/t/publishing-a-simple-executable-problem-with-the-upstream-url/470 "2022-11-03T23:02:16Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [November 3, 2022, 11:02pm UTC](https://discourse.flox.dev/t/publishing-a-simple-executable-problem-with-the-upstream-url/470/1 "2022-11-03T23:02:16Z")

</div>

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

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

```

I get

```auto
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](https://github.com/etorreborre/scmpuff/commit/b46b5e521ba92dfc4cd5ce59668908fe1410a7c5).

Is there anything I can do to fix this?

Thanks.

---

<div class="post-metadata">

**Author:** ![tomberek](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/tomberek/32/83_2.png) [@tomberek](https://discourse.flox.dev/u/tomberek)\
**Post date:** [November 4, 2022, 2:14am UTC](https://discourse.flox.dev/t/publishing-a-simple-executable-problem-with-the-upstream-url/470/2 "2022-11-04T02:14:12Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [November 4, 2022, 8:41am UTC](https://discourse.flox.dev/t/publishing-a-simple-executable-problem-with-the-upstream-url/470/3 "2022-11-04T08:41:20Z")

</div>

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`

```auto
flox publish --publish-to . --remote-url .

```

---

<div class="post-metadata">

**Author:** ![ysndr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/ysndr/32/340_2.png) [@ysndr](https://discourse.flox.dev/u/ysndr)\
**Post date:** [November 4, 2022, 9:40am UTC](https://discourse.flox.dev/t/publishing-a-simple-executable-problem-with-the-upstream-url/470/4 "2022-11-04T09:40:55Z")

</div>

The default case for publishing currently is:

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

```auto
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:

```auto
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

```auto
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 🙂

---

<div class="post-metadata">

**Author:** ![etorreborre](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/etorreborre/32/428_2.png) [@etorreborre](https://discourse.flox.dev/u/etorreborre)\
**Post date:** [November 4, 2022, 10:22am UTC](https://discourse.flox.dev/t/publishing-a-simple-executable-problem-with-the-upstream-url/470/5 "2022-11-04T10:22:48Z")

</div>

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 🙂.

---

<div class="post-metadata">

**Author:** ![robinbrantley](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.flox.dev/robinbrantley/32/39_2.png) [@robinbrantley](https://discourse.flox.dev/u/robinbrantley)\
**Post date:** [November 30, 2022, 3:22pm UTC](https://discourse.flox.dev/t/publishing-a-simple-executable-problem-with-the-upstream-url/470/6 "2022-11-30T15:22:33Z")

</div>

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. 🙂
