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 all commits
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
55 changes: 45 additions & 10 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,46 @@ By contributing to Codegen, you agree that:

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

## Development Setup
# Development Setup

### Installing UV Package Manager
This guide will help you set up the development environment for this project.

UV is a fast Python package installer and resolver. To install:
## Installing UV Package Manager

**macOS**:
UV is a fast Python package installer and resolver.

### 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

#### 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
## Setting Up the Development Environment

After installing UV, set up your development environment:

Expand All @@ -36,10 +61,20 @@ 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'`, it may be due to an older version of uv incompatible with the lock file. Try:

```bash
uv self update
uv sync --dev
```

- 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
Loading