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

`ioreg` under cargo #247

Closed
wants to merge 3 commits into
base: master
from

Conversation

Projects
None yet
3 participants
@tamird
Contributor

tamird commented Nov 26, 2014

baby steps toward building with cargo. @farcaller any advice on how to integrate cargo build/cargo test into the current rakefile infrastructure?

@farcaller

This comment has been minimized.

Show comment
Hide comment
@farcaller

farcaller Nov 26, 2014

Member

Swap this

compile_rust :ioreg_crate, {
  source:    'ioreg/ioreg.rs'.in_source,
  produce:   'ioreg/ioreg.rs'.in_source.as_dylib.in_build,
  out_dir:   true,
  build_for: :host,
}

with a call to cargo. Effectively it's

task 'ioreg/ioreg.rs'.in_source.as_dylib.in_build => 'ioreg/ioreg.rs'.in_source do |task|

end

block

Member

farcaller commented Nov 26, 2014

Swap this

compile_rust :ioreg_crate, {
  source:    'ioreg/ioreg.rs'.in_source,
  produce:   'ioreg/ioreg.rs'.in_source.as_dylib.in_build,
  out_dir:   true,
  build_for: :host,
}

with a call to cargo. Effectively it's

task 'ioreg/ioreg.rs'.in_source.as_dylib.in_build => 'ioreg/ioreg.rs'.in_source do |task|

end

block

@tamird

This comment has been minimized.

Show comment
Hide comment
@tamird

tamird Nov 26, 2014

Contributor

I'm not sure that cargo is expressive enough to capture all the arguments being passed in compile_rust. I don't suppose you know how that could be achieved?

Contributor

tamird commented Nov 26, 2014

I'm not sure that cargo is expressive enough to capture all the arguments being passed in compile_rust. I don't suppose you know how that could be achieved?

@farcaller

This comment has been minimized.

Show comment
Hide comment
@farcaller

farcaller Nov 26, 2014

Member

Based on the command line

rustc
  --opt-level 2 # covered by cargo
  -Z no-landing-pads
  --cfg cfg_mcu_has_spi --cfg mcu_lpc17xx --cfg arch_cortex_m3 # deprecated
  --target thumbv7m-none-eabi # covered by cargo
  -Ctarget-cpu=cortex-m3 -C relocation_model=static -C no-stack-check # covered by target spec json
  -g # covered by cargo
  -L /Users/farcaller/src/zinc/build # transient; solvable with symlinks
  --out-dir /Users/farcaller/src/zinc/build # ditto

there's only one flag (-Z no-landing-pads) that cannot be handled yet and it's not exactly a show stopper, I think.

Member

farcaller commented Nov 26, 2014

Based on the command line

rustc
  --opt-level 2 # covered by cargo
  -Z no-landing-pads
  --cfg cfg_mcu_has_spi --cfg mcu_lpc17xx --cfg arch_cortex_m3 # deprecated
  --target thumbv7m-none-eabi # covered by cargo
  -Ctarget-cpu=cortex-m3 -C relocation_model=static -C no-stack-check # covered by target spec json
  -g # covered by cargo
  -L /Users/farcaller/src/zinc/build # transient; solvable with symlinks
  --out-dir /Users/farcaller/src/zinc/build # ditto

there's only one flag (-Z no-landing-pads) that cannot be handled yet and it's not exactly a show stopper, I think.

@tamird

This comment has been minimized.

Show comment
Hide comment
@tamird

tamird Mar 10, 2015

Contributor

@farcaller just rebased this - running into issues with the task syntax you suggested:

Gumby:zinc tamird$ rake PLATFORM=k20 -T
rake aborted!
Missing rule ioreg_crate
/Users/tamird/src/zinc/support/build/helpers.rb:33:in `block in resolve_deps!'
/Users/tamird/src/zinc/support/build/helpers.rb:31:in `map'
/Users/tamird/src/zinc/support/build/helpers.rb:31:in `resolve_deps!'
support/rake.rb:26:in `compile_rust'
support/rake.rb:141:in `rust_tests'
/Users/tamird/src/zinc/Rakefile:68:in `<top (required)>'
(See full trace by running task with --trace)

Any ideas on how to satisfy the dependency resolution?

Contributor

tamird commented Mar 10, 2015

@farcaller just rebased this - running into issues with the task syntax you suggested:

Gumby:zinc tamird$ rake PLATFORM=k20 -T
rake aborted!
Missing rule ioreg_crate
/Users/tamird/src/zinc/support/build/helpers.rb:33:in `block in resolve_deps!'
/Users/tamird/src/zinc/support/build/helpers.rb:31:in `map'
/Users/tamird/src/zinc/support/build/helpers.rb:31:in `resolve_deps!'
support/rake.rb:26:in `compile_rust'
support/rake.rb:141:in `rust_tests'
/Users/tamird/src/zinc/Rakefile:68:in `<top (required)>'
(See full trace by running task with --trace)

Any ideas on how to satisfy the dependency resolution?

@farcaller

This comment has been minimized.

Show comment
Hide comment
@farcaller

farcaller Mar 10, 2015

Member

I'm actually working on the same problem from different point of view. Most of zinc can be built with cargo as is, only the actual application build process is different and will require additional handling. I'm trying to figure the proper extent of the linking issues, as some of them do belong to rustc, while others are really cargo's job. The point is, we'll hopefully get rid of ruby build toolchain.

Member

farcaller commented Mar 10, 2015

I'm actually working on the same problem from different point of view. Most of zinc can be built with cargo as is, only the actual application build process is different and will require additional handling. I'm trying to figure the proper extent of the linking issues, as some of them do belong to rustc, while others are really cargo's job. The point is, we'll hopefully get rid of ruby build toolchain.

@tamird

This comment has been minimized.

Show comment
Hide comment
@tamird

tamird Mar 10, 2015

Contributor

@farcaller alright, awesome. I'll close this PR and let you take it from here.

Contributor

tamird commented Mar 10, 2015

@farcaller alright, awesome. I'll close this PR and let you take it from here.

@tamird tamird closed this Mar 10, 2015

@bharrisau bharrisau reopened this Mar 10, 2015

@bharrisau bharrisau added in progress and removed in progress labels Mar 10, 2015

@tamird tamird closed this Mar 15, 2015

@bharrisau bharrisau removed the in progress label Mar 15, 2015

@tamird tamird deleted the tamird:cargo-stuff branch Mar 15, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment