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

Run e2e test for release build and fix it by switching back to stable #818

Merged
merged 8 commits into from
Feb 28, 2023

Conversation

NobodyXu
Copy link
Member

Plus printing RUSTFLAGS for justfile target build & check

Signed-off-by: Jiahao XU [email protected]

@NobodyXu
Copy link
Member Author

NobodyXu commented Feb 19, 2023

Hmmm, I suspect the error is not caused by #817 since macos and windows CI also failed.
Might need to do a bisect.

@NobodyXu
Copy link
Member Author

NobodyXu commented Feb 19, 2023

It seems like a dns issue of https://crates.io since we have been using trust-dns-resolver v0.22.0 for a long time and the failure is all related to dns failure.

But then I don't understand why the debug build succeeded.

On MacOS it failed with:

 WARN Failed to load root certificate specified by env SSL_CERT_FILE: Expected extension .pem or .der, but found Some(
    "crt",
)

invalid peer certificate contents: invalid peer certificate: UnknownIssuer

On Linux it failed with:

error trying to connect: dns error: request timed out

On Windows, it has been stuck for 1h.

@NobodyXu
Copy link
Member Author

NobodyXu commented Feb 19, 2023

Could it be that #774 is responsible for this?

On MacOS there's a "failed to load certificate error".
Perhaps we should only read from CARGO_BINSTALL_ROOT_CERT and then also document this behavior better in help page.

But then I'm still not sure why Linux and Windows release build failed.

@passcod
Copy link
Member

passcod commented Feb 19, 2023

hmm we shouldn't really be checking extension, I believe der has a magic number, we can see that. or just try der then fallback to pem

@NobodyXu
Copy link
Member Author

hmm we shouldn't really be checking extension, I believe der has a magic number, we can see that. or just try der then fallback to pem

I've found one crate file-format that can find out detect file format pem and der.

@passcod
Copy link
Member

passcod commented Feb 20, 2023

Sure, or we could check the first two bytes, and if they're 0x30 0x82, it's DER.

@NobodyXu
Copy link
Member Author

Sure, or we could check the first two bytes, and if they're 0x30 0x82, it's DER.

But then we still need to determine whether it's pem or reject it.
Using file-format seems to be most robust solution.

@NobodyXu NobodyXu force-pushed the run-e2e-test-for-release-build branch from f90e389 to a7434fb Compare February 20, 2023 09:48
@NobodyXu
Copy link
Member Author

The mysterious error is still there:

macos:

error sending request for url (https://
  │   crates.io/api/v1/crates/b3sum): error trying to connect: invalid peer
  │   certificate contents: invalid peer certificate: UnknownIssuer

linux:

error trying to connect: dns error: request timed out

and then windows is stuck forever.

Since they all happened when downloading from https://crates.io, I suspect this to be an upstream bug in crates_io_api.
I will have to spend more time investigating this.

@NobodyXu NobodyXu mentioned this pull request Feb 20, 2023
@NobodyXu NobodyXu force-pushed the run-e2e-test-for-release-build branch from a7434fb to b87ed1e Compare February 20, 2023 12:16
@NobodyXu
Copy link
Member Author

I am unable to reproduce this on my M1 Macbook air.

@passcod If you are free, can you try reproducing the error in the CI using please:

export CI=true
export JUST_FOR_RELEASE=true
just build && just e2e-tests

@NobodyXu
Copy link
Member Author

My rustc +nightly -vV used for testing yesterday:

rustc 1.69.0-nightly (065852def 2023-02-13)
binary: rustc
commit-hash: 065852def0903296da33a9eaf557f230bcf3a61a
commit-date: 2023-02-13
host: aarch64-apple-darwin
release: 1.69.0-nightly
LLVM version: 15.0.7

I will try to update it and see if it causes the release build to fail.

@NobodyXu
Copy link
Member Author

Upgrading to:

rustc 1.69.0-nightly (5243ea5c2 2023-02-20)
binary: rustc
commit-hash: 5243ea5c29b136137c36bd773e5baa663790e097
commit-date: 2023-02-20
host: aarch64-apple-darwin
release: 1.69.0-nightly
LLVM version: 15.0.7

cause the release build to fail, can confirm this is a regression in rustc nightly now, though I don't know what caused the regression.

I would probably open a channel in zulip.

@passcod
Copy link
Member

passcod commented Feb 21, 2023

I know it's a bit slower and doesn't have the buildstd etc but using stable to build would probably save us a chunk of time spent debugging this stuff.

@passcod
Copy link
Member

passcod commented Feb 21, 2023

I can't even build the current main locally because of missing deps at the moment, which isn't helping. Will see what I can do later today

@NobodyXu NobodyXu changed the title Run e2e test for release build Run e2e test for release build and fix release build by disabling miropt level 4 Feb 21, 2023
@NobodyXu
Copy link
Member Author

NobodyXu commented Feb 21, 2023

I know it's a bit slower and doesn't have the buildstd etc but using stable to build would probably save us a chunk of time spent debugging this stuff.

It's actually miropt level 4 that causes the mis-compilation here and I've disabled it.
buildstd has actually been working quite reliably for us.

@NobodyXu
Copy link
Member Author

@NobodyXu
Copy link
Member Author

Now blocked on upstream rust-cross/cargo-zigbuild#94

@NobodyXu NobodyXu added the Blocked: upstream Fix or feature is needed to be implemented upstream (in a dependency) label Feb 21, 2023
@NobodyXu
Copy link
Member Author

Now blocked on upstream rust-cross/cargo-zigbuild#94

Looks like this is another regression on rustc nightly.
We are really being the beta tester and should get a medal for this.

@passcod I really want to remove all -Z options and use stable, but it seems like split-debuginfo="packed" does not work without build-std (comment wrote by you) so looks like we are stuck on nightly for now.

@NobodyXu
Copy link
Member Author

I opened rust-lang/rust#108392 at upstream for this.

@passcod
Copy link
Member

passcod commented Feb 23, 2023

Yeah I think I was mistaken on the build-std x debuginfo stuff, I'll investigate that.

@passcod
Copy link
Member

passcod commented Feb 23, 2023

We are really being the beta tester and should get a medal for this.

🏅 !

@messense
Copy link

messense commented Feb 24, 2023

ld.lld: warning: Linking two modules of different target triples: '/tmp/rustcBaYWUF/libzstd_sys-f1eed7ecf7f44df3.rlib(zstd_common.o at 118376)' is 'armv6kz-unknown-linux-musleabihf' whereas 'ld-temp.o' is 'armv7-unknown-linux-gnueabihf'

This warning is also interesting.

@NobodyXu NobodyXu force-pushed the run-e2e-test-for-release-build branch from 05f25d9 to fbca3ce Compare February 26, 2023 11:35
@NobodyXu
Copy link
Member Author

To reproduce error in CI:

export CI=true
export JUST_FOR_RELEASE=true
export CARGO_BUILD_TARGET=armv7-unknown-linux-gnueabihf
export GLIBC_VERSION=2.17
export JUST_USE_CARGO_ZIGBUILD=true
just build

@NobodyXu NobodyXu changed the title Run e2e test for release build and fix release build by disabling miropt level 4 Run e2e test for release build and fix it by switching back to stable Feb 28, 2023
@NobodyXu
Copy link
Member Author

Yeah I think I was mistaken on the build-std x debuginfo stuff, I'll investigate that.

Turns out that build-std is not required and I've now trying to switch back to stable.
If it goes well, then we won't have this failure again.

@NobodyXu NobodyXu removed the Blocked: upstream Fix or feature is needed to be implemented upstream (in a dependency) label Feb 28, 2023
@NobodyXu NobodyXu force-pushed the run-e2e-test-for-release-build branch from a247848 to 56d8977 Compare February 28, 2023 11:40
@NobodyXu NobodyXu enabled auto-merge (squash) February 28, 2023 11:41
@NobodyXu NobodyXu merged commit 2bf70b6 into main Feb 28, 2023
@NobodyXu NobodyXu deleted the run-e2e-test-for-release-build branch February 28, 2023 11:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants