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

Makefile #203

Closed
wants to merge 3 commits into from
Closed

Makefile #203

wants to merge 3 commits into from

Conversation

janmazak
Copy link
Collaborator

No description provided.

Makefile Outdated
DEFINES += HAVE_U2F HAVE_IO_U2F U2F_PROXY_MAGIC=\"ADA\"
SDK_SOURCE_PATH += lib_u2f

DEFINES += HAVE_UX_LEGACY
Copy link
Contributor

Choose a reason for hiding this comment

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

This wasn't included in the previous version, is it really needed?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think what you need is something like:

ifeq ($(TARGET_NAME), TARGET_NANOS)
    DISABLE_STANDARD_BAGL_UX_FLOW=1
endif

To keep the same kind of stuff that you had before.
Though dropping the usage of old nanos ux code, to use the common one would be an interssting improvement.
I see that it's automatically done if you have HAVE_FLOW in uiHelpers_nanos.c and uiHelpers_nanox.c but not in menu_nanos.c, menu_nanox.c, menu.h, io.c, uiHelpers.h, io.h, uiScreens_bagl.c, uiHelpers.c

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I've tried it, however, I'd say that lib_standard_app/main.c is not compatible with it:

/opt/nanos-secure-sdk/lib_standard_app/main.c:33:19: error: redefinition of 'ux' with a different type: 'bolos_ux_params_t' (aka 'struct bolos_ux_params_s') vs 'ux_state_t' (aka 'struct ux_state_s')
bolos_ux_params_t G_ux_params;
                  ^
/opt/nanos-secure-sdk/lib_ux/include/ux.h:322:30: note: expanded from macro 'G_ux_params'
#define G_ux_params          ux.params
                             ^
/opt/nanos-secure-sdk/lib_standard_app/main.c:32:19: note: previous definition is here
ux_state_t        G_ux;
                  ^
/opt/nanos-secure-sdk/lib_ux/include/ux.h:321:30: note: expanded from macro 'G_ux'
#define G_ux                 ux
                             ^
/opt/nanos-secure-sdk/lib_standard_app/main.c:33:19: error: expected ';' after top level declarator
bolos_ux_params_t G_ux_params;
                  ^
/opt/nanos-secure-sdk/lib_ux/include/ux.h:322:32: note: expanded from macro 'G_ux_params'
#define G_ux_params          ux.params

@xchapron-ledger Any advice, please?

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess you have to choose between either:

1/ Keeping old Nanos flow, and thus having:

ifeq ($(TARGET_NAME), TARGET_NANOS)
    DISABLE_STANDARD_BAGL_UX_FLOW=1
endif

and DISABLE_STANDARD_APP_FILES=1
which means you only benefit from standard_app makefile, and not from other files from the lib.

2/ Update the UX code to the flow UX API, and therefore drop the DISABLE_STANDARD_BAGL_UX_FLOW=1 and
HAVE_UX_LEGACY

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

(At some point, we might rewrite the UI to use the new version, but at present we don't have time and budget for that.)

Copy link
Contributor

Choose a reason for hiding this comment

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

As you want, I'm even wondering if you have anything to do.
I looks like you could simply:

  • Enable HAVE_FLOW for TARGET_NANOS
  • Update some #ifdef in menu_nanos.c, menu_nanox.c, menu.h, io.c, uiHelpers.h, io.h, uiScreens_bagl.c, uiHelpers.c
    And that should be all?
    But could be for another time.

Makefile Outdated Show resolved Hide resolved
Makefile Outdated
python -m ledgerblue.deleteApp $(COMMON_DELETE_PARAMS)
# code style
format:
astyle --options=.astylerc "src/*.h" "src/*.c" --exclude=src/glyphs.h --exclude=src/glyphs.c --ignore-exclude-errors
Copy link
Contributor

Choose a reason for hiding this comment

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

glyphs.c and glyphs.h are not generated in src anymore.
You could make a CI check of the coding style to make sure code stay formatted.

Makefile Show resolved Hide resolved
src/cardano_io.c Outdated
Copy link
Contributor

Choose a reason for hiding this comment

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

Could probably be really simplified if using UX_FLOW on TARGET_NANOS

@janmazak janmazak force-pushed the makefile branch 4 times, most recently from b31197f to 852916f Compare November 29, 2023 13:51
@xchapron-ledger
Copy link
Contributor

The Makefile refactoring part (using makefile.standard_app) was interesting to have. Do you intend to drop it or do you want to push it differently?

@janmazak
Copy link
Collaborator Author

This got closed automatically, but we've not given up on Makefile refactoring.
#210
It will be part of the larger UX update planned by Ledger in 1H24 (so that "swap" can be implemented).

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.

2 participants