added commit-hash.txt file under export-subst flag#12717
Conversation
e93e202 to
17395cd
Compare
|
Approach looks good. We need to change all the code that reads those files and query the information from git if the contents contain placeholders. |
|
Maybe we can even execute a git command to do the replacement (of course not modify the files)? |
be09f5c to
ee4005f
Compare
|
Not sure if job failures are even related to the PR. There were some CircleCI problems yesterday to I reran it to make sure. It looks like CircleCI had some problems executing the bash code in the config. If it's reproducible, could also be that they changed something in their API/config format but that seems unlikely to me. |
@nishant-sachdeva Does this replace the placeholders only when you explicitly run |
|
It'll only replace the placeholders on If the files do not contain placeholders, we can assume that it's a release tarball and use the commit hash from the file. The tricky part will be the case, in which the files do contain placeholders: we will probably need to check if there is a release tag at the current commit to be able to tell, if we should build as prerelease or as release. EDIT: ah right - or we can inspect the top of the changelog instead as suggested in #9720. |
|
Using |
|
Is there are way for git to create the files during |
Would that really help that much? In any case, I think the only thing you can do is to exclude files from The only complicated part I really see for this is to determine whether we're at a release tag on a git checkout. |
|
Or put differently: for the commit hash this is straightforward, but the prerelease/release logic we will basically have to rewrite for this no matter what. |
I think it would. As I see it, the issue is all about source archives created by github. If these files were created only on |
ee4005f to
8ace852
Compare
8ace852 to
4bd0405
Compare
| @@ -32,15 +32,19 @@ endif() | |||
| if (EXISTS ${ETH_SOURCE_DIR}/commit_hash.txt) | |||
There was a problem hiding this comment.
We should really make it an error if it doesn't exist instead of just doing this conditionally.
Does the file(READ thing cause an error if the file doesn't exist? If so we can just remove the ìf entirely.
There was a problem hiding this comment.
Why was this marked as resolved?
92b0664 to
aecdd93
Compare
aecdd93 to
a04d83f
Compare
5bace78 to
8433936
Compare
7c4552f to
75291ac
Compare
75291ac to
adaa92d
Compare
| ) | ||
| endif() |
There was a problem hiding this comment.
We could also query git tag --points-at HEAD and check if it's a v* tag...
Ideally, we would default SOL_FORCE_RELEASE to true in that case, but that may be a hassle, so we could also just always force a release build then...
| cd "${BUILDDIR}" | ||
|
|
||
| cmake .. -DCMAKE_BUILD_TYPE="$BUILD_TYPE" "${@:2}" | ||
| if [[ "$(git tag --points-at HEAD 2>/dev/null)" == v* ]]; then |
There was a problem hiding this comment.
Is this robust in the case there are several tags at HEAD?
That usually won't happen, but if it ever does, this might break...
It should really check, whether any tag at the HEAD is a v* tag, shouldn't it?
adaa92d to
1294836
Compare
| if ("$Env:FORCE_RELEASE" -Or "$Env:CIRCLE_TAG") { | ||
| New-Item prerelease.txt -type file | ||
| Write-Host "Building release version." | ||
| ..\deps\cmake\bin\cmake --build . -j 10 --target install --config Release -DSOL_RELEASE_VERSION="On" |
There was a problem hiding this comment.
The cmake options here and below don't seem to match the new cmake options defined below, do they?
Also it doesn't seem nice to invoke cmake here and then again below...
6c68d8b to
ec10d35
Compare
ec10d35 to
5feb9a9
Compare
|
I think it's easier to redo this properly at some point rather than keeping this PR alive, so I'm closing for now. |
closes #9720