FuelLabs / FuelLabs/sway

Allow for disabling the `main` entry point in scripts/predicates when only building tests

Open
#3,263 0 comments 0 reactions 0 assignees View on GitHub
compiler compiler: codegen compiler: frontend forc forc-test team:compiler
Dominant language
Rust
Stars
61.4k
Forks
5.4k
Avg merge
3h 33m
Merged PRs (30d)
4

Description

Currently, if we're building tests for a `forc test` invocation, we build the test function entry points *in addition* to the main entry point.

We could probably save some codegen time by omitting the `main` function for scripts and predicates when we have no intention of calling it.

This is probably best specified as a part of the `BuildConfig`.

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reading BuildConfig and tracing the forc test build path for scripts and predicates. Determine how test-only builds currently include the main entry point; done means BuildConfig can disable that entry point while retaining the test function entry points, with relevant compiler tests passing.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, performance
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.