How to build dfx from source?

I cloned the repo from GitHub - dfinity/sdk: The DFINITY Canister Software Development Kit (SDK) and I tried various nix commands but couldn’t get it to build. I keep getting the following error:

ERROR: Repository not found.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

I suspect it’s because of the following bit from the nix/sources.json file:

"common": {
    "branch": "master",
    "repo": "ssh://[email protected]/dfinity-lab/common",
    "rev": "bd7a905e50fcf78b8a5fcc7e33221033c32c9bc8",
    "type": "git"

which requires a repository which is most likely private (or doesn’t exist). Any idea how to proceed?

PS: The reason I am trying to build dfx myself is because I am using Ubuntu 18.04 which can no longer run the latest dfx version because it requires glibc 2.29+ while the maximum version for Ubuntu 18.04 is 2.27 (see GLIBC library issues on Ubuntu 16 with dfx version 0.7.0-beta.4, 5, and 6) If you know how I could get around this without having to upgrade my OS, please say!


Let me ping the team to see who can help.

1 Like

The repo and build still depends on internal repositories like common and dfinity. Maybe just open source these too, now? :wink:


Has the dfx repo become open sourced only recently? I am brand new to dfinity and haven’t followed the development of things. Are there any plans to open source these internal repositories?

1 Like

Yes, dfx was just open sourced a few days ago.

I didn’t try it, but you can probably build it with plain cargo build if you know what you are doing (or can figure it out)

Yes I believe the intent is to open those tools as well. The intent was to not delay SDK (open sourced few days ago) for all its build dependencies, but those are on the queue, I believe.


That’s good to hear. Thanks.

1 Like

Confirming from the SDK team that every dependency will either be made open-source, or we will get the releases made public so that dfx can be built properly from a simple cargo build command


Thanks. Do you have an approximate time-frame as to when this is going to happen? I don’t expect you to give an exact date but any information would be welcome.

It’s a cross-team effort, so I’m not going to promise anything out of my control, but the work is ongoing

1 Like

Enhancing digital transformation.

I don’t know how other people see it, but to me, it is misleading to say that something is open source if it can’t build. One function can do anything. (I don’t know if you knew that it couldn’t build when you said it is now open source). You can say at the start, that most of it here but some of it is still private. That is better then waiting till someone finds out.

Fwiw, I did not know (out of my sloppiness). I did not try building it from scratch. I was more focused on code transparency. I will certainly take responsibility that I was not aware of the building issue since my machine clearly has access to lots of repos which would not be the case with people starting from scratch.

That is a fair criticism, @levi