# Error while I run: forc build

**URL:** <https://forum.fuel.network/t/error-while-i-run-forc-build/1689>\
**Category:** Sway\
**Created:** [January 28, 2023, 2:27pm UTC](https://forum.fuel.network/t/error-while-i-run-forc-build/1689 "2023-01-28T14:27:01Z")\
**Posts on this page:** 1\
**Showing post:** 5

<div class="post-metadata">

**Author:** ![mindtree](https://sea2.discourse-cdn.com/flex022/user_avatar/forum.fuel.network/mindtree/32/5_2.png) [@mindtree](https://forum.fuel.network/u/mindtree)\
**Post date:** [January 30, 2023, 7:32am UTC](https://forum.fuel.network/t/error-while-i-run-forc-build/1689/5 "2023-01-30T07:32:56Z")

</div>

See the temporary workaround mentioned in this issue comment:

> <https://github.com/FuelLabs/sway/issues/1636#issuecomment-1318750489>
>
> Git is used by \`forc\` to enable support for remote git dependencies and remote p…roject templates. The fetching and handling of git repositories is performed in \`forc-pkg\`.
> 
> \## Problem
> 
> Currently we don't do any sort of authentication handling for git within \`forc-pkg\`.
> 
> So far this hasn't caused too many issues as all existing forc projects only have public repository dependencies and they all use \`http\`/\`https\` URLs. However, once we start opening up to more users I can see us quickly getting a bunch of issues about this.
> 
> The main issues with not handling git authentication are:
> 
> 1. \*\*URL types other than http/https don't seem to work without it\*\*. I don't think git URLs like \`git@github.com:FuelLabs/sway.git\` work at the moment, and I believe this might be due to our lack of authentication handling.
> 2. \*\*No support for private dependencies\*\*. Normally git can support fetching and updating private repositories via ssh as long as the git URL format is used, however trying to do so with forc just panics at the moment.
> 3. \*\*Some git URL rewrite rules don't work\*\*. Some users use re-write rules so that URLs starting with \`http\`/\`https\` automatically get rewritten to git URLs. As a result of 1. forc will just panic. This is the source of this issue:
> - https://github.com/FuelLabs/sway/issues/998.
> 
> \## Potential Solution
> 
> We should investigate how \`cargo\` handles this.
> 
> Some high-level docs about cargo's support for git authentication can be found here: https://doc.rust-lang.org/cargo/appendix/git-authentication.html.
> 
> Investigate cargo's \[\`git::utils::with\_authentication\` function\](https://github.com/rust-lang/cargo/blob/b1636fc1e049e977ae542ec2b2191ffab075b049/src/cargo/sources/git/utils.rs#L448) which provides a scope with valid git auth. This function seems to be the primary part of \`cargo\`'s code-base responsible for handling git authentication.

The full solution is for us to handle git authentication properly in `forc`, which is one of our priorities before the next beta!

---

_[View the full topic](https://forum.fuel.network/t/error-while-i-run-forc-build/1689)._
