Skip to content

Add a script for exporting VMR as a source archive - #15226

Merged
MichaelSimons merged 6 commits into
dotnet:mainfrom
premun:prvysoky/pack.sh
Jan 13, 2023
Merged

MichaelSimons merged 6 commits into
dotnet:mainfrom
premun:prvysoky/pack.sh

Conversation

@premun

@premun premun commented Jan 9, 2023 •

Copy link
Copy Markdown
Member

Steps I used to verify this

  1. Start the default codespace from https://github.com/premun/dotnet/tree/premun/pack
  2. ./eng/pack-sources.sh -o /workspaces
    cd /workspaces
    tar xf dotnet-3b18fee3477e07c702977b43ffb1e7f9c2da352e.tar.gz
    cd dotnet-3b18fee3477e07c702977b43ffb1e7f9c2da352e
    unset RepositoryName
    ./prep.sh
    ./build.sh --clean-while-building --online
    

Resolves dotnet/source-build#3112

@premun
premun requested a review from a team as a code owner January 9, 2023 16:59
@premun

premun commented Jan 9, 2023 •

Copy link
Copy Markdown
Member Author

cc @omajid

@premun

premun commented Jan 10, 2023

Copy link
Copy Markdown
Member Author

cc @crummel @MichaelSimons

@MichaelSimons MichaelSimons left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Thoughts on adding CI coverage for this? Since RedHat is taking a dependency on this, it feels that we should ensure it doesn't regress. We could unit test it or possibly use it in one of the build legs. Alternatively I have thought at times we should have a separate pipeline that is run less frequently to cover things like this that don't need to run on every commit.

@MichaelSimons

MichaelSimons commented Jan 10, 2023 •

Copy link
Copy Markdown
Member

FYI in my environment the execution bit is preserved and there is no need for chmod +x *.sh. I tested in our Fedora 36 CI container - mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-36. Is this Codespaces behavior?

@MichaelSimons

Copy link
Copy Markdown
Member

I am getting the following error during the installer build:

/repos/tarball/dotnet-8a8b1f307bc642cd40f74235ca63993368185a63/src/installer/artifacts/source-build/self/src/src/redist/targets/GenerateMSIs.targets(73,5): error MSB3073: The command "git rev-list --count HEAD" exited with code 128. [/repos/tarball/dotnet-8a8b1f307bc642cd40f74235ca63993368185a63/src/installer/artifacts/source-build/self/src/src/redist/redist.csproj]
        0 Warning(s)
        1 Error(s)

Co-authored-by: Michael Simons <[email protected]>
@premun

premun commented Jan 11, 2023

Copy link
Copy Markdown
Member Author

FYI in my environment the execution bit is preserved and there is no need for chmod +x *.sh. I tested in our Fedora 36 CI container - mcr.microsoft.com/dotnet-buildtools/prereqs:fedora-36. Is this Codespaces behavior?

I think I just didn't push the same files into my VMR fork as in this PR. I have the flag now when running this again.

I am getting the following error during the installer build:

Ah, that must be because I had the tar unpacked under artifacts/tmp which is still inside of the original git repo. I will copy it out and try again.

@premun

premun commented Jan 11, 2023

Copy link
Copy Markdown
Member Author

Thoughts on adding CI coverage for this? Since RedHat is taking a dependency on this, it feels that we should ensure it doesn't regress. We could unit test it or possibly use it in one of the build legs. Alternatively I have thought at times we should have a separate pipeline that is run less frequently to cover things like this that don't need to run on every commit.

I agree it would be nice to have coverage of some sort. I'd ideally like to also get their other acceptance tests (like scans for binaries) to stay compliant in this regard as well.

@premun

premun commented Jan 11, 2023

Copy link
Copy Markdown
Member Author

@MichaelSimons I downloaded a 7.0 tarball and it has no .git directory neither? I thought the scenario in the original issue is something that worked with the tarball?

Is this flow from @omajid something new we weren't doing before? @omajid weren't you putting the tarball in a new git repo before ingestion or some other step that is now not expected with the VMR?

Looking at what the build does it must either be new or we had to be inside of a git repo before.

@omajid

omajid commented Jan 11, 2023

Copy link
Copy Markdown
Member

For 7.0 (and earlier), the "official" Fedora/RHEL build systems extract the tarball to a random location and build it. No git repository (or git metadata) is involved, unless the tarball already contains it. For local development (eg, me or other Fedora/RHEL dev), the 7.0 (and earlier) tarball is generally extracted to inside an unrelated repository before being built. If there's git metadata in that unrelated repo, it's bogus.

In both cases (official build or local dev), git metadata that's not part of the tarball is either bogus or not available, so it can't be used safely.

For 7.0 and earlier, we would use the dotnet/installer repo to build a tarball, instead of using git archive like I tried in dotnet/source-build#3112. But otherwise, the steps and the environment to build the contents of the tarball to produce a .NET SDK haven't changed.

@MichaelSimons

Copy link
Copy Markdown
Member

@premun - FYI, I took a quick look at a binlog from 7.0 CI and the git command gets skipped because of the condition.

Task "Exec" skipped, due to false condition; ( '$(GitCommitCount)' == '' ) was evaluated as ( '26511' == '' ).

In the tarball produced by these changes it is not.

@premun

premun commented Jan 11, 2023

Copy link
Copy Markdown
Member Author

Thanks @MichaelSimons, I was trying to call git commands in the tarball and they were failing as well so I was wondering how come it works there.

However, I just pulled Build.binlog from a PR build on the 7.0.2 branch and I see this:

image

I think the working directory is the cloned installer there though so that's why this works there.

@MichaelSimons

Copy link
Copy Markdown
Member

I think the working directory is the cloned installer there though so that's why this works there.

Yes, I had seen the same thing.

@premun

premun commented Jan 12, 2023

Copy link
Copy Markdown
Member Author

@mmitche you were right, the GitCommitCount is actually not required, I was able to build from the exported archive

@MichaelSimons MichaelSimons left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I am fine with merging this but I would like to see a follow up issue logged to add coverage in CI. The issues encountered in the initial development could happen at any time and we don't want to regress. As I mentioned earlier, I don't think this CI leg should be run on every commit given our resource constraints in CI. Running weekly seems more appropriate.

@premun

premun commented Jan 12, 2023

Copy link
Copy Markdown
Member Author

I am fine with merging this but I would like to see a follow up issue logged to add coverage in CI. The issues encountered in the initial development could happen at any time and we don't want to regress. As I mentioned earlier, I don't think this CI leg should be run on every commit given our resource constraints in CI. Running weekly seems more appropriate.

Created dotnet/arcade#12193

@premun

premun commented Jan 12, 2023

Copy link
Copy Markdown
Member Author

I will have to check tomorrow, the build failed again for some reason with the latest commit:

##vsotask.logissue type=error;sourcepath=/workspaces/dotnet-4d4550148a09807d9416978bf6ec7702eff85b8d/src/installer/artifacts/source-build/self/src/src/redist/targets/GenerateMSIs.targets;linenumber=73;columnnumber=5;code=MSB3073; The command "git rev-list --count HEAD" exited with code 128.

@premun

premun commented Jan 13, 2023

Copy link
Copy Markdown
Member Author

I will have to check tomorrow, the build failed again for some reason with the latest commit:

I ran everything again clean and it worked fine.

@MichaelSimons I see the Darwin leg failing in all PRs. Is this a known issue?

@premun

premun commented Jan 13, 2023

Copy link
Copy Markdown
Member Author

@marcpopMSFT can you help me merge this?

@MichaelSimons

Copy link
Copy Markdown
Member

@MichaelSimons I see the Darwin leg failing in all PRs. Is this a known issue?

Yes it is. I will merge it.

@MichaelSimons
MichaelSimons merged commit 2e488c8 into dotnet:main Jan 13, 2023
@premun
premun deleted the prvysoky/pack.sh branch January 13, 2023 15:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Packing the VMR into a tarball produces a tarball that fails to build

3 participants