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

Fix semver-checks failure from aws-config #3265

Closed
ysaito1001 opened this issue Nov 28, 2023 · 0 comments
Closed

Fix semver-checks failure from aws-config #3265

ysaito1001 opened this issue Nov 28, 2023 · 0 comments
Assignees
Labels
ops Improves our operations and release process

Comments

@ysaito1001
Copy link
Contributor

semver-checks in CI has started failing recently, with the error looking something as follows:

Error: `cargo metadata` exited with an error: error: failed to get `aws-credential-types` as a dependency of package `aws-config v0.0.0-smithy-rs-head (/home/build/workspace/smithy-rs/target/semver-checks/git-base/fbbc73833ea2a2fb6cb588974bf905b8ac588c31/aws/rust-runtime/aws-config)`
    ... which satisfies path dependency `aws-config` of package `rustdoc v0.0.0 (/home/build/workspace/smithy-rs/target/semver-checks/git-base/local-aws_config-0_0_0_smithy_rs_head)`
Caused by:
  failed to load source for dependency `aws-credential-types`
Caused by:
  Unable to update /home/build/workspace/smithy-rs/target/semver-checks/git-base/fbbc73833ea2a2fb6cb588974bf905b8ac588c31/aws/sdk/build/aws-sdk/sdk/aws-credential-types
Caused by:
  failed to read `/home/build/workspace/smithy-rs/target/semver-checks/git-base/fbbc73833ea2a2fb6cb588974bf905b8ac588c31/aws/sdk/build/aws-sdk/sdk/aws-credential-types/Cargo.toml`

The failure comes from aws-config consistently.

@ysaito1001 ysaito1001 added the ops Improves our operations and release process label Nov 28, 2023
@ysaito1001 ysaito1001 self-assigned this Nov 28, 2023
rcoh pushed a commit that referenced this issue Nov 28, 2023
## Motivation and Context
Skip running `semver-checks` on `aws-config` to enable clean runs for CI
while #3265 is investigated.

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
ysaito1001 added a commit that referenced this issue Dec 1, 2023
## Motivation and Context
Fixes #3265

## Description
To check semver, `semver checks` needs to compile two versions of a
crate, i.e. baseline and current. Our CI failed to compile `aws-config`
for a baseline version.

The following diagram shows what was missing to cause compilation
failure:
```
┌───────────┐
│ smithy-rs │
└─────┬─────┘
      │
      │
      │     ┌────────┐
      └─────┤ target │
            └───┬────┘
                │        ┌───────────────┐
                └────────┤ semver_checks │
                         └───────┬───────┘
                                 │
                                 │
                                 │       ┌──────────┐
                                 └───────┤ git-base │
                                         └────┬─────┘
                                              │
                                              │        ┌──────────────┐
                                              ├────────┤ <rev number> │
                                              │        └──────┬───────┘
                                              │               │
                                              │               │
                                              │               │       ┌───────┐
                                              │               ├───────┤  aws  │
                                              │               │       └───┬───┘
                                              │               │           │
                                              │               │           │       ┌──────────────┐
                                              │               │           ├───────┤ rust-runtime │
                                              │               │           │       └──────┬───────┘
                                              │               │           │              │
                                              │               │           │              │       ┌────────────┐
                                              │               │           │              └───────┤ aws-config │ ◄***************
                                              │               │           │                      └────────────┘                *
                                              │               │           │                            *                       *
                                              │               │           │                            *                       *
                                              │               │           │          *****depends*on****                       *
                                              │               │           │          ▼                                         *
                                              │               │           │                                                    *
                                              │               │           │       ┌─────┐                                      *
                                              │               │           └───────┤ sdk │ (with no "build" directory)          *
                                              │               │                   └─────┘                                      *
                                              │               │                                                                *
                                              │               │                                                                *
                                              │               │      ┌────────────────────┐                                depends on
                                              │               └──────┤  tmp-codegen-diff  │                                    *
                                              │                      └─────────┬──────────┘                                    *
                                              │                                │                                               *
                                              │                                │       ┌─────────┐                             *
                                              │                                └───────┤ aws-sdk │                             *
                                              │                                        └────┬────┘                             *
                                              │                                             │     ┌─────┐                      *
                                              │                                             └─────┤ sdk │                      *
                                              │                                                   └─────┘                      *
                                              │                                                                                *
                                              │                                                                                *
                                              │           ┌───────────────────────────────────────┐                            *
                                              └───────────┤ local-aws_config-0_0_0_smithy_rs_head │*****************************
                                                          └───────────────────────────────────────┘
```
`local-aws_config-0_0_0_smithy_rs_head` under the `git-base` directory
is a special crate created by `semver-checks` for a baseline version of
`aws-config` and its `Cargo.toml` depends on
`target/semver_checks/git-base/<rev
number>/aws/rust-runtime/aws-config`. However, that `aws-config` in turn
depends upon crates in `target/semver_checks/git-base/<rev
number>/aws/sdk/build/` (as shown
[here](https://github.com/smithy-lang/smithy-rs/blob/main/aws/rust-runtime/aws-config/Cargo.toml#L23-L33)),
which does not exist in a baseline branch.

When `semver-checks.py` [creates a baseline
branch](https://github.com/smithy-lang/smithy-rs/blob/3d0cb5c3b179d5ed1d14531882657b481c4469f0/tools/ci-scripts/codegen-diff/semver-checks.py#L31)
to prepare for running `cargo semver-checks`, it [moves aws/sdk/build to
tmp-codegen-diff](https://github.com/smithy-lang/smithy-rs/blob/3d0cb5c3b179d5ed1d14531882657b481c4469f0/tools/ci-scripts/codegen-diff/diff_lib.py#L59),
leaving nothing behind in `aws/sdk/build/`. The fix, therefore, is to
`cp -r aws/sdk/build/aws-sdk` instead of `mv aws/sdk/build/aws-sdk` when
preparing a baseline branch.

The issue is specific to `aws-config`, probably because that's the only
runtime crate that depends on those in `aws/sdk/build`.

## Testing
Verified a clean run for `cargo semver-checks` in [an investigation
branch](https://github.com/smithy-lang/smithy-rs/actions/runs/7035082815/job/19144676499#step:4:1101).

----

_By submitting this pull request, I confirm that you can use, modify,
copy, and redistribute this contribution, under the terms of your
choice._
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ops Improves our operations and release process
Projects
None yet
Development

No branches or pull requests

1 participant