Skip to content

Conversation

@mat-hek
Copy link
Member

@mat-hek mat-hek commented Sep 10, 2025

closes software-mansion/popcorn#290

Requires changes in Popcorn: software-mansion/popcorn#301

@mat-hek mat-hek force-pushed the mf/popcorn-nifs branch 3 times, most recently from 0e8c250 to 48b9dfa Compare September 11, 2025 09:19
@mat-hek mat-hek changed the base branch from swm to main September 12, 2025 14:39
Comment on lines 9 to 10
push:
branches: ["**"]
Copy link
Member

Choose a reason for hiding this comment

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

Do we need a build on push? Maybe on pull request would suffice?

Copy link
Member Author

Choose a reason for hiding this comment

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

Is it problematic assuming we enable the concurrency? If not, I'd leave it, it's nice to have a status next to each commit, no matter if a PR is open

Copy link
Member

Choose a reason for hiding this comment

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

If after making it public we don't have CI minutes limit, then it's fine

Comment on lines 8 to 12
on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
Copy link
Member

Choose a reason for hiding this comment

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

If we filter nothing, we might as well skip branches

Suggested change
on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
on: [push, pull_request]

or even

Suggested change
on:
push:
branches: ["**"]
pull_request:
branches: ["**"]
on: pull_request

branches: ["**"]
pull_request:
branches: ["**"]

Copy link
Member

Choose a reason for hiding this comment

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

If using both push and pull_request, I'd add concurrency like in popcorn and original workflows

Suggested change
concurrency:
group: ${{ github.workflow }}-${{ github.ref != 'refs/heads/main' && github.ref || github.run_id }}
cancel-in-progress: true

Copy link
Member

Choose a reason for hiding this comment

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

We could actually use that to have consistency in formatting

Copy link
Member Author

Choose a reason for hiding this comment

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

Tried enabling it, but one of the checks fails to run: https://github.com/software-mansion-labs/FissionVM/actions/runs/17796124092/job/50584059031 I'm not really into debugging it :P

Copy link
Member

Choose a reason for hiding this comment

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

Lol, its simply a matter of repo name - on line 69

it should be

cd ../FissionVM

fprintf(stderr, "nif not found\n");
AVM_ABORT();

RAISE_ERROR(UNDEF_ATOM);
Copy link
Member

Choose a reason for hiding this comment

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

This code is unreachable, can you delete it?

Copy link
Member

Choose a reason for hiding this comment

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

Could we further break down this file and have nifs from each erlang/elixir module in separate file? IMO this file should only contain structs for NIFs and popcorn_nifs_get_nif.
This can be in a separate PR though

Copy link
Member Author

@mat-hek mat-hek Sep 16, 2025

Choose a reason for hiding this comment

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

Not sure, since most of these NIFs will be removed once we upstream them, and I'd generally expect to have only a few NIFs here

free(input_buffer);

memcpy(result, ctx.digest, 16);
} No newline at end of file
Copy link
Member

Choose a reason for hiding this comment

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

nit: missing EOL

Comment on lines +1046 to +838
static const struct Nif ets_new_nif = {
.base.type = NIFFunctionType,
.nif_ptr = nif_ets_new
};
Copy link
Member

Choose a reason for hiding this comment

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

This is very repetitive, could we handle it with a macro?

Copy link
Member Author

@mat-hek mat-hek Sep 16, 2025

Choose a reason for hiding this comment

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

I think it should rather be similar to nifs.c, so we can move NIFs around (fairly) easily and to keep it simple

@@ -0,0 +1,1114 @@
// See popcorn_nifs.gperf for status of each NIF
Copy link
Member

Choose a reason for hiding this comment

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

IMO this status should be here assuming only structs will be here

@mat-hek mat-hek force-pushed the mf/popcorn-nifs branch 3 times, most recently from 1a0aa64 to eca8e05 Compare September 17, 2025 11:48
@mat-hek mat-hek requested a review from bblaszkow06 September 17, 2025 11:49
@mat-hek mat-hek changed the base branch from main to swm October 29, 2025 13:45
@mat-hek mat-hek changed the base branch from swm to main October 29, 2025 13:46
@mat-hek mat-hek removed the request for review from bblaszkow06 October 30, 2025 11:22
@mat-hek mat-hek marked this pull request as ready for review October 30, 2025 11:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants