Skip to content

Commit

Permalink
Hotfix release
Browse files Browse the repository at this point in the history
Repair building buffrs without the default features
  • Loading branch information
mara-schulke committed Sep 27, 2023
1 parent 03a3058 commit 033985b
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "buffrs"
version = "0.6.2"
version = "0.6.3"
edition = "2021"
description = "Modern protobuf package management"
authors = ["Mara Schulke <[email protected]>"]
Expand Down
8 changes: 5 additions & 3 deletions src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,13 @@

use crate::{
credentials::Credentials,
generator,
lock::{LockedPackage, Lockfile},
manifest::{Dependency, Manifest, PackageManifest},
package::{DependencyGraph, PackageName, PackageStore, PackageType},
registry::{Artifactory, Registry, RegistryUri},
Language,
};
#[cfg(feature = "build")]
use crate::{generator, Language};
use async_recursion::async_recursion;
use eyre::{ensure, Context, ContextCompat};
use semver::{Version, VersionReq};
Expand Down Expand Up @@ -142,9 +142,10 @@ pub async fn publish(
credentials: Credentials,
registry: RegistryUri,
repository: String,
allow_dirty: bool,
#[cfg(feature = "build")] allow_dirty: bool,
dry_run: bool,
) -> eyre::Result<()> {
#[cfg(feature = "build")]
if let Ok(repository) = git2::Repository::discover(Path::new(".")) {
let statuses = repository
.statuses(None)
Expand Down Expand Up @@ -257,6 +258,7 @@ pub async fn uninstall() -> eyre::Result<()> {
}

/// Generate bindings for a given language
#[cfg(feature = "build")]
pub async fn generate(language: Language) -> eyre::Result<()> {
generator::generate(language)
.await
Expand Down
16 changes: 8 additions & 8 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,19 @@ pub mod registry;
#[cfg(feature = "build")]
pub use generator::Language;

use credentials::Credentials;
use package::PackageStore;

/// Cargo build integration for buffrs
///
/// Important: Only use this inside of cargo build scripts!
#[cfg(feature = "build")]
pub fn build() -> eyre::Result<()> {
use credentials::Credentials;
use package::PackageStore;

async fn install() -> eyre::Result<()> {
let credentials = Credentials::read().await?;
command::install(credentials).await
}

println!("cargo:rerun-if-changed={}", PackageStore::PROTO_VENDOR_PATH);

let rt = tokio::runtime::Runtime::new()?;
Expand All @@ -51,11 +56,6 @@ pub fn build() -> eyre::Result<()> {
Ok(())
}

async fn install() -> eyre::Result<()> {
let credentials = Credentials::read().await?;
command::install(credentials).await
}

/// Include generated rust language bindings for buffrs.
///
/// ```rust,ignore
Expand Down

0 comments on commit 033985b

Please sign in to comment.