Skip to content
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

Can't publish packages in workspace #291

Closed
wangfenjin opened this issue Sep 4, 2021 · 16 comments
Closed

Can't publish packages in workspace #291

wangfenjin opened this issue Sep 4, 2021 · 16 comments
Labels
bug Something isn't working

Comments

@wangfenjin
Copy link

In the code I update both libduckdb-sys and duckdb, but the published version can't be find

https://github.com/wangfenjin/duckdb-rs/runs/3512742679?check_suite_focus=true

Searching cargo packages at './'
Found packages: duckdb, libduckdb-sys
Checking packages consistency
Sorting packages according dependencies
Publishing package 'libduckdb-sys'
/usr/share/rust/.cargo/bin/cargo publish --no-verify --allow-dirty --all-features
    Updating crates.io index
   Packaging libduckdb-sys v0.2.3 (/home/runner/work/duckdb-rs/duckdb-rs/libduckdb-sys)
   Uploading libduckdb-sys v0.2.3 (/home/runner/work/duckdb-rs/duckdb-rs/libduckdb-sys)
/usr/share/rust/.cargo/bin/cargo update
    Updating crates.io index
Package 'libduckdb-sys' published successfully
Publishing package 'duckdb'
/usr/share/rust/.cargo/bin/cargo publish --no-verify --allow-dirty --all-features
    Updating crates.io index
   Packaging duckdb v0.2.3 (/home/runner/work/duckdb-rs/duckdb-rs)
error: failed to prepare local package for uploading

Caused by:
  failed to select a version for the requirement `libduckdb-sys = "^0.2.3"`
  candidate versions found which didn't match: 0.2.2, 0.2.1, 0.2.0, ...
  location searched: crates.io index
  required by package `duckdb v0.2.3 (/home/runner/work/duckdb-rs/duckdb-rs)`
Error: The process '/usr/share/rust/.cargo/bin/cargo' failed with exit code 101
@wangfenjin
Copy link
Author

https://github.com/wangfenjin/duckdb-rs/pull/21/files this is my code change

@katyo
Copy link
Owner

katyo commented Sep 4, 2021

@wangfenjin Sounds strange because this action awaits when published package will be available on registry and also triggers cargo update after publishing:

await awaitCrateVersion(package_name, package_info.version)
await exec('cargo', ['update'], exec_opts)

@wangfenjin
Copy link
Author

yes, but acctually I had tried two times, still not succeed so I create this issue.

LOL, is it because the cargo crate server cache inconsistent?

@wangfenjin
Copy link
Author

@katyo maybe after cargo update, we can await awaitCrateVersion(package_name, package_info.version) again, maybe will make things better...

@wangfenjin
Copy link
Author

In order to test this, I always need to bump the version because after the first crate published, I can't publish the version again.

So I'm thinking should we add settings to check if this version is already published and we can skip it, that way we don't need to bump the version every time...

@wangfenjin
Copy link
Author

Another benefit is it also enable us only update one of the packages in the workspace

@katyo
Copy link
Owner

katyo commented Sep 4, 2021

In order to test this, I always need to bump the version because after the first crate published, I can't publish the version again.

So I'm thinking should we add settings to check if this version is already published and we can skip it, that way we don't need to bump the version every time...

Another benefit is it also enable us only update one of the packages in the workspace

Such behavior already implemented by default (see description in README.md).
This action publishes only packages with updated versions which does not published yet skipping already published.

@katyo
Copy link
Owner

katyo commented Sep 4, 2021

@wangfenjin Seems this problem related to cargo cache.
I think we may try repeat cargo update > cargo publish when publishing failed.

@wangfenjin
Copy link
Author

https://github.com/wangfenjin/duckdb-rs/runs/3514142038?check_suite_focus=true

are you sure it’s the case? I rerun the workflow but still failed

@katyo
Copy link
Owner

katyo commented Sep 4, 2021

Hmm, seems other error occurred (#151).

It seems something wrong with

const {edges} = result.repository.ref.target.history

@katyo
Copy link
Owner

katyo commented Sep 4, 2021

@wangfenjin Could you test branch fix-151?

@katyo katyo added the bug Something isn't working label Sep 10, 2021
@alepez
Copy link

alepez commented Jan 7, 2022

Hi. Thanks for your work. I just tried to use this action on a workspace, but it seems to fail to select the correct version.

Here we see "Package 'provola-terminalreporter' published successfully" but after that, the next crate which depends on it fails.

   Compiling strum_macros v0.23.1
   Compiling thiserror v1.0.30
   Compiling chrono v0.4.19
   Compiling provola-core v0.2.0
   Compiling provola-terminalreporter v0.2.0 (/home/runner/work/provola/provola/target/package/provola-terminalreporter-0.2.0)
    Finished dev [unoptimized + debuginfo] target(s) in 31.57s
   Uploading provola-terminalreporter v0.2.0 (/home/runner/work/provola/provola/provola-terminalreporter)
/home/runner/.cargo/bin/cargo update
    Updating crates.io index
Package 'provola-terminalreporter' published successfully
Publishing package 'provola-reporters'
/home/runner/.cargo/bin/cargo publish
    Updating crates.io index
   Packaging provola-reporters v0.2.0 (/home/runner/work/provola/provola/provola-reporters)
   Verifying provola-reporters v0.2.0 (/home/runner/work/provola/provola/provola-reporters)
error: failed to verify package tarball

Caused by:
  failed to select a version for the requirement `provola-terminalreporter = "^0.2.0"`
  candidate versions found which didn't match: 0.1.7
  location searched: crates.io index
  required by package `provola-reporters v0.2.0 (/home/runner/work/provola/provola/target/package/provola-reporters-0.2.0)`

tomtau pushed a commit to tomtau/pest that referenced this issue Jul 29, 2022
tomtau pushed a commit to pest-parser/pest that referenced this issue Jul 29, 2022
@alexxbb
Copy link

alexxbb commented Jan 11, 2023

Got the same error:

Error: Unable to determine latest modification time for local package 'hapi-rs' due to: 'TypeError: Cannot destructure property 'edges' of 'result.repository.ref.target.history' as it is undefined.'

@katyo Do you happen to know what caused this?

@wangfenjin
Copy link
Author

Anyone have this issue can also try my fork

@wangfenjin
Copy link
Author

@alexxbb
Copy link

alexxbb commented Jan 13, 2023

Update: The error seems related to the crate's version in my case. I forgot to update the Cargo.toml and got this error. Once I updated the version the Action started working again.

@katyo katyo closed this as completed Mar 16, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants