Skip to content
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

chore: [CG-10573] make clang dependency more explicit for debian linux to preven… #211

Open
wants to merge 5 commits into
base: develop
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 39 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,32 +11,61 @@ By contributing to Codegen, you agree that:
3. You grant Codegen a perpetual, worldwide, non-exclusive, royalty-free license to use your contribution.

See our [CLA](CLA.md) for more details.
# Development Setup

## Development Setup
This guide will help you set up the development environment for this project.

### Installing UV Package Manager
## Installing UV Package Manager

UV is a fast Python package installer and resolver. To install:
UV is a fast Python package installer and resolver.

**macOS**:
### macOS
Install UV using Homebrew:
```bash
brew install uv
```

For other platforms, see the [UV installation docs](https://github.com/astral-sh/uv).
### Debian/Ubuntu

### Setting Up the Development Environment
#### Install Required Dependencies
Before installing UV, ensure `clang` and `curl` are installed:
```bash
sudo apt-get update
sudo apt-get install -y clang curl
```
> **Note**: `clang` is required for compilation steps during `uv sync`.

#### Install UV
Once dependencies are installed, install UV:
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
```

For other platforms, refer to the [UV installation docs](https://github.com/astral-sh/uv).

## Setting Up the Development Environment

Once UV is installed, set up your development environment by running:

After installing UV, set up your development environment:
```bash
uv venv
source .venv/bin/activate
uv sync --dev
```

> [!TIP]
> - If sync fails with `missing field 'version'`, you may need to delete lockfile and rerun `rm uv.lock && uv sync --dev`.
> - If sync fails with failed compilation, you may need to install clang and rerun `uv sync --dev`.
### Troubleshooting

- If `uv sync` fails with `missing field 'version'`, try:

```bash
rm uv.lock && uv sync --dev
clee-codegen marked this conversation as resolved.
Show resolved Hide resolved
```

- If `uv sync` fails due to a compilation error, ensure `clang` is installed and then rerun:
Copy link
Contributor

Choose a reason for hiding this comment

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

It can be clang or g++ on linux, not entirely sure

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I can test this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Without clang and the latest version of g++, I still get the error requiring clang.

Copy link
Contributor

@tomcodgen tomcodgen Jan 31, 2025

Choose a reason for hiding this comment

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

yeah, you need clang or change CC var (export CC=gcc)

Copy link
Contributor

Choose a reason for hiding this comment

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

Huh ok


```bash
uv sync --dev
```

### Running Tests

Expand Down