Skip to content

Conversation

@DaniilKl
Copy link
Contributor

No description provided.

@DaniilKl DaniilKl self-assigned this May 27, 2025
@DaniilKl DaniilKl changed the base branch from main to develop May 27, 2025 10:15
Copy link
Contributor

@m-iwanicki m-iwanicki left a comment

Choose a reason for hiding this comment

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

  1. Are you sure you don't need inherit rust-target-config (you removed it in a lot of places)
  2. Did you test it?


}

addtask rust_create_wrappers before do_configure after do_patch do_prepare_recipe_sysroot
Copy link
Contributor

Choose a reason for hiding this comment

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

duplicate

# Note that TUNE_FEATURES is _always_ refering to the target, so we really
# don't want to use this for the host/build.
llvm_features_from_tune[vardepvalue] = "${@llvm_features_from_tune(d)}"
# TARGET_CC_ARCH changes from build/cross/target so it'll do the right thing
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this comment related to llvm_features_from_tune or llvm_features_from_cc_arch?

fpu = d.getVar('TARGET_FPU')
return ["+soft-float"] if fpu == "soft" else []

## arm-unknown-linux-gnueabihf
Copy link
Contributor

Choose a reason for hiding this comment

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

Why did you move comment?

Comment on lines 261 to 262
# Convert a normal arch (HOST_ARCH, TARGET_ARCH, BUILD_ARCH, etc) to something
# rust's internals won't choke on.
Copy link
Contributor

Choose a reason for hiding this comment

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

This should probably be above arch_to_rust_target_arch

Comment on lines 422 to 424
addtask rust_gen_targets after do_patch before do_compile
addtask rust_gen_targets after do_patch before do_compile
addtask rust_gen_targets after do_patch before do_compile
Copy link
Contributor

Choose a reason for hiding this comment

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

A lot of duplicates

RUSTLIB = "-L ${STAGING_DIR_HOST}${rustlibdir}"
RUST_DEBUG_REMAP = "--remap-path-prefix=${WORKDIR}=${TARGET_DBGSRC_DIR}"
RUSTFLAGS += "${RUSTLIB} ${RUST_DEBUG_REMAP}"
RUSTFLAGS:append = "${RUSTLIB} ${RUST_DEBUG_REMAP}"
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. Let's hope this recipe wasn't depending on how += works (if previously RUSTFLAGS had ??= then += would overwrite this value while append would add to ??= (not sure about ?=))

  2. Suggested change
    RUSTFLAGS += "${RUSTLIB} ${RUST_DEBUG_REMAP}"
    RUSTFLAGS:append = "${RUSTLIB} ${RUST_DEBUG_REMAP}"
    RUSTFLAGS += "${RUSTLIB} ${RUST_DEBUG_REMAP}"
    RUSTFLAGS:append = " ${RUSTLIB} ${RUST_DEBUG_REMAP}"

    Add space to the beginning when using append

@DaniilKl
Copy link
Contributor Author

@m-iwanicki I jnow all the issues you outlined, this is the reason this PR is in draft state

@DaniilKl
Copy link
Contributor Author

The problem that blocks this PR:

ERROR: rust-native-1.83.0-r0 do_rust_create_wrappers: ExecutionError('/build/tmp/work/x86_64-linux/rust-native/1.83.0/temp/run.do_rust_create_wrappers.540', 2, None, None)
ERROR: Logfile of failure stored in: /build/tmp/work/x86_64-linux/rust-native/1.83.0/temp/log.do_rust_create_wrappers.540
Log data follows:
| DEBUG: Executing shell function do_rust_create_wrappers
| /build/tmp/work/x86_64-linux/rust-native/1.83.0/temp/run.do_rust_create_wrappers.540: 210: Syntax error: end of file unexpected (expecting "}")
| WARNING: exit code 2 from a shell command.
ERROR: Task (virtual:native:/build/../repo/meta-zarhus-distro/recipes-devtools/rust/rust_1.83.0.bb:do_rust_create_wrappers) failed with exit code '1'

@DaniilKl DaniilKl force-pushed the fix-rust-pre-commit branch from 796a66c to 70b2399 Compare June 10, 2025 12:36
DaniilKl added 2 commits June 12, 2025 11:52
Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
We are using copied classes from other layers (e.g., Rust). These classes are used
not onnly in our recipes but in several recipes in other layers. Hence,
changing the names of these classes will ccause recipes in other layers
to fail.

Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
@DaniilKl DaniilKl force-pushed the fix-rust-pre-commit branch from 70b2399 to c305063 Compare June 12, 2025 09:52
@m-iwanicki
Copy link
Contributor

The problem might be with python/EOF. You changed tabs to spaces?
Maybe cat <<- EOF was depending on EOF having a tab. Test in bash confirms:

cat <<- EOF
hello
    EOF
sadsa
        EOF

Output:

hello
    EOF
sadsa

EOF prefixed with spaces doesn't work

@pietrushnic
Copy link

@DaniilKl, this change is already blocking some others. Could you address the review so we can merge this? Why is this in WIP? Also please consider splitting to just address #69 (comment)

@DaniilKl
Copy link
Contributor Author

Also please consider splitting to just address

There is nothing to be splitted. This entire PR fixes on issue: the Rust classes not passing pre-commit.

I will try to take a look tomorrow.

Signed-off-by: Daniil Klimuk <daniil.klimuk@3mdeb.com>
@DaniilKl
Copy link
Contributor Author

DaniilKl commented Sep 4, 2025

The last commit seems to have broken smth.: logs.

@m-iwanicki
Copy link
Contributor

There is still a lot of unresolved comments. Maybe something to do with that?

@m-iwanicki m-iwanicki mentioned this pull request Oct 7, 2025
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