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

Temporarily remove no_std support #60

Merged
merged 9 commits into from
Jan 26, 2022
Merged

Conversation

digorithm
Copy link
Member

@digorithm digorithm commented Jan 24, 2022

Currently, we created a no_std feature to handle wasm builds. However, this causes cargo build --all-features to break, which shouldn't happen. Instead, we should have a std feature-set set as default, as per the official Rust docs:

For example, if you want to optionally support no_std environments, do not use a no_std feature. Instead, use a std feature that enables std. For example: (https://doc.rust-lang.org/cargo/reference/features.html#feature-unification)

This PR temporarily removes the no_std so the CI won't break and this issue (#62) captures the future work that needs to be done in order to properly enable no_std compatibility.

Closes #52.

@digorithm digorithm self-assigned this Jan 24, 2022
@digorithm digorithm added the bug Something isn't working label Jan 24, 2022
@adlerjohn adlerjohn requested a review from Voxelot January 25, 2022 00:40
.gitignore Outdated Show resolved Hide resolved
fuels-core/src/lib.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@adlerjohn adlerjohn left a comment

Choose a reason for hiding this comment

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

CI failing for some reason

fuels-core/Cargo.toml Outdated Show resolved Hide resolved
@Voxelot
Copy link
Member

Voxelot commented Jan 25, 2022

You'll also need to update CI to run a build/test in no-std mode. Something similar to this: https://github.com/FuelLabs/fuel-types/blob/master/.github/workflows/ci.yml#L49

    - name: Build no-std
      uses: actions-rs/cargo@v1
      with:
        command: build
        args: --verbose --target thumbv6m-none-eabi --no-default-features

@digorithm
Copy link
Member Author

digorithm commented Jan 25, 2022

Uuuugh, this is very weird. The following test https://github.com/FuelLabs/fuels-rs/blob/master/fuels-rs/tests/calls.rs#L17 is failing because forc can't build this very simple Sway script (https://github.com/FuelLabs/fuels-rs/blob/master/fuels-abigen-macro/tests/test_projects/simple_script/src/main.sw).

However, this is only happening in this CI server (!), and locally I can build it just fine:

simple_script git:(rodrigo/no-std-config) forc build
  Compiled library "core".
  Compiled library "core".
  Compiled library "lib-std" with 2 warnings.
  Compiled script "Fuel example project".
  Bytecode size is 396 bytes.

Crazy, uh? I then decided to put an #[ignore] on this failing test, because it honestly isn't testing anything special that the main harness file isn't testing... and the CI passes.

Note that this is happening everywhere else, not just this branch. Even on master that was passing a couple of days ago. That leads me to believe it isn't on fuels-rs, a small likelihood that's on forc, and a pretty big chance that Github Actions is doing something fishy.

cc @adlerjohn @Voxelot @vnepveu

Edit: for now I'll keep this failing test as #[ignore]. I'm still working through the no_std refactoring, so the builds after this comment will be failing for different reasons.

@digorithm
Copy link
Member Author

Update

After a discussion that happened in the infra sync call with @Voxelot and @tjsharp1, we've decided to unblock the fuels-rs build by simplifying things (no no_std compatibility for now), and then, in another issue, I'll do some refactoring to turn the necessary bits of fuels-rs no_std so that it won't impact the indexer. In the meantime, the indexer should continue using the current fuels-rs pinned version.

.github/workflows/ci.yml Outdated Show resolved Hide resolved
@adlerjohn
Copy link
Contributor

Can you also update the description of the PR? I'm not actually sure what this PR does.

@digorithm digorithm changed the title Create std default feature Temporarily remove no_std support Jan 25, 2022
@digorithm
Copy link
Member Author

Can you also update the description of the PR? I'm not actually sure what this PR does.

Nice catch, that wasn't making any sense anymore. Title and description updated.

@digorithm digorithm requested a review from adlerjohn January 25, 2022 21:11
Copy link
Contributor

@adlerjohn adlerjohn left a comment

Choose a reason for hiding this comment

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

LGTM, but would prefer weigh-in from @Voxelot

@digorithm digorithm merged commit 929248b into master Jan 26, 2022
@digorithm digorithm deleted the rodrigo/no-std-config branch January 26, 2022 00:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

Refactor no-std feature to not break build
3 participants