Skip to content

Fix ubuntu 22 #41

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

Closed
wants to merge 2 commits into from
Closed

Fix ubuntu 22 #41

wants to merge 2 commits into from

Conversation

grafin
Copy link
Member

@grafin grafin commented Jul 11, 2023

There where several errors, which prevented this action to be used in ubuntu:22.04 docker container. See commits for details.

This should make this action usable on any debian-based distros.
@Totktonada Totktonada self-requested a review July 11, 2023 12:44
src/main.ts Outdated
Comment on lines 238 to 244
const files: Array<string> = output.split('\n').filter((f: string) => {
try {
return fs.statSync(f).isFile()
} catch (e) {
return false
}
})
Copy link
Member

Choose a reason for hiding this comment

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

Am I understand right that here we catch an exception from fs.statSync() regarding the non-existent file? If so, it would be more accurate to pass the throwIfNoEntry: false flag.

However, silent ignoring of all the non-existent files anyway looks a bit dangerous. I guess I can propose a better way.

See, the root of the problem is in dpkg excludes in the docker container.

$ cat /etc/dpkg/dpkg.cfg.d/excludes 
# Drop all man pages
path-exclude=/usr/share/man/*

# Drop all translations
path-exclude=/usr/share/locale/*/LC_MESSAGES/*.mo

# Drop all documentation ...
path-exclude=/usr/share/doc/*

# ... except copyright files ...
path-include=/usr/share/doc/*/copyright

# ... and Debian changelogs for native & non-native packages
path-include=/usr/share/doc/*/changelog.*

apt-get install cmake respects them, but dpkg -L doesn't. The file is created during build of the docker image, see here.

AFAIS, dpkg -L doesn't respect to explicitly passed --exclude-path and --include-path options. But we can just implement this filtering in Typescript.

I would hardcode the exclude/include rules as in the file listed above in the action code.

I don't insist, here are just my thoughts around.

However, I would describe the reason of the problem a bit deeper in the commit message (like it is done in this message, for example).

Copy link
Member

Choose a reason for hiding this comment

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

I would also add that it is more related to run in a docker container job rather than Ubuntu of a particular version. I guess that it is as related to Ubuntu 22.04 as for 20.04.

@@ -197,7 +209,7 @@ async function run_linux(): Promise<void> {

await core.group('Setting up repository', async () => {
await exec.exec('sudo tee /etc/apt/sources.list.d/tarantool.list', [], {
input: Buffer.from(`deb ${baseUrl}/ubuntu/ ${distro} main\n`)
input: Buffer.from(`deb ${baseUrl}/${distro_id}/ ${distro} main\n`)
Copy link
Member

@Totktonada Totktonada Jul 25, 2023

Choose a reason for hiding this comment

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

I vote up this enhancement, but it doesn't look related to the pull request title: it is not about Ubuntu 22.04.

Since the pull request is more about docker container jobs rather than specific to Ubuntu 22.04 I would rephrase the pull request title/description.

@Totktonada
Copy link
Member

@grafin, thanks for the patchset!

The changes are useful, look visually correct and AFAIK are tested on a private project.

However, there are some details I would polish before push.

First, pull request's title/description is a bit misleading: it seems, the changes are about docker container jobs in general rather than about specific Ubuntu 22.04. It would be nice to clarify.

Next, since our goal here is to make container jobs working, I would add some testing with container: ubuntu:focal into CI (and the same for ubuntu:jammy and for debian:bullseye and debian:bookworm). I guess that as result we'll add several more commits to fix remaining problems with container jobs and will get a ready to use action. At least, there is a known problem that we require sudo unconditionally even when the current user is the superuser (see #11 and #38).

In ubuntu:22.04 docker man dpkg contains followng:
"-L|--listfiles <package>...      List files 'owned' by package(s)."

dpkg -L cmake mentions file /usr/share/doc/cmake/NEWS.Debian.gz, which
is not present in the system after successful apt-get -y install cmake.
This led to setup-tarantool failing during packaging cache.

This patch catches error while calling io.cp and prints it as a warning.
@grafin grafin force-pushed the master branch 2 times, most recently from e3ac99a to dbb505a Compare February 22, 2024 11:11
@grafin
Copy link
Member Author

grafin commented Feb 22, 2024

Closed in favor of #45 (new PR needed because I created a branch here to test new test:). I fixed all these review comments there.

@grafin grafin closed this Feb 22, 2024
@Totktonada
Copy link
Member

@grafin Thanks! I'll take a look on a spare time.

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.

2 participants