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

[build] Fix make prepare ordering #937

Merged
merged 1 commit into from
Oct 17, 2017

Conversation

jonpryor
Copy link
Member

@Clancey was trying to build xamarin-android, which failed:

$ make prepare
./build-tools/scripts/generate-os-info Configuration.OperatingSystem.props
xbuild /p:Configuration=Debug  /p:_DebugFileExt=.pdb build-tools/dependencies/dependencies.mdproj
...
warning : Referenced Project ../../external/xamarin-android-tools/src/Xamarin.Android.Tools.AndroidSdk/Xamarin.Android.Tools.AndroidSdk.csproj not found, ignoring.
...
Xamarin.Android.BuildTools.PrepTasks/JdkInfo.cs(9,23): error CS0234: The type or namespace name 'Tools' does not exist in the namespace 'Xamarin.Android' (are you missing an assembly reference?)

The problem is that make prepare-deps, which builds
build-tools/dependencies/dependencies.mdproj, implicitly builds
build-tools/xa-prep-tasks/xa-prep-tasks.csproj, which in turn
depends on
external/xamarin-android-tools/src/Xamarin.Android.Tools.AndroidSdk/Xamarin.Android.Tools.AndroidSdk.csproj,
which is only reliably created by make prepare-externals
git submodule update --init --recursive.

Unfortunately, make prepare-external wasn't invoked until after
make prepare-deps, meaning there is no way for make prepare to
actually work on a clean install!

(This works on Jenkins because Jenkins automatically checks out all
submodules, so it never encounters this "clean checkout" scenario.)

Reorder the targets that make prepare executes so that
make prepare-external is run before make prepare-deps, ensuring
that git submodules exist before we attempt to use them.

@Clancey was trying to build xamarin-android, which failed:

	$ make prepare
	./build-tools/scripts/generate-os-info Configuration.OperatingSystem.props
	xbuild /p:Configuration=Debug  /p:_DebugFileExt=.pdb build-tools/dependencies/dependencies.mdproj
	...
	warning : Referenced Project ../../external/xamarin-android-tools/src/Xamarin.Android.Tools.AndroidSdk/Xamarin.Android.Tools.AndroidSdk.csproj not found, ignoring.
	...
	Xamarin.Android.BuildTools.PrepTasks/JdkInfo.cs(9,23): error CS0234: The type or namespace name 'Tools' does not exist in the namespace 'Xamarin.Android' (are you missing an assembly reference?)

The problem is that `make prepare-deps`, which builds
`build-tools/dependencies/dependencies.mdproj`, implicitly builds
`build-tools/xa-prep-tasks/xa-prep-tasks.csproj`, which in turn
depends on
`external/xamarin-android-tools/src/Xamarin.Android.Tools.AndroidSdk/Xamarin.Android.Tools.AndroidSdk.csproj`,
which is only reliably created by `make prepare-external`s
`git submodule update --init --recursive`.

Unfortunately, `make prepare-external` wasn't invoked until *after*
`make prepare-deps`, meaning there is no way for `make prepare` to
actually work on a clean install!

(This works on Jenkins because Jenkins automatically checks out all
submodules, so it never encounters this "clean checkout" scenario.)

Reorder the targets that `make prepare` executes so that
`make prepare-external` is run *before* `make prepare-deps`, ensuring
that git submodules exist before we attempt to use them.
@dellis1972 dellis1972 merged commit e124866 into dotnet:master Oct 17, 2017
Redth pushed a commit to Redth/xamarin-android that referenced this pull request Oct 30, 2017
@Clancey was trying to build xamarin-android, which failed:

	$ make prepare
	./build-tools/scripts/generate-os-info Configuration.OperatingSystem.props
	xbuild /p:Configuration=Debug  /p:_DebugFileExt=.pdb build-tools/dependencies/dependencies.mdproj
	...
	warning : Referenced Project ../../external/xamarin-android-tools/src/Xamarin.Android.Tools.AndroidSdk/Xamarin.Android.Tools.AndroidSdk.csproj not found, ignoring.
	...
	Xamarin.Android.BuildTools.PrepTasks/JdkInfo.cs(9,23): error CS0234: The type or namespace name 'Tools' does not exist in the namespace 'Xamarin.Android' (are you missing an assembly reference?)

The problem is that `make prepare-deps`, which builds
`build-tools/dependencies/dependencies.mdproj`, implicitly builds
`build-tools/xa-prep-tasks/xa-prep-tasks.csproj`, which in turn
depends on
`external/xamarin-android-tools/src/Xamarin.Android.Tools.AndroidSdk/Xamarin.Android.Tools.AndroidSdk.csproj`,
which is only reliably created by `make prepare-external`s
`git submodule update --init --recursive`.

Unfortunately, `make prepare-external` wasn't invoked until *after*
`make prepare-deps`, meaning there is no way for `make prepare` to
actually work on a clean install!

(This works on Jenkins because Jenkins automatically checks out all
submodules, so it never encounters this "clean checkout" scenario.)

Reorder the targets that `make prepare` executes so that
`make prepare-external` is run *before* `make prepare-deps`, ensuring
that git submodules exist before we attempt to use them.
@github-actions github-actions bot locked and limited conversation to collaborators Feb 4, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants