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

Binaries are not being removed from VMR when building from archive #4391

Closed
ellahathaway opened this issue May 8, 2024 · 6 comments · Fixed by dotnet/sdk#40777
Closed

Binaries are not being removed from VMR when building from archive #4391

ellahathaway opened this issue May 8, 2024 · 6 comments · Fixed by dotnet/sdk#40777
Assignees
Labels
area-build Improvements in source-build's own build process untriaged

Comments

@ellahathaway
Copy link
Member

When building the VMR from archive, the binaries are not removed from the VMR by the prep script. The binary tool still runs, it just isn't removing any binaries. See this run as an example (internal Microsoft link)

Copy link

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

@ellahathaway
Copy link
Member Author

It's because the /.git directory is being removed when we copy over the sources. This results in the .gitignore file not being used when the tool looks for ignored files. To fix this, all files must be added via git add . when a fake git repo is configured by the tool.

@omajid
Copy link
Member

omajid commented May 8, 2024

FWIW, when we use the tarball from a release on github, we may not have the original source (and the .gitignore files) to copy over.

@ellahathaway
Copy link
Member Author

ellahathaway commented May 8, 2024

FWIW, when we use the tarball from a release on github, we may not have the original source (and the .gitignore files) to copy over.

The tool definitely depends on having the .gitignores file. I get a PR out for a quick workaround ASAP.

@ellahathaway
Copy link
Member Author

ellahathaway commented May 8, 2024

Further issue, some repos have been including binaries in their .gitignore files (https://github.com/dotnet/dotnet/blob/8f3d7c26c231d54ad230f427a1005278c815dde6/src/fsharp/.gitignore#L43 for example). This has resulted in those binaries going undetected. I think that the best way forward is to just hardcode common paths that we know should be ignored.

@omajid
Copy link
Member

omajid commented May 8, 2024

On the Fedora side of things, I am looking at never running prep-source-build.sh (outside of a bootstrap scenario) and manually running a delete. It's looking like this: https://pagure.io/dotnet-sig/dotnet9.0/blob/main/f/dotnet9.0.spec#_427

# Remove all prebuilts and binaries
rm -rf .dotnet/
rm -rf packages/source-built
find -type f \( \
    -iname '*.bin' -or \
    -iname '*.db' -or \
    -iname '*.dll' -or \
    -iname '*.doc' -or \
    -iname '*.docx' -or \
    -iname '*.exe' -or \
    -iname '*.mdb' -or \
    -iname '*.mod' -or \
    -iname '*.msi' -or \
    -iname '*.netmodule' -or \
    -iname '*.nupkg' -or \
    -iname '*.obj' -or \
    -iname '*.p7b' -or \
    -iname '*.p7s' -or \
    -iname '*.pdb' -or \
    -iname '*.pfx' -or \
    -iname '*.so' -or \
    -iname '*.tar.gz' -or \
    -iname '*.tlb' -or \
    -iname '*.winmd' -or \
    -iname '*.zip' \
    \) \
    -delete

@MichaelSimons MichaelSimons added the area-build Improvements in source-build's own build process label May 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-build Improvements in source-build's own build process untriaged
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants