Skip to content

Fix ./build.sh --portableBuild false - #50097

Merged
bartonjs merged 1 commit into
dotnet:mainfrom
omajid:fix-non-portable-build
Apr 19, 2021
Merged

Fix ./build.sh --portableBuild false#50097
bartonjs merged 1 commit into
dotnet:mainfrom
omajid:fix-non-portable-build

Conversation

@omajid

@omajidomajid commented Mar 23, 2021

Copy link
Copy Markdown
Member

Non-portable builds are used by source-build and also useful for testing/debugging things, like trying out OpenSSL 3.0:
#46526 (comment)

Fixes: #43219

Should I add a CI run that verifies ./build.sh --portableBuild false works?

@ghost

Copy link
Copy Markdown

I couldn't figure out the best area label to add to this PR. If you have write-permissions please help me learn by adding exactly one area label.

@omajid
omajidforce-pushed the fix-non-portable-build branch from 9227ad5 to 97c21faCompareMarch 23, 2021 14:06
@omajidomajid mentioned this pull request Mar 23, 2021
12 tasks
@ghost

Copy link
Copy Markdown

Tagging subscribers to this area: @dotnet/runtime-infrastructure
See info in area-owners.md if you want to be subscribed.

Issue Details

Non-portable builds are used by source-build and also use for testing/debugging things, like trying out OpenSSL 3.0:
#46526 (comment)

Fixes: #43219

Should I add a CI run that verifies ./build.sh --portableBuild false works?

Author:omajid
Assignees:-
Labels:

area-Infrastructure

Milestone:-

@danmoseley

Copy link
Copy Markdown
Contributor

Should I add a CI run that verifies ./build.sh --portableBuild false works?

cc @ViktorHofer for that question.

@omajid

Copy link
Copy Markdown
MemberAuthor

FWIW, having a CI leg for this would have caught #42415 sooner

@omajid

Copy link
Copy Markdown
MemberAuthor

I can't tell if the linux-musl-arm error is related to my changes or not. I would have understood a failure building/running ilasm/ildasm, but this is something else?

@omajid
omajidforce-pushed the fix-non-portable-build branch from 97c21fa to f78f38bCompareMarch 25, 2021 13:36
@omajid
omajidforce-pushed the fix-non-portable-build branch from f78f38b to f87df0cCompareApril 7, 2021 20:13
@omajidomajid changed the title WIP: Fix ./build.sh portableBuild falseFix ./build.sh portableBuild falseApr 8, 2021
@omajidomajid changed the title Fix ./build.sh portableBuild falseFix ./build.sh --portableBuild falseApr 8, 2021
@omajidomajid closed this Apr 13, 2021
@omajidomajid reopened this Apr 13, 2021
@omajid
omajidforce-pushed the fix-non-portable-build branch from f87df0c to 0716d25CompareApril 13, 2021 19:01
@omajid

Copy link
Copy Markdown
MemberAuthor

Can someone please review this? The test failures look unrelated to my changes.

@ViktorHofer

Copy link
Copy Markdown
Member

Should I add a CI run that verifies ./build.sh --portableBuild false works?

I think we should have a non portable build in CI to protect that scenario. Unsure if per PR or as a rolling build.

@ViktorHofer
ViktorHofer requested a review from a teamApril 14, 2021 15:34
@omajid

Copy link
Copy Markdown
MemberAuthor

#50811 (comment):

once #50097 gets in, we can add the --portableBuild false flag to this leg.

@ViktorHofer

Copy link
Copy Markdown
Member

So we probably wanna do this as part of this PR now as the other change is already merged?

@omajid
omajidforce-pushed the fix-non-portable-build branch from 0716d25 to f015252CompareApril 14, 2021 16:19
@ViktorHofer

Copy link
Copy Markdown
Member

Thanks a lot @omajid

@omajid

Copy link
Copy Markdown
MemberAuthor

Hey, @bartonjs, this new CI run is failing on CentOS 7 (with OpenSSL 1.0 non-portable):

$ podman run -it mcr.microsoft.com/dotnet-buildtools/prereqs:centos-7-source-build-20210408124356-5d87b80 bash -c 'rpm -qa | grep openssl'
openssl-devel-1.0.2k-21.el7_9.x86_64
openssl-libs-1.0.2k-21.el7_9.x86_64

The errors look like this:

/__w/1/s/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_rsa.c:88:26: error: implicit declaration of function 'EVP_PKEY_get0_RSA' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
const RSA* rsa = EVP_PKEY_get0_RSA(pkey);
^
/__w/1/s/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_rsa.c:88:26: note: did you mean 'EVP_PKEY_get1_RSA'?
/usr/include/openssl/evp.h:968:16: note: 'EVP_PKEY_get1_RSA' declared here
struct rsa_st *EVP_PKEY_get1_RSA(EVP_PKEY *pkey);
^
/__w/1/s/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_rsa.c:88:26: error: this function declaration is not a prototype [-Werror,-Wstrict-prototypes]
const RSA* rsa = EVP_PKEY_get0_RSA(pkey);
^
/__w/1/s/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_rsa.c:88:20: error: incompatible integer to pointer conversion initializing 'const RSA *' (aka 'const struct rsa_st *') with an expression of type 'int' [-Werror,-Wint-conversion]
const RSA* rsa = EVP_PKEY_get0_RSA(pkey);
^ ~~~~~~~~~~~~~~~~~~~~~~~
/__w/1/s/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_rsa.c:147:51: error: use of undeclared identifier 'RSA_PSS_SALTLEN_DIGEST'
EVP_PKEY_CTX_set_rsa_pss_saltlen(ctx, RSA_PSS_SALTLEN_DIGEST) <= 0)
^
/__w/1/s/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_rsa.c:163:26: error: implicit declaration of function 'EVP_PKEY_get0_RSA' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
const RSA* rsa = EVP_PKEY_get0_RSA(pkey);
^
/__w/1/s/src/libraries/Native/Unix/System.Security.Cryptography.Native/pal_evp_pkey_rsa.c:163:20: error: incompatible integer to pointer conversion initializing 'const RSA *' (aka 'const struct rsa_st *') with an expression of type 'int' [-Werror,-Wint-conversion]
const RSA* rsa = EVP_PKEY_get0_RSA(pkey);
^ ~~~~~~~~~~~~~~~~~~~~~~~

Are these known issues?

@bartonjs

Copy link
Copy Markdown
Member

Are these known issues?

I was originally going to say "sort of, I saw and fixed this in #51155". But that appears to be untrue.

#defineEVP_PKEY_get0_RSA local_EVP_PKEY_get0_RSA

belongs right above

@bartonjs

Copy link
Copy Markdown
Member

@omajid
omajidforce-pushed the fix-non-portable-build branch 2 times, most recently from 5e11bfc to c9e2a17CompareApril 14, 2021 21:31
@bartonjs

Copy link
Copy Markdown
Member

@omajid Looks like you didn't quite move it high enough. If you pull the newer main you should be able to get rid of the PSS_SALTLEN move (since I already did it and it's now a conflict), but adding the missing #define EVP_PKEY_get0_RSA local_EVP_PKEY_get0_RSA is still necessary.

Non-portable builds are used by source-build and also use for
testing/debugging things, like trying out OpenSSL 3.0:
dotnet#46526 (comment)Fixes: dotnet#43219
@omajid
omajidforce-pushed the fix-non-portable-build branch from c9e2a17 to 4fa7e11CompareApril 15, 2021 14:57
Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

./build.sh --portablebulid false fails

5 participants

@omajid@danmoseley@ViktorHofer@bartonjs@karelz