Ignore temporary files or suppress "Invalid Exclude: filename. File not found." message from Swift Package Manager - swift-package-manager

I have a Swift Package which consists only of C files. It builds and works great as part of my iOS app. However, the directory also contains a Makefile and a simple REPL to use for adhoc development and testing. Accordingly, there will often, but not always, be .o files, as well as support files like tags during active development.
I use the SPM Package { targets: [.target( exclude ... setting to make sure those files are never included while building the app which includes this package. However, it means that in a "clean" environment like a CI machine there will be build messages like:
Invalid Exclude '..../Packages/SchemeC/Sources/SchemeC/s7repl.o': File not found.
Invalid Exclude '..../Packages/SchemeC/Sources/SchemeC/s7sqlite.o': File not found.
Invalid Exclude '..../Packages/SchemeC/Sources/SchemeC/s7.o': File not found.
Invalid Exclude '.../Packages/SchemeC/Sources/SchemeC/TAGS.scheme': File not found.
Is there a way to mark a file as "Ignore" for Swift Package Manager? (I.e. similar to including a file in .gitignore?)

Related

Flow: resolving modules in a monorepo that uses Yarn workspaces

We have a monorepo that uses Yarn’s ‘workspaces’ feature, meaning that whenever possible, Yarn will hoist dependencies to the monorepo's root node_modules directory rather than keep them in the individual package's node_modules dir. This relies on Node’s module resolving algorithm, which continues to search for modules in node_modules directories up the dir tree until it finds the required module.
When using Flow types in a file that imports another package (internal or external to the monorepo), running Flow inside the package that contains that file causes a Cannot resolve <package-name> error to be thrown. It seems like Flow uses a different module resolving algorithm, and fails since the installed modules are hoisted to the root dir and Flow does not continue to search up the dir tree.
Is there a way around this other than running Flow from the root? Running from the root is less than optimal because it does not allow different settings for different packages in the monorepo.
Node version: 10.8.0
flow-bin version: 0.78.0
I also ran into this problem
To fix it need update .flowconfig:
[include]
../../node_modules/
FS struct:
/project_root
--/node_modules
--/packages
----/module1
------.flowconfig
Pick the components to be hoisted by hand with a directive like:
"nohoist": ["**/npm-package", "**/npm-package/**"]
or select them with an exclude glob:
"nohoist": [
"**/!(my-site|my-cms|someones-components)"
]
See my answer to another question for more information.

Load file implicitly from Path

I am trying to get my head around programming with multiple modules (in different files). I don't want to load explicitly the files with ìnclude in the right order.
I am using the Atom IDE as my development platform, so I don't run julia explicitly.
when I am just using importall Datastructures (where ModuleName is the name of the module) julia complains:
LoadError: ArgumentError: Module Datastructures not found in current path.
Run `Pkg.add("Datastructures")` to install the Datastructures package.
while loading F:\dev\ai\Interpreter.jl, in expression starting on line 8
There are two ways to build a package or module in julia:
1) Use the tools in PkgDev. You can get them with Pkg.add("PkgDev") ; using PkgDev. Now you can use PkgDev.generate("MyPackageName", "MIT") (or whatever license you prefer) to build your package folder. By default, julia will build this folder in the same directory as all your other external packages. On Linux, this would ~/.julia/v0.6/ (or whatever version you are running). Also by default, this folder will be on the julia path, so you can just type using MyPackageName at the REPL to load it.
Note that julia essentially loads the package by looking for the file ~/.julia/v0.6/MyPackageName/src/MyPackageName.jl and then running it. If your module consists of multiple files, you should have all of them in the ~/.julia/v0.6/MyPackageName/src/ directory, and then have a line of code in the MyPackageName.jl file that says include("MyOtherFileOfCode.jl").
2) If you don't want to keep your package in ~/.julia/v0.6/ for some reason, or you don't want to build your package using PkgDev.generate(), you can of course just set the files up yourself.
Let's assume you want MyPackageName to be stored in the ~/MyCode directory. First, create the directory ~/MyCode/MyPackageName/. Within this directory, I strongly recommend using the same structure that julia and github use, i.e. store all your code in a directory called ~/MyCode/MyPackageName/src/.
At a minimum, you will need a file in this directory called ~/MyCode/MyPackageName/src/MyPackageName.jl (just like in the method above). This file should begin with module MyPackageName and finish with end. Then, put whatever you want in-between (including include calls to other files in the src directory if you wish).
The final step is to make sure that julia can find MyPackageName. To do this, you will need ~/MyCode to be on the julia path. To do this, use: push!(LOAD_PATH, "~/MyCode") or push!(LOAD_PATH, "~/MyCode/MyPackageName").
Maybe you don't want to have to run this command every time you want to access MyPackageName. No problem, you just need to add this line to your .juliarc.jl file, which is automatically run every time you start julia. On Linux, your .juliarc.jl file should be in your home directory, i.e. ~/.juliarc.jl. If it isn't there, you can just create it and put whatever code you want in there. If you're on a different OS, you'll have to google where to put your .juliarc.jl.
This answer turned out longer than I planned...

Unable to remove a folder containing file

I'm using Robotframework 3.0 in java platform using RIDE on windows 10. I'm trying to use commands from the Operating system library like "Empty Directory and Remove Directory". After executing those commands I get this error: "OSError: unlink(): an unknown error occurred: Directorypath" and Directory does not exist
Here is the list with all the combinations I used and the output I received
My questions are:
1. Using Remove Directory recursive=True; Why this command is not able to delete the folder if it has a file. I was able to use the same command without any errors.
2. Using Empty directory, Why I'm getting error that the directory does not exist. I understand that the directory is not available. I was assuming that this command will ignore if the directory is not available. If my assumption is wrong then how can I solve it.
I would need help on the fail scenarios.
Empty Directory does in fact check does the target directory exist (that happens in a private keyword _list_dir in the library).
If you want to call it, and not fail the case if the dir does not exist, then surround it in Run Keyword And Ignore Error:
${rc} ${msg} Run Keyword And Ignore Error Empty Directory ${target dir}
Run Keyword If '${rc}' == 'FAIL' Handle Failed Deletion As You Like
As for 1), when you do call Remove Directory with recursive=True, it will/should have no problems deleting the directory and any files/subdirectories from it.
The error you're seeing - OSError: unlink() ... is propagated by the python's shutil module, which does the actual deletion. There could be a number of reasons - the account you're running the tests with does not have permissions to delete that specific file (most likely), the file was added in parallel with the delete operation (not that likely, the exception would then be that the holding dir could not be unlinked), or similar reasons. Try it with a different path, not the windows user's temp dir, but one on which content you're sure you have full access and control.

Including a file in WEB-INF/lib

I am porting AXIS 2 SOAP webservice to an existing grails 2.4.4 project.
It works flawlessly when run from the IDE but not fram a WAR.
I have tracked this down to addresing.mar NOT being copied to the WEB-INF lib directory. If I copy this file myself then ever thing works fine.
We are using Jenkins for CI and using the Grails plugin to do the compilation of and packaging of the WAR file.
This does not include the addresing.mar file. Also when running the Grails war command it is not included.
I have tried many way to get this to be included. The AXIS plug in just wrecks the compile to teh extent that it is unusable.
I have just spent 2 days googling and tried ever thing I can find in just about every combination.
We are now getting to the point we we are considering post processing the war file and adding the addresing.mar file directly.
Though that will work it would not help my understanding of what I am doing wrong!
Any help most appreciated.
Try saving your file inside the /src file. Grails autowires external libraries when saved inside this folder.
Note: This is only applicable to Grails versions running less than 3.x.x
I don't know too much about AXIS 2 SOAP and the mentioned addressing.mar file but if it's available in the project while building the war file you could use the grails.war.resources parameter in BuildConfig.groovy and simply copy it into the lib directory in the following way:
grails.war.resources = { stagingDir, args ->
copy(file: "path/to/addressing.mar", todir: "${stagingDir}/WEB-INF/lib/")
}
more info about grails.war.resources in the manual

Build Chromium webui test without rebuilding all browser_tests

I added a simple JavaScript test to /src/chrome/test/data/webui/ and included the file in /src/chrome/chrome_tests.gypi.
I built it like this: ninja -C out/Debug browser_tests. That takes a while though. Is there a way to rebuild my test only, without also building all the other browser tests?
browser_tests is the only executable target to compile those tests so you need to use it in any case even if you perform a change in a single test. But you may want to try shared library compilation to improve the speed of your builds. For that just export GYP_DEFINES='component=shared_library' and then ./build/gyp_chromium before recompiling.
NOTE: This answer is not applicable to webui tests (they do not depend on test_data_dir_. Further, it is only relevant to Linux.
Some test files is not compiled into browser_tests. For these cases, just set the CR_SOURCE_ROOT environment variable to the Chromium source directory, e.g. (if your Chromium source files are located at ~/chromium/src)
CR_SOURCE_ROOT=~/chromium/src/ ./out/Debug/browser_tests
I discovered this when I tried to figure out why the extension tests did not run. I started with looking up the error message in the source code:
Extension error: Could not load extension from ''. Manifest file is missing or unreadable.
After some debugging with gdb, I found that the test extension that is supposed to be loaded by ExtensionBrowserTest::LoadExtensionWithFlags did not load because the path was invalid. path was somehow set to "extensions/api_test/webrequest", and because this is not an absolute path, it was cleared in UnpackedInstaller::GetAbsolutePath by extension_path_ = base::MakeAbsoluteFilePath(extension_path_);.
Consequently, Chromium tries to load an extension from location "" (empty string), which obviously fails.
Ultimately, I tracked down the cause to test_data_dir_, which is initialized at DIR_TEST_DATA, which in turn is derived from DIR_SOURCE_ROOT, which in turn is read from the CR_SOURCE_ROOT environment variable. With the following command, my tests ran again, and I was able to update the extension tests without recompiling.
CR_SOURCE_ROOT=~/chromium/src/ ./out/Debug/browser_tests

Resources