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

Update docker z3 version 4.8.16 #12967

Merged
merged 2 commits into from
May 12, 2022
Merged

Update docker z3 version 4.8.16 #12967

merged 2 commits into from
May 12, 2022

Conversation

leonardoalt
Copy link
Member

No description provided.

@github-actions
Copy link

solbuildpackpusher/solidity-buildpack-deps:ubuntu2004.clang-12 [solbuildpackpusher/solidity-buildpack-deps@sha256:5a6bbbae59f5f344e1ba5a7570b5a198a22e23bfd8d38ef59a38f318398710ea].

@github-actions
Copy link

solbuildpackpusher/solidity-buildpack-deps:ubuntu2004-12 [solbuildpackpusher/solidity-buildpack-deps@sha256:4c2d2860dddf2843fa0380cdf7c2d3bb4b6e72b6cbe69dc4978a56715c1c7ef3].

@github-actions
Copy link

solbuildpackpusher/solidity-buildpack-deps:ubuntu1604.clang.ossfuzz-17 [solbuildpackpusher/solidity-buildpack-deps@sha256:dbd6bfc80221e079c4da6f0a76b6ac60d877f6ce56f8b7c6f0d7ae18095bf37c].

@github-actions
Copy link

solbuildpackpusher/solidity-buildpack-deps:ubuntu2004.clang-12 [solbuildpackpusher/solidity-buildpack-deps@sha256:7f53f1bc3d89bdfb0725f604efbbec570d80ffa9b731b47a4842f4e286de0355].

@github-actions
Copy link

solbuildpackpusher/solidity-buildpack-deps:emscripten-10 [solbuildpackpusher/solidity-buildpack-deps@sha256:46a637ab16e15e2bcf03fbb4f9b7816c1eebc78e1c256ebd54161df94fb2a51f].

@github-actions
Copy link

solbuildpackpusher/solidity-buildpack-deps:ubuntu2004-12 [solbuildpackpusher/solidity-buildpack-deps@sha256:5087cc068b48787e89887804e632120b3e65bc5c25086bdf7b152be4fe5fc9ba].

@github-actions
Copy link

solbuildpackpusher/solidity-buildpack-deps:ubuntu1604.clang.ossfuzz-17 [solbuildpackpusher/solidity-buildpack-deps@sha256:85b298c763adf5c516238246beb283640eb555e79e7ad6a8e7a6c9ed47ef6324].

@github-actions
Copy link

solbuildpackpusher/solidity-buildpack-deps:emscripten-10 [solbuildpackpusher/solidity-buildpack-deps@sha256:bd23831e0025e35a106005b4ac06cb3618f690bfa2833a5881b573c02d35d9fc].

@hrkrshnn
Copy link
Member

hrkrshnn commented May 4, 2022

Tests are failing here.

@leonardoalt
Copy link
Member Author

Tests are failing here.

Yea will rebase it now that the tests were merged

@leonardoalt leonardoalt force-pushed the update_z3_docker branch 2 times, most recently from 31d9ea3 to 90e2ca9 Compare May 5, 2022 09:42
@leonardoalt leonardoalt changed the base branch from develop to fix_smt May 5, 2022 09:42
Base automatically changed from fix_smt to develop May 5, 2022 12:26
@leonardoalt
Copy link
Member Author

@hrkrshnn this can now be merged too

@leonardoalt leonardoalt enabled auto-merge May 5, 2022 12:42
@@ -4,6 4,10 @@ set -ex
ROOTDIR="$(dirname "$0")/../.."
cd "${ROOTDIR}"

ABSOLUTE_PATH=$(pwd)

git config --global --add safe.directory "${ABSOLUTE_PATH}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting. Looking at the documentation: https://git-scm.com/docs/git-config#Documentation/git-config.txt-safedirectory

This feels a bit scary. This is where the release binaries are built right? I wonder if a git hook can influence the binary somehow?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, the --global flag modifies user's ~/.gitconfig. I think it would be better to modify config only for the current repo in case someone has to run this script on his machine.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just saw this in the docs:

This config setting is only respected when specified in a system or global config, not when it is specified in a repository config or via the command line option

So I see why it's --global. But in that case I think this is something that should be done in the docker image, not in the build script.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels a bit scary. This is where the release binaries are built right? I wonder if a git hook can influence the binary somehow?

After taking a closer look at it, the root of the issue is that we're giving git inside the container a repo dir owned by the user from outside of the container. git notices different users and bails. I don't think there's any inherent risk in that. At least it's not that different from the situation where you just clone the repo and run git on it. It's really the same user doing things.

The thing that's kinda bad is that we're running as root inside the container and it's not a good practice but this is independent of this PR. We already have this problem.

Overall we could work around the issue by chowning the files or by ensuring that we use the same user on both sides. But I think that safe.directory fix is good enough. Just IMO the build.sh script is not the best place to run it since it's a global change. I think it belongs either in the dockerfile or in docker_upgrade.sh. Probably the latter since the repo dir is not hard-coded in the image and it's the script that attaches the volume that determines that location.

@cameel cameel force-pushed the update_z3_docker branch from 90e2ca9 to 28bba3d Compare May 10, 2022 11:18
@cameel
Copy link
Member

cameel commented May 10, 2022

I have just pushed a slightly different workaround for the issue. I moved the git config change to docker_upgrade.sh since that's the script that is aware where the repo comes from and who owns it. The build scripts should not be concerned with that. Other than that, it still does the same thing, i.e. marks the dir as safe.

I also found the answer for why this is needed: https://github.blog/2022-04-12-git-security-vulnerability-announced/
The new option was added very recently due to a security issue. This explains why it's only failing now.

@github-actions
Copy link

solbuildpackpusher/solidity-buildpack-deps:ubuntu2004-12 [solbuildpackpusher/solidity-buildpack-deps@sha256:824250ee3f87489e4d138c62f73ad57a3d18dd05862a68d99a650c66082c7332].

@github-actions
Copy link

solbuildpackpusher/solidity-buildpack-deps:ubuntu1604.clang.ossfuzz-17 [solbuildpackpusher/solidity-buildpack-deps@sha256:503337b33deb77d02f2416af2d4ecbffa684031c97f8ba2e38590e30901a6442].

@github-actions
Copy link

solbuildpackpusher/solidity-buildpack-deps:emscripten-10 [solbuildpackpusher/solidity-buildpack-deps@sha256:47086f4056cead423e2589a51834bc7161fc5507aa25b145ab669d3fdeac9ccc].

@github-actions
Copy link

solbuildpackpusher/solidity-buildpack-deps:ubuntu2004.clang-12 [solbuildpackpusher/solidity-buildpack-deps@sha256:e2ebd60d4a29b27d75f350d1d456e5bc91171e664275ff458dbee3f4737ea6ce].

@leonardoalt
Copy link
Member Author

So we should change the docker hashes because the other PR was already merged.

@cameel cameel disabled auto-merge May 10, 2022 16:23
@cameel cameel force-pushed the update_z3_docker branch from 28bba3d to c64fb7a Compare May 10, 2022 16:24
@cameel
Copy link
Member

cameel commented May 10, 2022

Yeah, but that's after we merge this right?

BTW, I just rebased it on develop to make the failing archlinux soltest job pass. So we'll get new hashes in a moment.

@leonardoalt
Copy link
Member Author

Yeah, but that's after we merge this right?

BTW, I just rebased it on develop to make the failing archlinux soltest job pass. So we'll get new hashes in a moment.

Shouldn't it be the same hashes as the last ones posted?

@leonardoalt
Copy link
Member Author

The docker images are already published anyway, whether we merge this or not. So we'd usually create another PR using the hashes here, and when everything works there, we merge both of them.

@github-actions
Copy link

solbuildpackpusher/solidity-buildpack-deps:ubuntu2004.clang-12 [solbuildpackpusher/solidity-buildpack-deps@sha256:39a628620c35d61033b11f033dbcca342cbacc0e51fd190e06f7db1e74470197].

@github-actions
Copy link

solbuildpackpusher/solidity-buildpack-deps:ubuntu2004-12 [solbuildpackpusher/solidity-buildpack-deps@sha256:43675fb5225df7cebffbe10d26e37099ed70a8398ff348c3512c2a698e435a36].

@github-actions
Copy link

solbuildpackpusher/solidity-buildpack-deps:ubuntu1604.clang.ossfuzz-17 [solbuildpackpusher/solidity-buildpack-deps@sha256:fd67ac47de58b0eff088c72ae1f6261b27df3d89b1f67ad3ed9c40fee8471228].

@github-actions
Copy link

solbuildpackpusher/solidity-buildpack-deps:emscripten-10 [solbuildpackpusher/solidity-buildpack-deps@sha256:feac0e5fba12c346ad18d70eb10e98ffabba80da25074a71b22dced4f2148aed].

@cameel
Copy link
Member

cameel commented May 10, 2022

Shouldn't it be the same hashes as the last ones posted?

Would be nice if they were but the build process is not that deterministic unfortunately.

The docker images are already published anyway, whether we merge this or not. So we'd usually create another PR using the hashes here, and when everything works there, we merge both of them.

OK, we can do it that way too. I guess this way we'll know for sure that CI passes with these images.

@leonardoalt
Copy link
Member Author

OK, we can do it that way too. I guess this way we'll know for sure that CI passes with these images.

Yea exactly

@cameel
Copy link
Member

cameel commented May 11, 2022

@leo Wait, I just noticed that the hashes that are in develop are already for the bumped versions we have here. So what really happened? I thought this PR was on top of what is already in develop but looks like it must have been done first, hashes updated and then merged without merging this first?

I'm not sure if I should now just update the hashes without updating versions or bump the versions and rebuild again?

@leo
Copy link

leo commented May 11, 2022

Wrong username, I think?

@leonardoalt
Copy link
Member Author

Wrong username, I think?

haha yes

@leonardoalt
Copy link
Member Author

I'm not sure if I should now just update the hashes without updating versions or bump the versions and rebuild again?

The other PR, the one that uses the hashes from here, is usually merged first. It was merged assuming this one was fine

@leonardoalt
Copy link
Member Author

@cameel let's bump the versions in the dockerfiles and get new hashes just to be sure they're updated

@cameel
Copy link
Member

cameel commented May 12, 2022

Unfortunately looks like I can't bump versions because upgrade_docker.sh has a check that enforces increase by one. Well, let's just merge them with the current versions: #13012.

Copy link
Member Author

@leonardoalt leonardoalt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't approve cus original author, but LGTM.

@leonardoalt leonardoalt enabled auto-merge May 12, 2022 13:18
@leonardoalt leonardoalt merged commit 2aba061 into develop May 12, 2022
@leonardoalt leonardoalt deleted the update_z3_docker branch May 12, 2022 13:23
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.

5 participants