Skip to content

Commit

Permalink
Merge pull request #109 from theotherjimmy/use-stable
Browse files Browse the repository at this point in the history
Use stable rust
  • Loading branch information
theotherjimmy authored May 29, 2019
2 parents 0e6d085 + a450f11 commit ecf75f0
Show file tree
Hide file tree
Showing 9 changed files with 129 additions and 35 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
language: rust
rust: nightly-2018-11-07
rust: stable
cache: cargo

install:
Expand Down
4 changes: 2 additions & 2 deletions appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ clone_depth: 1
environment:
matrix:
- TOOLCHAIN_VERSION: 14.0
channel: nightly-2018-11-07
channel: stable
target: i686-pc-windows-msvc
PYTHON: "C:\\Python37"
platform: Win32
- TOOLCHAIN_VERSION: 14.0
channel: nightly-2018-11-07
channel: stable
target: x86_64-pc-windows-msvc
PYTHON: "C:\\Python37-x64"
platform: x64
Expand Down
2 changes: 1 addition & 1 deletion build-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ function clean_project {
popd
}

RUST_CHANNEL=nightly-2018-11-07
RUST_CHANNEL=stable

if [[ $1 == "osx" ]]; then
pip2 install --user -U pip setuptools wheel
Expand Down
4 changes: 0 additions & 4 deletions rust/cmsis-cffi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
name = "cmsis-cffi"
version = "0.1.0"
authors = ["Jimmy Brisson <[email protected]>"]
build = "build.rs"

[lib]
name = "cmsis_cffi"
Expand All @@ -18,6 +17,3 @@ cmsis-update = { path = "../cmsis-update" }
pack-index = { path = "../pack-index" }
pdsc = { path = "../pdsc" }
utils = { path = "../utils" }

[build-dependencies]
cbindgen = "~0.6.0"
24 changes: 0 additions & 24 deletions rust/cmsis-cffi/build.rs

This file was deleted.

53 changes: 53 additions & 0 deletions rust/cmsis-cffi/cbindgen.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# An optional string of text to output at the beginning of the generated file
header = """
/* Unless specifically indicated otherwise in a file, files are licensed
* under the Apache 2.0 license, as can be found in: apache-2.0.txt
*/
"""
# An optional name to use as an include guard
include_guard = "_CMSIS_H_"
# An optional string of text to output between major sections of the generated
# file as a warning against manual editing
autogen_warning = """
/* Warning, this file is autogenerated by cbindgen. Don't modify this manually.
* To regenerate use `rustup run nightly cbindgen . > cmsis.h` in this directory.
*/
"""
# Whether to include a comment with the version of cbindgen used to generate the
# file
include_version = true
# The style to use for curly braces
braces = "SameLine"
# The desired length of a line to use when formatting lines
line_length = 80
# The amount of spaces in a tab
tab_width = 8
# The language to output bindings in
language = "C"
# A rule to use to select style of declaration in C, tagname vs typedef
style = "Both"
# How the generated documentation should be commented.
# C uses /* */; C99 uses //; C++ uses ///; Doxy is like C but with leading * per line.
documentation_style = "C"

[parse]
# Whether to parse dependent crates and include their types in the generated
# bindings
parse_deps = false
# A white list of crate names that are allowed to be parsed
include = ["cmsis-cffi"]
# Whether to use a new temporary target directory when running `rustc --pretty=expanded`.
# This may be required for some build processes.
clean = false

[parse.expand]
# A list of crate names that should be run through `cargo expand` before
# parsing to expand any macros
crates = ["cmsis-cffi"]
# If enabled, use the `--all-features` option when expanding. Ignored when
# `features` is set. Disabled by default, except when using the
# `expand = ["euclid"]` shorthand for backwards-compatibility.
all_features = false
# When `all_features` is disabled and this is also disabled, use the
# `--no-default-features` option when expanding. Enabled by default.
default_features = true
71 changes: 71 additions & 0 deletions rust/cmsis-cffi/cmsis.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@

/* Unless specifically indicated otherwise in a file, files are licensed
* under the Apache 2.0 license, as can be found in: apache-2.0.txt
*/


#ifndef _CMSIS_H_
#define _CMSIS_H_

/* Generated with cbindgen:0.8.7 */

/* Warning, this file is autogenerated by cbindgen. Don't modify this manually.
* To regenerate use `rustup run nightly cbindgen . > cmsis.h` in this directory.
*/


#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>

typedef struct ParsedPacks ParsedPacks;

typedef struct UpdatePoll UpdatePoll;

typedef struct UpdateReturn UpdateReturn;

typedef struct DownloadUpdate {
bool is_size;
uintptr_t size;
} DownloadUpdate;

void cstring_free(char *ptr);

void dump_pdsc_json(ParsedPacks *packs,
const char *devices_dest,
const char *boards_dest);

const char *dumps_components(ParsedPacks *ptr);

const char *err_get_last_message(void);

void err_last_message_free(char *ptr);

UpdateReturn *pack_from_path(const char *ptr);

ParsedPacks *parse_packs(UpdateReturn *ptr);

void parse_packs_free(ParsedPacks *ptr);

UpdatePoll *update_packs(const char *pack_store, ParsedPacks *parsed_packs);

DownloadUpdate *update_pdsc_get_status(UpdatePoll *ptr);

UpdatePoll *update_pdsc_index(const char *pack_store, const char *vidx_list);

void update_pdsc_index_free(UpdateReturn *ptr);

UpdateReturn *update_pdsc_index_new(void);

const char *update_pdsc_index_next(UpdateReturn *ptr);

void update_pdsc_index_push(UpdateReturn *ptr, char *cstr);

bool update_pdsc_poll(UpdatePoll *ptr);

UpdateReturn *update_pdsc_result(UpdatePoll *ptr);

void update_pdsc_status_free(DownloadUpdate *ptr);

#endif /* _CMSIS_H_ */
2 changes: 0 additions & 2 deletions rust/cmsis-update/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#![feature(generators, libc, proc_macro_hygiene)]

extern crate futures;
extern crate tokio_core;
extern crate hyper;
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def build_native(spec):
module_path='cmsis_pack_manager._native',
dylib=lambda: build.find_dylib('cmsis_cffi',
in_path='target/release/deps'),
header_filename=lambda: build.find_header('cmsis.h', in_path='target')
header_filename=lambda: build.find_header('cmsis.h', in_path='cmsis-cffi')
)

def run(cmd):
Expand Down

0 comments on commit ecf75f0

Please sign in to comment.