-
Notifications
You must be signed in to change notification settings - Fork 66
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
download dependencies in a separate task #149
base: master
Are you sure you want to change the base?
download dependencies in a separate task #149
Conversation
I agree this makes sense, I'm guessing many users may just be on older Yocto versions or not running on systems that have the requisite kernel support to enforce this. I think the alternative, and possibly better, alternative would be to run |
I agree with the dependency download in |
While that's possible, I don't think it should be enough of a deterrent to safely keep the default as prohibiting network access. Build.rs scripts that reach out to the network are, as far as I know, not generally common or encouraged and likely work against the aims we should aim for by default to have reproducible builds given the same source input. If this is something that some users encounter, then they can definitely just enable network for do_compile. |
Working on this I found a problem with the latest PR, this: meta-rust-bin/classes/cargo_bin.bbclass Lines 69 to 71 in 7ac87ec
was replace with this: meta-rust-bin/classes/cargo_bin.bbclass Line 106 in 2089ae6
But it should be However there is another issue. according to the cargo documentation here:
But in the meta-rust-bin/classes/cargo_bin.bbclass Line 94 in 2089ae6
I tested the behaviour and I can confirm that the flag However for curiosity I tried to enable it manually to understand the reasons behind it and what I get in the ELF is:
This make no sense to me. I think it's safe to remove it |
0ed8896
to
06dcb62
Compare
Hello, I like the idea of removing the network phase from the I agree with @posborne on the |
1b1452f
to
25e6a85
Compare
Testing the new class, I discovered that is impossible to call The task order is the following: $ cat build/tmp/work/core2-64-poky-linux/gpio-utils/1.0-r0/temp/log.task_order
do_deploy_source_date_epoch_setscene (357874): log.do_deploy_source_date_epoch_setscene.357874
do_fetch (357928): log.do_fetch.357928
do_unpack (357934): log.do_unpack.357934
do_prepare_recipe_sysroot (357935): log.do_prepare_recipe_sysroot.357935
do_patch (357965): log.do_patch.357965
do_configure (357975): log.do_configure.357975
do_compile (357988): log.do_compile.357988
do_compile (358044): log.do_compile.358044
do_compile (358098): log.do_compile.358098
do_compile (358156): log.do_compile.358156 from what I understand recipe tasks in Yocto are not a true standard. for example the kernel has a complete different flow, something like that:
my proposal it add a new task called for example addtask do_cargo_fetch after do_configure before do_compile
do_cargo_fetch[network] = "1"
do_cargo_fetch[dirs]= "${B}"
cargo_bin_do_cargo_fetch() {
cargo fetch --manifest-path ${CARGO_MANIFEST_PATH}
} what do you think about it? |
I think that's a good trade-off 👍 |
That seems like a pretty reasonable approach to me, agree that the tasks are a convention but it is not unusual to need to define custom tasks for various software packages or flows as required and it can be preferred to trying to do too much with prepend/append onto other tasks. |
529c7f5
to
cad67a7
Compare
cad67a7
to
d7f8bcb
Compare
Rebased and updated documentation |
CARGO_BUILD_PROFILE ?= "release" | ||
# This is based on the content of CARGO_BUILD_FLAGS and generally will need to | ||
# change if CARGO_BUILD_FLAGS changes. | ||
CARGO_BUILD_PROFILE ?= "${@oe.utils.conditional('DEBUG_BUILD', '1', 'debug', 'release', d)}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@posborne in my previous changes I added this conditional selection to have a debug build for coherency with the global Yocto settings.
I noticed you made some changes about CARGO_BINDIR
, is it correct to use 'debug'
or I have to use 'dev'
?
b2838a0
to
3a2a348
Compare
I would like to enable the network during the compile task by default on
cargo_bin
class.I think there is no reason to leave this configuration to the user, this is the normal behaviour expected for
cargo_bin
.To finish the PR I need to:
In the meantime, please let me know what you think
Fix #150