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

TOOLS-3318 Fix error when compiling for Debian ARM64 #601

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

baschny
Copy link

@baschny baschny commented Aug 16, 2023

Trying to compile under docker with debian11 under ARM, error is:

panic: ubuntu1804 platform name changed

SEE COMMENTS. Patch is not working...

I provide this patch on a "works for me" basis, as I have no clue how this platform.go works or is supposed to work - but this "ubuntu1804" part looked fishy to me anyway. Bug introduced probabaly by 7d4945232

Related: https://jira.mongodb.org/browse/TOOLS-3318

Trying to compile under docker with debian11 under ARM, error is:
```
panic: ubuntu1804 platform name changed
```
@baschny baschny changed the title Fix error when compiling for Debian ARM64 TOOLS-3318 Fix error when compiling for Debian ARM64 Aug 16, 2023
@baschny
Copy link
Author

baschny commented Aug 16, 2023

Please disregard this PR, this does not really solve the issue. The main problem seems to be the logic with the "platform detection" based on the currently running kernel version.

When compiling with Docker the kernel could be not "original one" which comes from the distribution you are compiling for. For example if I cross-compile on my Mac using the ARM64 Debian 11 images, I get an uname -sm of:

Linux aarch64

It seems that the code is trying to detect the distribution using uname -sm which doesn't seem logical.

Maybe consider using https://github.com/zcalusic/sysinfo to detect current distribution?

@baschny
Copy link
Author

baschny commented Aug 16, 2023

The hack solution is either:

	{
		Name:      "ubuntu1804",
		Arch:      ArchArm64,
		OS:        OSLinux,
		Pkg:       PkgDeb,
		Repos:     []Repo{RepoEnterprise, RepoOrg},
		BuildTags: []string{"failpoints", "ssl"},
	},
	{
		Name:      "ubuntu1804",
		Arch:      ArchX86_64,
		OS:        OSLinux,
		Pkg:       PkgDeb,
		Repos:     []Repo{RepoEnterprise, RepoOrg},
		BuildTags: defaultBuildTags,
	},

Also add the Arch: ArchAarch64 to the "ubuntu1804", because this is the assumed "Linux".

For me, the compliation also worked explicitly like this:

CI=1 EVG_VARIANT=debian11 ./make build

This overcomes it trying to detect the platform, and uses the "debian11" variant...

Hope this helps somebody.. :)

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.

1 participant