Skip to content

Conversation

@noctuelles
Copy link

There is one extra ../ in the ipcalc meson command.
It does not make sense to have two ../.. since the cross-file.txt is only one level above according to preceding commands.

@github-actions
Copy link
Contributor

github-actions bot commented Feb 5, 2026

Thank you for your contribution to Bootlin training materials ! Before being able to integrate those changes, we would like you to sign our Individual Contributor Assignment Agreement if you are an individual, or our Entity Contributor Assignment Agreement if you are submitting this work on behalf of an entity.
You will still be credited for your contribution, but we would like to keep the ability to switch to a different license for these materials, or to give a license exception to a customer funding some improvements or customization. You can sign the CLA by just posting a Pull Request Comment with the sentence below. Thanks !


I have read the CLA Document and I hereby sign the CLA.


Paul Louvel seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You can retrigger this bot by commenting recheck in this Pull Request. Posted by the CLA Assistant Lite bot.

@Tropicao
Copy link
Contributor

Tropicao commented Feb 5, 2026

recheck

@Tropicao
Copy link
Contributor

Tropicao commented Feb 5, 2026

@noctuelles Please ignore the failed check, this is due to our CLA assistant, but this step is only for external contributors. If you really want to make it pass, I have updated the needed configuration, so it will go if you rebase your branch on top of current master.

@tpetazzoni
Copy link
Contributor

tpetazzoni commented Feb 7, 2026

Thanks for the fix. However, I think the fix is not correct, even though I agree the instruction are not very clear.

Indeed, here is the sequence:

  1. You clone ipcalc
  2. You go into the ipcalc/ folder
  3. You create the file ../cross-file.txt, so the file will not be inside ipcalc/ sources, but one level up
  4. You create the build/ directory
  5. You enter the build/ directory. So at this point, you are indeed two levels down compared to where cross-file.txt was created.
  6. You start the build, and therefore you should use ../../cross-file.txt

The idea of creating cross-file.txt outside of the ipcalc sources is to make it clear that this file is not specific to ipcalc. It can be used to build any meson-based project, using the same toolchain.

Does that clear up the intention? If the instructions are not clear, feel free to provide some suggestions on how to clarify them. Maybe we can add a sentence like: "Note that we create the cross-file.txt file outside of ipcalc sources because this file is not specific to the build of ipcalc, and could be used to build any other meson-based project, using our toolchain".

@noctuelles
Copy link
Author

Thanks for the fix. However, I think the fix is not correct, even though I agree the instruction are not very clear.

Indeed, here is the sequence:

  1. You clone ipcalc
  2. You go into the ipcalc/ folder
  3. You create the file ../cross-file.txt, so the file will not be inside ipcalc/ sources, but one level up
  4. You create the build/ directory
  5. You enter the build/ directory. So at this point, you are indeed two levels down compared to where cross-file.txt was created.
  6. You start the build, and therefore you should use ../../cross-file.txt

The idea of creating cross-file.txt outside of the ipcalc sources is to make it clear that this file is not specific to ipcalc. It can be used to build any meson-based project, using the same toolchain.

Does that clear up the intention? If the instructions are not clear, feel free to provide some suggestions on how to clarify them. Maybe we can add a sentence like: "Note that we create the cross-file.txt file outside of ipcalc sources because this file is not specific to the build of ipcalc, and could be used to build any other meson-based project, using our toolchain".

It does ! Thank for the clarification, my bad for not reading carefully.
However, after checking slide no 396 of the course, the cross-file is present inside the project itself, and not one level above :

$ cat cross-file.txt
[binaries]
c = 'arm-none-linux-gnueabihf-gcc'
strip = 'arm-none-linux-gnueabihf-strip'
[host_machine]
system = 'linux'
cpu_family = 'arm'
cpu = 'cortex-a9'
endian = 'little'
$ mkdir build-cross
$ cd build-cross
$ meson --cross-file ../cross-file.txt --prefix /usr ..
$ ninja
$ DESTDIR=/tmp/target ninja install
$ file /tmp/target/usr/bin/ipcalc
/tmp/target/usr/bin/ipcalc: ELF 32-bit LSB executable, ARM

In this case the slide could be updated with the explanation you just gave. It does mention the cross file, but not the fact that it is not bound to a specific project.

@tleb
Copy link
Member

tleb commented Feb 9, 2026

I am not involved in this section, but maybe variables could help clear up such relative file paths, eg:

# start of instructions
base=$(pwd)
touch $base/cross-file.txt
git clone ... $base/foo
cd ...

# some part later
cd ...

# near the end
cd $base/foo
meson --cross-file $base/cross-file.txt --prefix /usr ..

So that we clarify what is the expected current working directory whenever it is important. That way we are allowed to screw up the cd sequence and still have working instructions.

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.

4 participants